Agent skill

Storybook Testing

by yonatangross in yonatangross/orchestkit

Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking…

MITAuto-check passedTesting & QA

Install Storybook Testing

skills CLI
$ npx skills add yonatangross/orchestkit --skill storybook-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yonatangross/orchestkit storybook-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yonatangross/orchestkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/storybook-testing .claude/skills/storybook-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
storybook-testing
GitHub stars
292
Token cost
~2.3k tokens
SKILL.md length
635 words
Files
14 (incl. references)
Skills in repo
108
Repo updated
First seen
Licence
MIT

At a glance

Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking…

  • Writing component stories
  • SKILL.md covers Overview, Quick Reference, Storybook Testing Pyramid and Quick Start, plus 5 more sections
  • Calls npx
  • Setting up visual regression testing

What it does

Storybook Testing is an agent skill from yonatangross/orchestkit. Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking, accessibility addon testing, and autodocs generation. Use when writing component stories, setting up visual regression testing, configuring Storybook CI pipelines, or migrating from Storybook 9.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files, including reference files (for example `references/storybook-addon-ecosystem.md`, `references/storybook-ci-strategy.md` and `references/storybook-migration-guide.md`). Compatibility notes: Claude Code 2.1.277+.

It sits in Testing & QA, covering Visual regression testing, Unit testing and Accessibility. It works with Storybook and Vitest. The repository describes itself as: The Complete AI Development Toolkit for Claude Code. 106 skills, 36 agents, 171 hooks. Install ork for stable (v9.x), or ork-alpha for the v10 line, which ships daily. The licence is MIT.

When your agent uses it

  • Writing component stories
  • Setting up visual regression testing
  • Configuring Storybook CI pipelines
  • Migrating from Storybook 9

Example prompts

  • “/storybook-testing”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): Claude Code 2.1.277+.
  • Pre-approved tools (allowed-tools): Read, Glob, Grep, WebFetch, WebSearch

What it can do on your machine

Read from SKILL.md and the folder at commit e4ff8d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep
    • WebFetch
    • WebSearch

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Claude Code 2.1.277+.

    From compatibility in the SKILL.md frontmatter.

Context cost

Storybook Testing loads about 2.3k tokens when it runs, and up to ~4.7k if it reads all its reference files. Until then it costs about 100 tokens; SKILL.md has 635 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from yonatangross/orchestkit at commit e4ff8d9, republished under its MIT licence (© yonatangross). 635 words, ~2,250 tokens.

Download SKILL.mdSave it as .claude/skills/storybook-testing/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.
name
storybook-testing
description
Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking, accessibility addon testing, and autodocs generation. Use when writing component stories, setting up visual regression testing, configuring Storybook CI pipelines, or migrating from Storybook 9.
allowed-tools
Read, Glob, Grep, WebFetch, WebSearch
compatibility
Claude Code 2.1.277+.
license
MIT
user-invocable
false
disable-model-invocation
true
tool-coverage
illustrative
metadata.owner-agent
frontend-ui-developer
metadata.category
document-asset-creation
metadata.storybook-version
10.3
metadata.version
2.0.0
metadata.author
OrchestKit
metadata.complexity
medium

Storybook Testing — Storybook 10

Overview

Storybook 10 unifies component testing into a single workflow: interaction tests via play() functions, visual regression via Chromatic TurboSnap, and accessibility audits via the a11y addon — all running through Vitest. Stories are executable test specifications, not just documentation.

What's new in Storybook 10 (vs 9):

  • ESM-only enforced — the single breaking change; Node 20.16+ / 22.19+ / 24+ required; 29% smaller install
  • Module automocking (sb.mock) — build-time module mocking, scoped per-project in preview.ts
  • CSF factories (React, preview) — defineMain → definePreview → preview.meta() → meta.story() chain
  • Essential addons in core — viewport, controls, interactions, actions no longer separate deps
  • Import path changes — @storybook/test → storybook/test (old paths still work as aliases)
  • React Server Component story support — test RSC in isolation
  • Vitest 4 support — experimental-addon-test renamed to addon-vitest

When to use this skill:

  • Writing component stories in CSF3 format with TypeScript
  • Setting up interaction tests with play() functions
  • Configuring Chromatic visual regression with TurboSnap
  • Using module automocking at the story level
  • Running accessibility tests in CI via the a11y addon
  • Generating living documentation with autodocs
  • Migrating from Storybook 9 to 10

Quick Reference

RuleImpactDescription
storybook-csf3-factoriesHIGHTypesafe CSF3 story factories with satisfies Meta
storybook-play-functionsCRITICALInteraction testing with play() and @storybook/test
storybook-vitest-integrationHIGHRun stories as Vitest tests via @storybook/addon-vitest
storybook-chromatic-turbosnapHIGHTurboSnap reduces snapshot cost 60-90%
storybook-sb-mockHIGHStory-level module mocking with sb.mock
storybook-a11y-testingCRITICALAutomated axe-core accessibility scans in CI
storybook-autodocsMEDIUMAuto-generated docs from stories

Storybook Testing Pyramid

         ┌──────────────┐
         │   Visual     │  Chromatic TurboSnap
         │  Regression  │  (snapshot diffs)
         ├──────────────┤
         │ Accessibility│  @storybook/addon-a11y
         │   (a11y)     │  (axe-core scans)
         ├──────────────┤
         │ Interaction  │  play() functions
         │   Tests      │  (@storybook/test)
         ├──────────────┤
         │  Unit Tests  │  Vitest + storybookTest
         │  (stories)   │  plugin
         └──────────────┘

Each layer catches different defects: unit tests validate logic, interaction tests verify user flows, a11y tests catch accessibility violations, and visual tests catch unintended UI regressions.


Quick Start

CSF3 Story with Play Function
tsx
// Button.stories.tsx
import type { Meta, StoryObj } from '@storybook/react'
import { expect, fn, userEvent, within } from 'storybook/test'
import { Button } from './Button'

const meta = {
  component: Button,
  args: {
    onClick: fn(),
  },
} satisfies Meta<typeof Button>

export default meta
type Story = StoryObj<typeof meta>

export const Primary: Story = {
  args: {
    label: 'Click me',
    variant: 'primary',
  },
  play: async ({ canvasElement, args }) => {
    const canvas = within(canvasElement)
    const button = canvas.getByRole('button', { name: /click me/i })

    await userEvent.click(button)
    await expect(args.onClick).toHaveBeenCalledOnce()
    await expect(button).toHaveStyle({ backgroundColor: 'rgb(37, 99, 235)' })
  },
}
Vitest Configuration
ts
// vitest.config.ts
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'
import { defineConfig } from 'vitest/config'

export default defineConfig({
  plugins: [storybookTest()],
  test: {
    setupFiles: ['./vitest.setup.ts'],
  },
})

Key Principles

  • Stories are tests. Every story with a play() function is an executable interaction test that runs in Vitest.
  • CSF3 + satisfies for type safety. Use satisfies Meta<typeof Component> for full type inference on args and play functions.
  • Module automocking (SB 10). Register sb.mock(import(...)) in .storybook/preview.ts, configure per-story with mocked() in beforeEach. Never use vi.mock in story files. No factory functions — sb.mock is build-time, not runtime.
  • TurboSnap for CI speed. Only snapshot stories affected by code changes — reduces Chromatic usage by 60-90%.
  • Accessibility is not optional. The a11y addon runs axe-core scans on every story and gates CI on violations.
  • Living documentation. Autodocs generates prop tables and usage examples directly from stories — no separate docs site needed.

Show full SKILL.md (246 more words)Show less

Anti-Patterns (FORBIDDEN)

Anti-PatternWhy It FailsUse Instead
CSF2 Template.bind({})Deprecated, no type inference, will be removed in SB 11CSF3 object stories with satisfies
@storybook/test-runner packageDeprecated since Storybook 9@storybook/addon-vitest
vi.mock() in story filesLeaks between stories, breaks isolationRegister sb.mock(import(...)) in preview.ts, configure with mocked() in beforeEach
Full Chromatic snapshots on every PRExpensive and slowTurboSnap with onlyChanged: true
Manual accessibility checkingMisses violations, not repeatable@storybook/addon-a11y in CI pipeline
Separate documentation siteDrifts from actual component behaviorAutodocs with tags: ['autodocs']
Testing implementation detailsBrittle, breaks on refactorsTest user-visible behavior via play()
CJS imports in storiesESM-only since SB 9/10Use ESM imports, set "module": "ESNext" in tsconfig

Storybook MCP Integration (addon-mcp)

When @storybook/addon-mcp is installed, agents can run tests and preview stories via MCP instead of CLI. This enables the generate → test → self-heal loop.

MCP Tools for Testing
ToolPurpose
run-story-testsRun component + a11y tests via MCP, returns pass/fail + violation details
preview-storiesReturns preview URLs for visual verification in chat
get-storybook-story-instructionsGuidance on writing effective stories + interaction tests
Agent Testing Loop
python
# 1. Generate component + CSF3 story
# 2. Run tests via MCP
results = run-story-tests(
    stories=[{ "storyId": "button--primary" }],
    a11y=True
)
# 3. If failures: read violations, fix, retry (max 3)
# 4. Preview in chat for visual confirmation
preview-stories(stories=[{ "storyId": "button--primary" }])
Setup
bash
npx storybook add @storybook/addon-mcp   # current: 0.6.0, Apr 2026
# Enable docs toolset in .storybook/main.ts:
#   componentsManifest: true    # was experimentalComponentsManifest (SB 10.3 rename, default-on)
npx mcp-add --type http --url "http://localhost:6006/mcp" --scope project

See storybook-mcp-integration skill for full tool reference and patterns.


References

  • references/storybook-migration-guide.md — Migration path from Storybook 9 to 10
  • references/storybook-ci-strategy.md — CI pipeline configuration for visual, interaction, and a11y testing
  • references/storybook-addon-ecosystem.md — Essential addons for Storybook 10 in 2026
  • storybook-mcp-integration — Storybook MCP tools: component discovery, testing, previews
  • react-server-components-framework — React 19 + Next.js 16 patterns (component architecture)
  • accessibility — Broader accessibility patterns beyond Storybook
  • devops-deployment — CI/CD pipeline patterns for automated testing

© yonatangross, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 13 other files (references) in src/skills/storybook-testing of yonatangross/orchestkit.

  • SKILL.md
  • references/storybook-addon-ecosystem.md
  • references/storybook-ci-strategy.md
  • references/storybook-migration-guide.md
  • rules/_sections.md
  • rules/_template.md
  • rules/storybook-a11y-testing.md
  • rules/storybook-autodocs.md
  • rules/storybook-chromatic-turbosnap.md
  • rules/storybook-csf3-factories.md
  • rules/storybook-play-functions.md
  • rules/storybook-sb-mock.md
  • rules/storybook-vitest-integration.md
  • test-cases.json

Open the folder on GitHubat commit e4ff8d9

Compare with similar skills

Storybook Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Storybook Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Storybook Testing this skillyonatangross/orchestkit292—~2.3kAutomated safety check: PassMIT
Web Testing with Playwright and Vitestwithkynam/vibecode-pro-max-kit1.1k—~892Automated safety check: PassApache-2.0
Playwright Testingchongdashu/vibejam-starter-pack149—~2.2kAutomated safety check: PassNone
Testingradix-ng/primitives274—~3.3kAutomated safety check: PassMIT
MCP Testingadeze/raindrop-mcp188—~1.6kAutomated safety check: PassMIT
Sanity Visual Regressionsanity-io/sanity6.4k—~3.4kAutomated safety check: PassMIT

Similar skills

  • Web Testing with Playwright and Vitest

    withkynam/vibecode-pro-max-kit

    Covers web testing from unit to E2E, load, visual, accessibility and security checks, with Playwright, Vitest and k6 guides plus a Playwright setup script.

    1.1k GitHub stars~892 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Playwright Testing

    chongdashu/vibejam-starter-pack

    Plan, implement, and debug frontend tests: unit/integration/E2E/visual/a11y.

    149 GitHub stars~2.2k tokensUpdated 5 mo ago
    Testing & QAAuto-check passed
  • Testing

    radix-ng/primitives

    Test Radix NG primitives across every layer and pick the RIGHT one for a change: Vitest unit (zoneless), jest-axe a11y, Playwright browser regression (apps/visual-regression), SSR…

    274 GitHub stars~3.3k tokensUpdated 12 days ago
    Testing & QAAuto-check passed
  • MCP Testing

    adeze/raindrop-mcp

    MCP Testing Strategies with Vitest, Inspector, and Integration Tests

    188 GitHub stars~1.6k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Sanity Visual Regression

    sanity-io/sanity

    Official

    Add, review, and maintain Chromatic visual regression coverage in the Sanity monorepo via dev/storybook stories, the vitest browser-mode suite, and Playwright e2e snapshots.

    6.4k GitHub stars~3.4k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Playwright Visual Testing

    managedcode/dotnet-skills

    Add, repair, or review Playwright visual regression tests for browser-facing .NET apps, including screenshot baselines, Pixelmatch thresholds, deterministic rendering, and GitHub Actions artifacts.

    486 GitHub stars~1.9k tokensUpdated today
    Testing & QAAuto-check passed

More from yonatangross/orchestkit

All 108 skills in this repo
  • API Design

    yonatangross/orchestkit

    API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs.

    292 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Architecture Decision Record

    yonatangross/orchestkit

    ADR templates in the Nygard format with context, decision, consequences, and alternatives.

    292 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Audit Full

    yonatangross/orchestkit

    Single-pass codebase analysis leveraging a 1M-token context window for comprehensive security scanning, architecture review, and dependency auditing.

    292 GitHub stars~3.5k tokensUpdated today
    Auto-check: notes
  • Code Review Playbook

    yonatangross/orchestkit

    Structured review processes, conventional comments, language-specific checklists, and feedback templates.

    292 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Create PR

    yonatangross/orchestkit

    Creates GitHub pull requests with pre-flight validation, conventional title formatting, and structured summary generation.

    292 GitHub stars~4.5k tokensUpdated today
    Auto-check: notes
  • Explore

    yonatangross/orchestkit

    Multi-angle codebase exploration spawning 3-5 parallel agents for code structure, data flow, architecture patterns, and health assessment.

    292 GitHub stars~3.9k tokensUpdated today
    Auto-check: notes

Works with

Questions about Storybook Testing

What does Storybook Testing do?

Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking…. Storybook Testing is an agent skill from yonatangross/orchestkit. Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking, accessibility addon testing, and autodocs generation.

When should I use Storybook Testing?

Storybook Testing fits situations like: writing component stories; setting up visual regression testing; configuring Storybook CI pipelines; migrating from Storybook 9.

How do I install Storybook Testing in Claude Code?

Run `npx skills add yonatangross/orchestkit --skill storybook-testing -a claude-code`. Or copy the skill folder (src/skills/storybook-testing in yonatangross/orchestkit) into .claude/skills/storybook-testing in your project. Claude Code loads it when a task matches its description.

How do I install Storybook Testing in Codex?

Run `npx skills add yonatangross/orchestkit --skill storybook-testing -a codex`. Or copy the skill folder (src/skills/storybook-testing in yonatangross/orchestkit) into .agents/skills/storybook-testing in your project. Codex loads it when a task matches its description.

Can I use Storybook Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yonatangross/orchestkit --skill storybook-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/storybook-testing, .gemini/skills/storybook-testing, .github/skills/storybook-testing and .opencode/skills/storybook-testing in your project.

What does Storybook Testing need to run?

Going by SKILL.md and its folder, Storybook Testing needs the command-line tools its instructions call (npx). Our summary lists: Python 3; Node.js. Its frontmatter pre-approves these tools: Read, Glob, Grep, WebFetch, WebSearch. Compatibility (from SKILL.md): Claude Code 2.1.277+..

Does Storybook Testing access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Storybook Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Storybook Testing use?

Storybook Testing is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Storybook Testing use?

About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Storybook Testing?

Skills that share tags, products or a category with Storybook Testing: Web Testing with Playwright and Vitest (withkynam/vibecode-pro-max-kit, 1.1k stars), Playwright Testing (chongdashu/vibejam-starter-pack, 149 stars), Testing (radix-ng/primitives, 274 stars) and MCP Testing (adeze/raindrop-mcp, 188 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Storybook Testing?

yonatangross (a GitHub user) maintains it in yonatangross/orchestkit, which has 292 GitHub stars. The repository holds 108 skills in this directory. The repository was last updated on October 10, 2026.

Source: yonatangross/orchestkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.