mcpField
S
storybook

storybook

github.com/pproencaDevelopment220137 installsUpdated 11w ago
Repository

About storybook

A reference skill containing 52 rules for using Storybook 9+ with TypeScript and React component libraries. It helps developers configure stories, tests, accessibility checks, documentation, and delivery across a component’s lifecycle.

Key features

  1. 0152 rules across eight categories
  2. 02Storybook setup and CSF3 authoring guidance
  3. 03Args, controls, decorators, and composition
  4. 04Interaction testing and accessibility checks
  5. 05Documentation, design systems, and deployment

Use cases

  1. 01Set up Storybook for a React component library
  2. 02Author stories and configure controls
  3. 03Run interaction tests and accessibility checks
  4. 04Document a design system and prepare builds for review

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill storybook

After installing, type/storybookin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
gotchas.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
args-derive-from-component-props.md
args-explicit-control-for-unions.md
args-no-jsx-in-args.md
args-pick-args-vs-parameters-vs-globals.md
args-use-fn-for-callbacks.md
axe-context-for-portals.md
axe-disable-rules-not-stories.md
axe-globals-manual-for-intentional-violations.md
axe-restrict-runonly-to-wcag-aa.md
axe-set-test-error-globally.md
build-cache-storybook-in-ci.md
build-chromatic-modes-multi-theme.md
build-deploy-static-build-to-shareable-host.md
build-manager-brand.md
build-prefer-vite-over-webpack.md
build-storybook-composition-refs.md
build-trim-test-bundle.md
config-add-addons-via-cli.md
config-narrow-stories-glob.md
config-pick-the-right-framework-package.md
config-static-dirs-not-bundler-imports.md
config-story-sort-for-large-libraries.md
config-tokens-css-vars-in-preview.md
config-typed-main-config.md
config-typed-preview.md

Details

From the project README

dot-skills Storybook Best Practices

Comprehensive guide for using Storybook 9+ as the workshop and test bench for a TypeScript/React component library. 52 rules across 8 categories, ordered by the lifecycle of a component in your design system: a wrong .storybook/main.ts cascades into every story; a malformed CSF Meta blocks autodocs, controls, tests, and the a11y panel for that file.

What this skill covers

  1. Setup — main.ts, preview.ts, framework selection (Vite vs Webpack, Next.js vs React-only), addon installation via the CLI, staticDirs.
  2. Story authoring (CSF3) — satisfies Meta<typeof Component>, named exports = stories, tags: ['autodocs'] placement, when render is appropriate, story naming conventions.
  3. Args, argTypes, controls — when to rely on inference, when to declare control: 'select', fn() from storybook/test for callbacks, args vs parameters vs globals.
  4. Decorators & composition — global providers in preview.ts, MSW for network mocks, subpath-import module mocking (Storybook 9+), decorator signature pitfalls.
  5. Interaction testing — play functions, the storybook/test import path (NOT @storybook/test), destructured canvas/userEvent, findBy* over waitFor, addon-vitest for CI, portable stories.
  6. Accessibility (axe-core via @storybook/addon-a11y) — parameters.a11y.test = 'error' as a real gate, per-rule disables, runOnly scoped to your WCAG target, portal context, globals.a11y.manual for intentional-violation fixtures.
  7. Documentation & design system — autodocs vs MDX, MDX referencing stories with <Canvas of={...} />, status tags, design tokens as stories, Figma links via parameters.design.
  8. Build & deployment — Vite over Webpack, on-demand bundling for large libraries, deploy to Chromatic/Vercel for designer review, CI cache configuration.

When to Apply

Reach for this skill when:

  • Editing or creating a *.stories.tsx, *.mdx, .storybook/main.ts, .storybook/preview.ts, or vitest.config.ts that loads storybookTest.
  • Setting up Storybook on a new project (framework choice, npx storybook init follow-up).
  • Adding or upgrading an addon (a11y, vitest, designs, msw).
  • Wiring component tests through play functions and the Vitest addon.
  • Investigating "Storybook is slow", "controls show text instead of select", "a11y panel shows nothing for my dialog", "play function is flaky in CI".

Skip this skill and use:

  • react-optimise / clean-code-ts-react for the underlying component design.
  • react-testing-library for render/screen/userEvent semantics outside Storybook.
  • WCAG/ARIA reference docs for the spec itself; this skill assumes you know what aria-labelledby does and tells you how addon-a11y checks it.

Rule Categories by Priority

Order reflects the component lifecycle (configure → author → wire → decorate → test → audit → document → ship). Earlier stages cascade.

PriorityCategoryImpactPrefixRules
1Setup & ConfigurationCRITICALconfig-8
2Story Authoring (CSF3)CRITICALcsf-8
3Args, ArgTypes & ControlsHIGHargs-5
4Decorators & CompositionHIGHdeco-7
5Interaction TestingHIGHtest-7
6Accessibility (axe)HIGHaxe-5
7Documentation & Design SystemMEDIUM-HIGHdocs-5
8Build, Performance & DeploymentMEDIUMbuild-7

Quick Reference

1. Setup & Configuration (CRITICAL)
2. Story Authoring — CSF3 (CRITICAL)
3. Args, ArgTypes & Controls (HIGH)
4. Decorators & Composition (HIGH)
5. Interaction Testing (HIGH)
6. Accessibility — axe (HIGH)
7. Documentation & Design System (MEDIUM-HIGH)
8. Build, Performance & Deployment (MEDIUM)

How to use

  • Start with references/_sections.md for the category structure and impact rationale.
  • For "I'm setting up Storybook," read all config- rules then csf-.
  • For "I'm writing a new story," read csf- and args-.
  • For "I want tests on my stories," read test- and deco-msw-for-network-mocks.
  • For "I want a11y to fail CI on violations," read all axe- rules.
  • For "I'm building a design system from scratch," read in this order: config-tokens-css-vars-in-preview, config-story-sort-for-large-libraries, csf-title-hierarchy-for-design-systems, deco-themes-addon-for-multi-brand, build-manager-brand, build-chromatic-modes-multi-theme. Then docs-component-status-tags and docs-design-tokens-as-stories for the governance + token-display layer.
  • For "I have a multi-package monorepo design system," read build-storybook-composition-refs first, then the design-system path above.
  • For "I need RTL / multi-direction coverage," read deco-rtl-direction-toggle then build-chromatic-modes-multi-theme to wire RTL into visual regression.
  • For gotchas.md: failure modes discovered over time; always check before debugging an obscure issue.
  • Add new rules using assets/templates/_template.md.

Reference files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for adding new rules
gotchas.mdFailure modes accumulated over time
metadata.jsonVersion, references, abstract

Related skills

  • clean-code-ts-react — Underlying component design quality (naming, function shape, abstraction).
  • react-testing-library — RTL queries and patterns when used outside Storybook.
  • web-interface-guidelines — Vercel Web Interface Guidelines for the components you're documenting.

Comments

Markdown supported