Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Storybook Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-storybook-knowledge-patch)
---
name: storybook-knowledge-patch
description: Storybook
version: "10.6.9"
license: MIT
metadata:
author: Nevaberry
---
# Storybook knowledge patch
Use this skill when configuring Storybook, adapting framework integrations,
authoring stories and Docs, or maintaining component tests and CLI automation.
The quick reference covers compatibility changes and common configuration;
load the topic references for the full guidance and item-specific attribution.
## Reference index
| Reference | Topics |
| --- | --- |
| [Configuration and Manager](references/configuration-and-manager.md) | ESM, Vite configuration and build stats, sidebar tags, favicon, viewport, visual addons, security, dev server embedding |
| [Frameworks and Migrations](references/frameworks-and-migrations.md) | Angular builders and dependencies, Svelte, React Native, Next.js mocks, TanStack routing, Preact |
| [Story Authoring and Docs](references/story-authoring-and-docs.md) | UI authoring and validation, React CSF Factories, docgen, composed Controls, Docs blocks, MDX IDs, accessible actions |
| [Testing and Automation](references/testing-and-automation.md) | Test widget, module mocks, story tests, RSC testing, Vitest, CLI initialization, browser launch, Oxlint, review, MCP |
## Breaking changes, deprecations, and compatibility
### ESM-only distribution
Storybook 10 publishes only ES modules and requires Node support for loading
them with `require()`. The release notes list Node 20.16+, 22.19+, or 24+.
### Deprecated Docs and viewport configuration
`ExternalDocs` is deprecated.
Storybook warns on the legacy `viewport.defaultViewport` parameter. Set the
initial viewport in the preview's `initialGlobals`, for example:
```ts
initialGlobals: { viewport: { value: 'mobile1', isRotated: false } }
```
### Angular dependency requirements
Starting in Storybook 10.6.2, `@storybook/angular-vite` requires
`@analogjs/vite-plugin-angular` 2.7.3 or later.
In 10.5.1, `@storybook/angular-vite` adds TypeScript 6 peer support and drops
its peer dependency on `@angular/platform-browser-dynamic`.
### Security behavior and embedding
Storybook 10.6.2 contains fixes for `GHSA-f2ph-cmg5-wxc8` and
`GHSA-px85-f4q5-jh77`.
Storybook 8.6.19 and 9.1.21 restrict dev server iframe embedding to localhost
origins. The preview accepts `postMessage` traffic only from known manager
origins. Those releases also validate MCP request origins, add a host
validation warning, and disable file writes and command execution from the
browser in the Vitest addon.
Storybook 10.6.6 restores support for embedding the dev server in StackBlitz.
## Component tests and mocks
### Test widget and watch mode
In Storybook 9, run selected test types across all stories from the Test widget,
then filter the sidebar to stories with warnings or errors. Watch mode reruns
affected tests when you save a file.
### Module automocking
Storybook 10's `sb.mock` works with Vite and Webpack. Mocks are available both
in development and in static production builds.
### Vitest project globals
Pass `initialGlobals` to `storybookTest()` to pin globals for a Vitest project.
For a Storybook with a `theme` global, this runs that project under the dark theme:
```ts
storybookTest({ initialGlobals: { theme: 'dark' } })
```
Starting in Storybook 10.6.1, the Vitest addon supports running browser tests
with Vitest 5.
### Experimental tests attached to stories
CSF factory stories can attach named tests through `.test()`. The callback
receives the story's play context, and tag filters can hide test entries from
the sidebar.
```ts
Primary.test('renders a button', async ({ canvas }) => {
await canvas.findByRole('button');
});
```
Tags that mark a CSF factory story to be skipped also apply to its `.test()`
children.
### Experimental React Server Component tests
Storybook 10 offers experimental component testing for React Server Components
through its early access program. RSC component testing is also available
directly in Vitest.
## Story authoring and Docs
### React CSF Factories preview
CSF Factories are in Preview for React in Storybook 10. A factory-based preview
infers the types for metadata and stories, and existing CSF files can stay in
their current format.
```ts
import preview from '../.storybook/preview';
import Button from './Button';
const meta = preview.meta({ component: Button });
export const Primary = meta.story({ args: { label: 'Button', primary: true } });
```
Docs blocks can resolve CSF factory modules that use only named exports.
### UI authoring and composed Controls
Storybook 9 can create and edit stories from the UI. With the Test Codegen
addon, record interactions, add assertions, and save the generated test from
Storybook.
Controls load for stories from composed Storybook refs, including when a user
opens a composed story through a direct link.
### Experimental React docgen service
Set `features.experimentalDocgenServer` to `true` in `.storybook/main.ts` to
share React component metadata across MCP, Docs, and Controls. In this mode,
arg types inferred from initial args yield to docgen and explicit `argTypes`.
### Standalone MDX and accessible actions
Set `id` on a standalone page's `<Meta>` block to choose an explicit ID, for
example `<Meta title="Guides/Setup" id="setup-guide" />`.
Set `ariaLabel` on a Docs `ActionItem` to give the action an accessible name,
for example `ariaLabel: 'Open component source'`.
## Framework and manager configuration
### Angular on Vite (Preview)
Set `framework: '@storybook/angular-vite'` in `.storybook/main.ts` to use Vite
for Angular stories, docs, and component tests. The Angular-to-Vite
automigration installs `@analogjs/vite-plugin-angular`, preserves `zone.js`,
and configures the Vitest addon when applicable.
The Webpack-based `@storybook/angular` framework supports Angular 22.
### Vite configuration loader
Set `configLoader` in the Vite builder options to select how Vite loads its
configuration. In a Vite framework's options, use
`builder: { configLoader: 'runner' }` to select the runner loader.
### Default tag exclusion
The sidebar can exclude stories by tag. Set the initial filter state in
`.storybook/main.ts` to hide stories tagged `experimental` by default:
```ts
export default {
tags: { experimental: { defaultFilterSelection: 'exclude' } },
};
```
### Measure and Outline per story
Measure and Outline honor their `disable` parameters. To turn off both for a
story, use `parameters: { measure: { disable: true }, outline: { disable: true } }`.
## CLI and agent integration
### Browser launch and agent-run upgrades
The CLI honors `BROWSER` and `BROWSER_ARGS` when opening a browser. Under an
agent, `storybook dev` skips automatic browser launch and `storybook upgrade`
installs the MCP integration.
### Experimental MCP CLI
Enable the `STORYBOOK_FEATURE_AI_CLI` environment flag to use `storybook ai`
as an MCP passthrough. Instance discovery considers the working directory and
Storybook config directory. Use `--port` or `-p` to select an instance by port.
### Experimental Agentic Review
Enable AI-curated visual changesets and story search results with
`features.experimentalReview: true` in `.storybook/main.ts`. The flag is
unset by default so the CLI plugins can enable it.