ork-assess
Assess a code change, design, architecture, workflow, or competing options against explicit criteria and evidence. Use when a request asks to assess, rate,…
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,
$ npx -y skills add yonatangross/orchestkit --skill storybook-testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/storybook-testingContext preview
The summary Claude sees to decide when to auto-load this skill.
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,
name: storybook-testing
license: MIT
compatibility: "Claude Code 2.1.251+."
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.
tags: [storybook, vitest, csf3, chromatic, turbosnap, visual-regression, play-functions, component-testing, a11y-testing, autodocs, esm-only, module-automocking]
context: fork
agent: frontend-ui-developer
version: 2.0.0
author: OrchestKit
user-invocable: false
disable-model-invocation: true
complexity: medium
persuasion-type: guidance
targets:
- library: storybook
version: ">=10.3.0"
metadata:
category: document-asset-creation
storybook-version: "10.3"
allowed-tools:
- Read
- Glob
- Grep
- WebFetch
- WebSearchStorybook 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):
**When to use this skill:**
---
| Rule | Impact | Description | |------|--------|-------------| | `storybook-csf3-factories` | HIGH | Typesafe CSF3 story factories with `satisfies Meta` | | `storybook-play-functions` | CRITICAL | Interaction testing with `play()` and `@storybook/test` | | `storybook-vitest-integration` | HIGH | Run stories as Vitest tests via `@storybook/addon-vitest` | | `storybook-chromatic-turbosnap` | HIGH | TurboSnap reduces snapshot cost 60-90% | | `storybook-sb-mock` | HIGH | Story-level module mocking with `sb.mock` | | `storybook-a11y-testing` | CRITICAL | Automated axe-core accessibility scans in CI | | `storybook-autodocs` | MEDIUM | Auto-generated docs from stories |
---
┌──────────────┐
│ 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.
---
// 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.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'],
},
})---
---
| Anti-Pattern | Why It Fails | Use Instead | |-------------|-------------|------------
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.
Repo: yonatangross/orchestkit
Assess a code change, design, architecture, workflow, or competing options against explicit criteria and evidence. Use when a request asks to assess, rate,…
Compare plausible implementation, architecture, product, or operational approaches before committing to one. Use when a request asks to brainstorm, think…
Map an unfamiliar codebase, feature, architecture, data flow, or operational path with file-backed evidence. Use when a request asks how a system works, where…
Make an approved, scoped change and prove the affected behavior. Use when a request asks to implement, build, add, or land a feature that already has an agreed…
Review a pull request or branch for correctness, regressions, security, operational risk, and missing evidence. Use when a request asks to review a PR, review…
Verify that existing work is ready to merge, release, or hand off using an explicit evidence contract. Use when a request asks to verify, validate, prove,…