storybook-rsbuild
Storybook Rsbuild
Goal
Set up Storybook on Rsbuild, or migrate an existing Storybook to it. Factual mappings — version compatibility, package names, install commands, config conversion patterns — live in upstream docs at storybook.rsbuild.rs. This skill is an action router and a behavioral checklist; it does not duplicate the docs.
Principles (must follow)
-
Single source of truth is upstream. Fetch the relevant
storybook.rsbuild.rspage for version tables, install commands, and config conversion patterns. Do not infer version pins or package names from training memory — the ecosystem moves faster than the model's prior. -
Pin from the framework guide's Requirements table. Each framework guide page (e.g.
https://storybook.rsbuild.rs/guide/framework/react) carries a Requirements section listing the canonical compatible version ranges — that is the authoritative source for version pins. For fresh setups, install the latest stablestorybookmajor and the matchingstorybook-rsbuildmajor. Do not pin from version numbers you see in code snippets elsewhere; only the docs are authoritative. -
Declare
@rsbuild/coredirectly.storybook-<framework>-rsbuildlists@rsbuild/coreas a peer dependency, but you must still add@rsbuild/coreto the project's owndevDependenciesso version pins and lockfile audits remain unambiguous and a future framework-package release that drops the peer cannot silently break the build. -
Migration is one task with two ordered phases — both required. Phase A: install the new framework package and update config; leave the old framework package, old builder package, and old
webpackFinal/viteFinalblocks in place so Verification has a rollback path. Phase B: as soon as Verification passes, in the same task, remove the old framework package (e.g.@storybook/react-webpack5,@storybook/vue3-vite), the old builder package (e.g.@storybook/builder-webpack5,@storybook/builder-vite), and the oldwebpackFinal/viteFinalblock. A migration that ends with both builders' framework packages still inpackage.jsonis incomplete — leaving them is the most common silent regression in this skill's evals. Phase A on its own is not a valid stopping point; if you ran Verification, you must also run cleanup. -
Preserve addons; never silently drop. When migrating, webpack-only addons (e.g.
@storybook/addon-styling-webpack) must either be passed throughwebpackAddons(so upstream auto-translation handles them) or replaced with the equivalent Rsbuild-native pipeline (@rsbuild/plugin-postcss,tools.postcss, etc.). A migration that removes a styling addon and produces a passingstorybook buildbut a visually broken story tree is still a regression. -
Operate in scope. In monorepos, modify only the package that hosts stories. Do not edit business source files unless the migration strictly requires it.
More from rstackjs/agent-skills
rsbuild-best-practices
Rsbuild best practices for config, CLI workflow, type checking, bundle optimization, assets, and debugging. Use when writing, reviewing, or troubleshooting Rsbuild projects.
566rslib-best-practices
Rslib best practices for config, CLI workflow, output, declaration files, dependency handling, build optimization and toolchain integration. Use when writing, reviewing, or troubleshooting Rslib projects.
408rspack-v2-upgrade
Use when upgrading a Rspack 1.x project to v2, including dependency and configuration updates.
237rstest-best-practices
Rstest best practices for config, CLI workflow, test writing, mocking, snapshot testing, DOM testing, coverage, multi-project setup, CI integration, performance and debugging. Use when writing, reviewing, or troubleshooting Rstest test projects.
231rspack-best-practices
Rspack best practices for config, CLI workflow, type checking, CSS, bundle optimization, assets and profiling. Use when writing, reviewing, or troubleshooting Rspack projects.
223rsbuild-v2-upgrade
Use when upgrading a Rsbuild 1.x project to v2, including dependency and configuration updates.
208