stories
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrerequisites:
- Storybook must be installed in the project. Invoke the skill to set up Storybook, but only if the user explicitly invoked this skill and approves a Storybook installation.
/storybook-init - Storybook must be at least 10.5 (or while 10.5 is not yet released). Invoke the
nextskill to upgrade it, but only if the user explicitly approved a Storybook upgrade./storybook-upgrade - Ensure is installed. If it is missing, install it with
@storybook/addon-mcp.npx storybook add @storybook/addon-mcp
Run the Storybook dev server and every command from the same working directory: the package where Storybook is installed (in a monorepo often a leaf package such as ).
storybook aipackages/uiRun and read the output in its entirety to get the mandatory, ordered workflow for working on UI changes, writing stories, and keeping stories in sync with every frontend component you create, modify, or delete. This workflow explains how to write stories, preview stories, and display a curated Storybook review.
STORYBOOK_FEATURE_AI_CLI=1 npx storybook ai --helpBefore invoking any command for the first time in a session, run and read it fully. The top-level help only lists the commands; each command's payload shape and usage rules (which fields to include when) live in its own help output. Never guess a payload from the command name — a validation error only reports missing required fields, not the optional fields the workflow expects you to provide.
storybook aiSTORYBOOK_FEATURE_AI_CLI=1 npx storybook ai <command> --help--jsonSome commands require a running Storybook dev server. When Claude preview tooling is available, start the dev server through that tooling:
- Ensure there is a Storybook launch entry in (the
.claude/launch.jsontool description documents the file format) withpreview_startandautoPort: true. Use the project's preferred package manager and existingport: 6006Storybook script instead of inventing a new command whenever possible.package.json - Start the Storybook launch entry with the tool.
preview_start
前提条件:
- 项目中必须已安装Storybook。若用户明确调用此技能并同意安装Storybook,可调用技能来设置Storybook。
/storybook-init - Storybook版本至少为10.5(若10.5尚未发布,则使用版本)。若用户明确同意升级Storybook,可调用
next技能进行升级。/storybook-upgrade - 确保已安装。若未安装,使用
@storybook/addon-mcp命令进行安装。npx storybook add @storybook/addon-mcp
请在Storybook所在的包目录(在单体仓库中通常是这类叶子包)中运行Storybook开发服务器以及所有命令。
packages/uistorybook ai运行并完整阅读输出内容,以获取处理UI变更、编写stories以及保持stories与所有创建、修改或删除的前端组件同步的强制性有序工作流。此工作流会说明如何编写stories、预览stories以及展示经过筛选的Storybook评审内容。
STORYBOOK_FEATURE_AI_CLI=1 npx storybook ai --help在会话中首次调用任何命令之前,请运行并完整阅读帮助信息。顶层帮助仅列出命令,每个命令的负载格式和使用规则(何时需要包含哪些字段)都在其各自的帮助输出中。切勿根据命令名称猜测负载内容——验证错误仅会报告缺失的必填字段,不会告知工作流期望你提供的可选字段。
storybook aiSTORYBOOK_FEATURE_AI_CLI=1 npx storybook ai <command> --help--json部分命令需要运行中的Storybook开发服务器。当Claude预览工具可用时,通过该工具启动开发服务器:
- 确保文件中有Storybook启动项(
.claude/launch.json工具文档说明了文件格式),且设置了preview_start和autoPort: true。尽可能使用项目首选的包管理器和现有的port: 6006中的Storybook脚本,而非创建新命令。package.json - 使用工具启动Storybook启动项。
preview_start