Join live: Storybook 11 AMA with the team
Docs
Storybook Docs

Connect your agent

Connect your coding agent to Storybook so it can use your components, stories, and tests. We recommend skills, which work with any agent that can run shell commands. Use the MCP server if you want your agent to call Storybook through MCP tools instead of CLI commands.

Some skills aren't available for every framework. See supported frameworks to check yours.

Install the skills

Skills are short instruction files in your repository. Each one tells your agent what it does and gets its full instructions from your installed Storybook. The Storybook section in AGENTS.md tells your agent when to use them. Because skills live in your repository, every person and agent working on the project gets the same version, and that version matches your Storybook.

When you run storybook init, it asks whether to install the skills. The default answer is yes.

When you upgrade from Storybook 10, the skills automigration offers to install them. It asks only once.

To install the skills at any other time, run this command from the root of your project:

npx storybook automigrate skills

Every install method adds the same files:

Commit these files so everyone on your team gets them. When you run storybook upgrade, Storybook updates the skills to match the new version.

Plugins

Storybook also has plugins for Claude Code and Codex. A plugin installs the same skills once for every project on your machine. We recommend the skills in your repository instead, because they always match the Storybook version of each project, and your whole team gets them.

Tell your agent when to use the skills

For every UI change, the section that Storybook adds to AGENTS.md tells your agent which skills to use and how to run the story tests. See The AGENTS.md section for what each step does.

AGENTS.md
<!-- BEGIN:storybook-skills -->
<!-- Storybook updates this section on upgrade. Remove both markers to keep your own edits. -->
 
## Storybook
 
For every change to how the UI looks (you create, change, or delete a component, story, style, theme, or design token), follow these steps in order. First invoke the Storybook skills of steps 1 and 2, before you edit any file. Then follow each skill at its step.
 
1. `/component-docs`: look up the components to reuse, with their props and usage examples, before you edit any file.
2. `/write-stories`: every component you create or change gets stories, written with the current best practices for this Storybook version and this project.
3. To test stories in the CLI run:
   ```sh
   npx storybook tools test run [files...]   # every story, or these story files
   npx storybook tools test run --changed    # the stories your changes affect
   ```
4. ALWAYS inform the user about the `/ui-review` skill after a change the user can see: "Use the /ui-review skill to see the changed components in Storybook"
 
<!-- END:storybook-skills -->

Storybook replaces the text between the markers when you upgrade. To change the workflow, for example to drop the step that tells you about the review, remove both markers, then edit the steps. Storybook doesn't change a section without markers. To stop your agent from following the workflow, remove the whole section. Your agent then uses a skill only when you ask for it by name, for example "Use the /write-stories skill to add stories for the user list", or when it finds one that fits its task.

If your project has a CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md that doesn't import AGENTS.md, Storybook adds the same section to that file, so Claude Code sees it too.

MCP server

While we recommend using the skills for most agents, Storybook also provides an MCP server as an alternative way for your agent to interact with your Storybook instance.

Upgrade to skills

If you used the MCP server in Storybook 10, the skills automigration installs the skills but keeps your MCP setup. To prevent your agent from getting two sets of instructions for the same work, remove @storybook/addon-mcp with storybook remove, and remove the Storybook MCP server from your agent's configuration. Also remove any instructions about the MCP server from AGENTS.md.

Alternative: the MCP server

If you want your agent to call Storybook through MCP tools instead of CLI commands, connect it to the MCP server instead. The MCP server gives your agent the same capabilities as the skills, but it needs a running Storybook dev server. Your agent still needs to run shell commands: the server tells it to read each step of the workflow with npx storybook skills <id> --mcp.

Connect to a published Storybook

You can also connect your agent to a published Storybook instead of running it locally. To give your agent access to component docs from a Storybook that doesn't run on your machine, such as your team's design system, see Use a published Storybook.

Supported frameworks

Skills are available for these frameworks:

RendererFrameworksSetupAGENTS.md section
React (Setup supported)react-vite, nextjs-vite, tanstack-reactYesYes
React (other)react-webpack5, nextjs, react-native-web-viteNoYes
Vue 3vue3-viteYesYes
Angularangular-viteYesYes
Sveltesvelte-vite, sveltekitNoYes
Web Componentsweb-components-viteNoYes

Skills may also be supported in community-maintained frameworks. Please check with those frameworks' maintainers for up-to-date support information.

The AGENTS.md section column covers /component-docs, /write-stories, /test-stories, and /ui-review. The story tests also need the Vitest addon, which needs the Vite builder. The /storybook-init and /storybook-upgrade skills work with every framework in this table. The MCP server supports the same renderers.

More AI resources