> **Version 11 (RC)** — **React** / **TypeScript**
> Also available:
- `?codeOnly=true` for code snippets only
- other versions: Version 10.6 (latest) (`/docs/ai/connect.md`), Version 9 (`/docs/9/ai/connect.md`), Version 8 (`/docs/8/ai/connect.md`)

# Connect your agent

Storybook's skills and MCP server let your agent set up Storybook, reuse your components, write and test stories, and create a review of its work. Neither is available for your framework yet.

Connect your coding agent to Storybook so it can use your components, stories, and tests. We recommend [skills](#install-the-skills), which work with any agent that can run shell commands. Use the [MCP server](#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](#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`](#tell-your-agent-when-to-use-the-skills) 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`](https://storybook.js.org/docs/11/api/cli-options.md#init), it asks whether to install the skills. The default answer is yes.

When you [upgrade](https://storybook.js.org/docs/11/releases/upgrading.md) 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:

```shell
npx storybook automigrate skills
```

```shell
pnpm exec storybook automigrate skills
```

```shell
yarn exec storybook automigrate skills
```

Every install method adds the same files:

- The skills: `/storybook-init`, [`/storybook-setup`](https://storybook.js.org/docs/11/ai/skills/setup.md), `/storybook-upgrade`, and the skills that the [Storybook section in `AGENTS.md`](https://storybook.js.org/docs/11/ai/agents-md.md) uses: [`/component-docs`](https://storybook.js.org/docs/11/ai/skills/component-docs.md), [`/write-stories`](https://storybook.js.org/docs/11/ai/skills/write-stories.md), [`/test-stories`](https://storybook.js.org/docs/11/ai/skills/test-stories.md), and [`/ui-review`](https://storybook.js.org/docs/11/ai/skills/ui-review.md). They're installed for Claude Code (`.claude/skills/`) and for other agents (`.agents/skills/`).
- `skills-lock.json`, which records the installed version.
- A Storybook section in `AGENTS.md` (see below)

Commit these files so everyone on your team gets them. When you run [`storybook upgrade`](https://storybook.js.org/docs/11/releases/upgrading.md), Storybook updates the skills to match the new version.

<details>
<summary>Plugins</summary>

Storybook also has plugins for [Claude Code](https://github.com/storybookjs/storybook/tree/next/code/lib/claude-plugin#readme) and [Codex](https://github.com/storybookjs/storybook/tree/next/code/lib/codex-plugin#readme). 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.

</details>

## 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](https://storybook.js.org/docs/11/ai/agents-md.md) for what each step does.

````md title="AGENTS.md"

## 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"

````

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](https://storybook.js.org/docs/11/ai/reference/mcp-server.md) 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`](https://storybook.js.org/docs/11/api/cli-options.md#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](https://storybook.js.org/docs/11/ai/reference/mcp-server.md). 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](https://storybook.js.org/docs/11/ai/published-storybook.md).

## Supported frameworks

Skills are available for these frameworks:

| Renderer                | Frameworks                                          | [Setup](https://storybook.js.org/docs/11/ai/skills/setup.md) | [AGENTS.md section](https://storybook.js.org/docs/11/ai/agents-md.md) |
| ----------------------- | --------------------------------------------------- | --------------------------- | ------------------------------------ |
| React (Setup supported) | `react-vite`, `nextjs-vite`, `tanstack-react`       | Yes                         | Yes                                  |
| React (other)           | `react-webpack5`, `nextjs`, `react-native-web-vite` | No                          | Yes                                  |
| Vue 3                   | `vue3-vite`                                         | Yes                         | Yes                                  |
| Angular                 | `angular-vite`                                      | Yes                         | Yes                                  |
| Svelte                  | `svelte-vite`, `sveltekit`                          | No                          | Yes                                  |
| Web Components          | `web-components-vite`                               | No                          | Yes                                  |

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](https://storybook.js.org/docs/11/writing-tests/integrations/vitest-addon.md), which needs the Vite builder.
The `/storybook-init` and `/storybook-upgrade` skills work with every framework in this table.
The [MCP server](https://storybook.js.org/docs/11/ai/reference/mcp-server.md) supports the same renderers.

**More AI resources**

- [Setup](https://storybook.js.org/docs/11/ai/skills/setup.md)
- [The AGENTS.md section](https://storybook.js.org/docs/11/ai/agents-md.md)
- [Component docs](https://storybook.js.org/docs/11/ai/skills/component-docs.md)
- [Write stories](https://storybook.js.org/docs/11/ai/skills/write-stories.md)
- [Test stories](https://storybook.js.org/docs/11/ai/skills/test-stories.md)
- [UI review](https://storybook.js.org/docs/11/ai/skills/ui-review.md)
- [Use a published Storybook](https://storybook.js.org/docs/11/ai/published-storybook.md)
- [Best practices for using Storybook with AI](https://storybook.js.org/docs/11/ai/best-practices.md)
- [Manifests](https://storybook.js.org/docs/11/ai/reference/manifests.md)
- [MCP server](https://storybook.js.org/docs/11/ai/reference/mcp-server.md)