skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
oakoss/agent-skills110 installs

storybook-stories

Writes and maintains Storybook stories and interaction tests using CSF3 format. Covers component stories, play functions, visual regression testing with Chromatic, and accessibility testing. Use when creating component documentation, writing interaction tests, debugging test failures, configuring visual snapshots, or updating story structure. Use for CSF3, play functions, userEvent, Testing Library queries, Chromatic configuration, autodocs, MDX.

How do I install this agent skill?

npx skills add https://github.com/oakoss/agent-skills --skill storybook-stories
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides comprehensive documentation and patterns for writing Storybook stories and interaction tests using CSF3. No security issues were detected.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

  • Runlayerpass

    5 files scanned · No issues

What does this agent skill do?

Storybook Stories

Overview

Storybook is a frontend workshop for building UI components in isolation. Stories are written in Component Story Format 3 (CSF3), which uses object syntax with args for type-safe component documentation and testing.

When to use: Component documentation with live examples, interaction testing with play functions, visual regression testing, accessibility validation, design system maintenance, isolated component development.

When NOT to use: End-to-end testing (use Playwright/Cypress), API integration testing (use Vitest/Jest), full application testing (use browser automation), performance testing (use Lighthouse/WebPageTest).

Quick Reference

PatternAPIKey Points
Basic storyexport const Default: Story = { args }Use args for simple single components
Complex storyexport const Example: Story = { render }Use render for multi-component layouts
Meta configurationconst meta = { component, args } satisfies MetaDefine defaults and argTypes
Interaction testplay: async ({ canvas, userEvent, args })canvas and userEvent provided directly
User interactionawait userEvent.click(element)Always await userEvent methods
Query elementscanvas.getByRole('button')Prefer getByRole over other queries
Assertionsawait expect(args.onPress).toHaveBeenCalled()Use storybook/test assertions
beforeEach hookbeforeEach: async ({ args }) => {}Setup mocks before story renders
Play compositionawait OtherStory.play?.(context)Reuse setup across stories
Autodocstags: ['autodocs']Enable automatic documentation
Controls customizationargTypes: { variant: { control: 'select' } }Configure control panel
Decoratorsdecorators: [withTheme]Add wrappers or context providers
Parametersparameters: { layout: 'centered' }Configure addon behavior per story
Chromatic snapshotparameters: { chromatic: { delay: 300 } }Control visual regression captures
Disable snapshotparameters: { chromatic: { disableSnapshot: true } }Skip story in visual tests
A11y testingawait expect(button).toHaveAccessibleName()Validate accessible labels

Common Mistakes

MistakeCorrect Pattern
Using args with multi-component layoutsUse render for complex compositions
Not awaiting userEvent methodsAlways await: await userEvent.click(button)
Using within(canvasElement) manuallyDestructure canvas from play context directly
Using getByTestId firstPrefer getByRole, getByLabelText, getByText
Missing default args at meta levelAdd args to meta to prevent placeholder controls
Exposing non-serializable propsDisable className, ref, style in argTypes
Not composing play functionsReuse setup with await BaseStory.play?.(context)
Forgetting to mock callbacksUse fn() for event handlers: args: { onPress: fn() }
Missing accessible names for icon buttonsAdd aria-label or use aria-labelledby
Not scoping queries for portal contentUse within(canvasElement.ownerDocument.body)
Using boolean && for conditional renderingUse ternary in stories for consistent snapshots
Not waiting for animationsWrap assertions in waitFor for async state

Common Fixes

ProblemSolution
Controls show placeholdersAdd args at meta level with default values
Serialization errorDisable className, ref, style in argTypes
Portal element not foundSearch body instead of canvas
Animation timing issuesWrap assertions in waitFor
Multiple buttons foundAdd { name: '...' } to getByRole
A11y test failingAdd label prop or aria-label

Delegation

  • Story structure review: Use code-reviewer skill for CSF3 pattern validation
  • Accessibility audit: Use Explore agent to discover ARIA patterns across stories
  • Visual regression analysis: Use Task agent to investigate Chromatic failures

References

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/oakoss/agent-skills/storybook-stories">View storybook-stories on skillZs</a>