component-docs
它能做什么
这个技能让 AI 查阅使用 Storybook 的项目中的组件,包括它们的属性和示例用法。适合希望复用现有组件、而不是重新构建的开发者。
适用场景
- ✓当你想在新建组件之前,先了解项目中已有哪些组件的时候。
- ✓当你需要检查某个组件接受哪些属性以及如何使用它的时候。
- ✓当团队的指南要求 AI 复用现有组件的时候。
技能链接
https://github.com/storybookjs/storybook/blob/next/code/lib/claude-plugin/skills/component-docs/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在我新建按钮之前,请先告诉我我们已经有哪些按钮组件,以及它们是如何使用的。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 在项目中运行一条 Storybook 命令,列出组件、属性和使用示例,然后用这些信息来回答或复用组件。需要 Storybook 11.0 或更高版本,否则 AI 会改为读取源文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Prerequisites:
- Storybook must be installed in the project. If it is not, read the components' source files instead.
- Storybook must be 11.0 or later. An 11.0 prerelease (
11.0.0-alpha.x) or a canary build (0.0.0-pr-*) also counts. If it is older, invoke the/storybook-upgradeskill only after the user explicitly approves an upgrade; until then, read the components' source files instead.
Run every Storybook CLI command from the package where Storybook is installed (in a monorepo often a leaf package such as packages/ui).
If the sandbox blocks network access, request escalated permissions for Storybook CLI commands.
Run npx storybook skills component-docs and follow its output: it lists the commands that show this project's components, props, and usage examples, and when to use them.
常见问题
我需要安装 Storybook 吗?
需要。如果没有安装,该技能会改为读取组件的源文件。
需要哪个 Storybook 版本?
11.0 或更高版本,包括 11.0 的预发布版本。更旧的版本需要先升级,并经你批准。
它需要网络访问吗?
有时需要。该技能说明,如果沙盒阻止网络访问,应请求运行 Storybook 命令的权限。
详情
作者的原始描述
Look up the components of a project with Storybook, with their props and usage examples, to answer questions about them or to reuse them instead of building duplicates. Use when the project's agent instructions (such as AGENTS.md) or the user ask for it. For a UI change, use ui-workflow, which includes the same component lookup.
repo: storybookjs/storybook
热度
- GitHub 星标
- 91k
- 排名
- #1324
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
handle-pr-comments
91k帮你的智能体逐条处理 GitHub 拉取请求的审查意见,建议修复方案,应用你的选择,并把讨论串标为已解决。
principle-encode-lessons-in-structure
91k教你的智能体把反复出现的错误转化为自动检查,例如 lint 规则或脚本,而不是一再写下同样的提醒。
storybook-startup-benchmark
91k帮你的智能体测量 Storybook 的启动时间,以及显示第一个 story 所需的时间,并通过重复运行进行公平比较。
storybook-upgrade
91k教你的智能体把项目中的所有 Storybook 包升级到指定版本,每次只升级一个大版本。