docs/ai/setup.mdx
Storybook's agentic setup is currently only available for projects using the React renderer with the Vite builder. Support for additional renderers and builders will follow.
The API may change in future releases. We welcome feedback and contributions to help improve this feature.
</Callout><If renderer={['react']}>
Configuring Storybook in an existing application is repetitive, project-specific work that AI agents handle well. When you add Storybook to a project using an agent, it analyzes your project (framework, renderer, builder, language, addons) and produces a Markdown guide with step-by-step instructions. By following this guide, your agent will configure your preview file, set up commonly needed mocks, and write stories for components in your codebase.
After an agent follows those instructions, you have a working Storybook with stories for your components and a clear path to expanding coverage across your codebase.
To set up Storybook in your project, copy/paste this prompt into your agent's chat:
<CodeSnippets path="prompt-install-storybook.md" />The agent first runs storybook init to add Storybook to your project. When init completes, the agent offers to continue with project-specific configuration. If you agree, the agent generates the instructions, follows them step by step, and applies each change directly to your codebase so you can review its work.
The project-specific instructions cover the following steps:
preview.tsx.ai-generated for your review.Once the agent has completed the setup:
ai-generated, and remove the tag once you've validated each one.More AI resources