storybook
Skill15 starsChanged 43 days agoMITView on GitHub
Expert Storybook component workshop assistance covering CSF 3 stories, args, controls, and visual regression. Use when developing isolated UI components, building design systems, or documenting frontend widgets.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- primer/reacttheir own version, first seen Nov 1, 2026
- DaleStudy/skillstheir own version, first seen Nov 1, 2026
- mthines/agent-skillstheir own version, first seen Oct 30, 2026
- humanlayer/humanlayertheir own version, first seen Oct 25, 2026
- monegit/agent-skillstheir own version, first seen Oct 13, 2026
- Mindrally/skillstheir own version, first seen Oct 8, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- langfuse/langfuse★ 37ksame name
- humanlayer/humanlayer★ 13ksame name
- primer/react★ 3.9ksame name
- Mindrally/skills★ 275same name
- microsoft/scope★ 78same name
- dylantarre/design-system-skills★ 50same name
- mthines/agent-skills★ 20same name
- DaleStudy/skills★ 4same name
- gabriellst/codm★ 4same name
- FelipeAngeli/skills★ 2same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 132
Use CSF 3 with args and play function testing:
- Distinctive: line 165
Use Mock Service Worker (MSW): Mock API backends to enable stories to render realistic asynchronous states.
- Distinctive: line 169
Import application routers or global state in components: Pass callbacks and state down as props to keep components isolated.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. It enables you to develop UI components without running your entire app (and logic/APIs).
When to Use
- Isolated UI Component Development: Developing React, Vue, Svelte, or Angular components in isolation without launching backends.
- Interactive Design System Documentation: Publishing living styleguides and component catalogs for designer and developer handoff.
- Visual Regression Testing: Detecting unexpected visual pixel shifts across browser viewports with Chromatic.
- Accessibility (a11y) Auditing: Automated component accessibility testing via the
@storybook/addon-a11yplugin.
Quick Start
npx storybook@latest init
npm run storybookSnippet:
// Button.stories.tsx
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "./Button";
const meta: Meta<typeof Button> = {
component: Button,
};
export default meta;
type Story = StoryObj<typeof Button>;
export const Primary: Story = {
args: {
primary: true,
label: "Button",
},
};Core Concepts
Component Story Format (CSF 3)
Defines component variants using declarative, typed JavaScript exports:
// src/components/Button.stories.tsx
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "./Button";
const meta: Meta<typeof Button> = {
title: "Components/Button",
component: Button,
tags: ["autodocs"],
argTypes: {
variant: { control: "select", options: ["primary", "secondary", "danger"] },
onClick: { action: "clicked" },
},
};
export default meta;
type Story = StoryObj<typeof Button>;
export const Primary: Story = {
args: {
variant: "primary",
label: "Confirm Payment",
},
};
export const Disabled: Story = {
args: {
variant: "primary",
label: "Processing...",
disabled: true,
},
};Component Interaction Testing (play Function)
Simulates user interactions inside the story using Testing Library and asserts on outcomes:
import { within, userEvent, expect } from "@storybook/test";
export const InteractiveLoginForm: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await userEvent.type(canvas.getByLabelText(/email/i), "alice@example.com");
await userEvent.type(canvas.getByLabelText(/password/i), "Secret123!");
await userEvent.click(canvas.getByRole("button", { name: /log in/i }));
await expect(canvas.getByText(/dashboard/i)).toBeInTheDocument();
},
};Mocking API Calls with MSW Addon
Intercepts component network requests inside the Storybook canvas:
import { http, HttpResponse } from "msw";
export const LoadedUserProfile: Story = {
parameters: {
msw: {
handlers: [
http.get("/api/user", () =>
HttpResponse.json({ name: "Alice", role: "Admin" }),
),
],
},
},
};Common Patterns
Interactive Story with Controls and Play Function
Problem: Static component stories do not verify whether clicks and state transitions function properly.
Solution:
Use CSF 3 with args and play function testing:
import type { Meta, StoryObj } from "@storybook/react";
import { userEvent, within, expect } from "@storybook/test";
import { LoginForm } from "./LoginForm";
const meta: Meta<typeof LoginForm> = {
title: "Components/LoginForm",
component: LoginForm,
};
export default meta;
type Story = StoryObj<typeof LoginForm>;
export const ValidSubmission: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await userEvent.type(canvas.getByLabelText(/email/i), "user@test.com");
await userEvent.type(canvas.getByLabelText(/password/i), "secret123");
await userEvent.click(canvas.getByRole("button", { name: /submit/i }));
await expect(canvas.getByText(/welcome/i)).toBeInTheDocument();
},
};Best Practices
Do:
- Adopt CSF 3 Standard: Use object-based CSF 3 stories for cleaner syntax and reduced boilerplate.
- Enable
@storybook/addon-a11y: Catch WCAG accessibility violations directly inside the component development workflow. - Automate Visual Testing with Chromatic: Capture regression snapshots of all stories on every pull request.
- Use Mock Service Worker (MSW): Mock API backends to enable stories to render realistic asynchronous states.
Don't:
- Import application routers or global state in components: Pass callbacks and state down as props to keep components isolated.
- Hardcode static story args: Leverage Storybook controls (
args) to allow designers to test edge-case content lengths. - Neglect loading and error states: Create dedicated stories for loading skeletons, empty data, and network error states.
Troubleshooting
| Error | Cause | Solution |
Cannot find module in .storybook/preview | Path alias or CSS import not recognized by Storybook builder. | Add path aliases to .storybook/main.ts webpackFinal or viteFinal. |
No stories found | Stories glob pattern in main.ts does not match component file paths. | Verify stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'] in config. |
Component won't render: hook called outside component | Decorator missing required React context or router provider. | Wrap story with appropriate context provider in preview decorators. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

