Write stories
The /write-stories skill gives your agent the rules for the stories of your project: which states get a story, and how to write the imports, play functions, and mocks. Every component your agent creates or changes gets stories that show its states and test its behavior.
When your agent uses it
The skill is step 2 of the Storybook section in AGENTS.md. With that section, your agent uses it for every component it creates or changes.
You can also ask for the skill by name, for example "Use the /write-stories skill to add stories for the user list".
What the agent writes
- One story for each state. The agent writes a story for each state the component can reach, such as variants, loading, empty, error, and disabled, with realistic props.
- Play functions. An interactive component also gets a play function that interacts with it and checks the result.
- Network mocks. A story never calls a real service. When your project has MSW set up for Storybook, the agent mocks network requests with it. When it doesn't, the agent adds no dependency: it writes the stories that send no request, and tells you which stories would need a network mock. A component that fetches when it renders gets no story until MSW is set up, also not for its loading state.
- Module mocks. For other dependencies, the agent uses module mocks.
The agent follows your project's conventions. It writes stories in the story format that your project uses, and it doesn't rewrite your existing stories to match its own rules.
Requirements
- Storybook 11 and a supported framework
More AI resources
