Storybook 组件目录维护
storybook
为门户应用维护 Storybook 组件目录。适用本技能的场景:(1) 为组件添加新的 story,(2) 组件变更后更新现有 story,(3) 在 AI 辅助下运行完整的 Storybook 刷新/同步。
- License 许可
- MIT
- 所属仓库
- microsoft/scope
- 最近更新
- 2026-11-14
- Stars
- ★ 86
- Forks
- 32
01 前言 Front Matter
- name
- storybook
- metadata
- { "version": "1.0.0" }
- description
- Maintain the Storybook component catalog for the portal app. Use this skill when: (1) adding new stories for components, (2) updating existing stories after component changes, (3) running a full Storybook refresh/sync with AI assistance.
- allowed-tools
- Bash(npx:*) Bash(pnpm:*) Read Write Edit Glob Grep
- compatibility
- Storybook 10+, React 19, Vite
03 SKILL.md 正文
Storybook Maintenance
This project uses Storybook 10 as a component catalog for the portal app (apps/portal/).
Updating the Storybook
To regenerate or update stories across the project, run the following command from the apps/portal/ directory:
cd apps/portal && npx storybook ai setup
Follow its instructions precisely. The command analyzes the project's runtime providers, CSS setup, data-fetching patterns, and components, then produces updated stories with proper decorators, MSW handlers, and play functions.
Key Files
| File | Purpose |
|---|---|
apps/portal/.storybook/main.ts |
Storybook config (framework, stories glob, Vite overrides) |
apps/portal/.storybook/preview.tsx |
Shared decorators (QueryClient, MemoryRouter), mswLoader, CSS |
apps/portal/.storybook/msw-handlers.ts |
Default MSW network handlers |
apps/portal/public/mockServiceWorker.js |
MSW service worker (generated by npx msw init) |
Running Storybook
# From repo root (uses worktree port offset)
pnpm storybook
# From apps/portal directly
pnpm storybook
The dev server uses port ${STORYBOOK_PORT:-6100} and does not auto-open a browser.
Writing Stories Manually
Stories are co-located next to their components as <Component>.stories.tsx. Follow these conventions:
- Import
MetaandStoryObjfrom@storybook/react-vite - Tag AI-generated stories with
tags: ['ai-generated', 'needs-work'] - Use
playfunctions for interaction testing - Mock API calls with MSW handlers in
parameters.msw.handlers - Create a fresh
QueryClientinside decorators (not at module scope)
Building for CI
cd apps/portal && pnpm build-storybook
This produces a static build in storybook-static/ (git-ignored).
04 同仓库更多 Skills
agentic-workflows
Route gh-aw design, creation, diagnosis, patching, active debugging, upgrades, and local SDLC issue requests to the right strategies.
github-actions
Use when creating, editing, reviewing, or troubleshooting GitHub Actions workflows in Scope.
AX 智能体体验评估
ax-practitioner
当用户询问 AX(agent experience,智能体体验)或 AX Practitioner Playbook(AX 实践者手册)相关问题时,应使用本技能,例如"如何评估我的技术的智能体体验"、"编写 AX 评估标准"、"设计评估场景"、"propensity 与 efficacy 的区别"、"lift 与 drag"、"应该测试哪些智能体画像"、"需要多少次评估运行"、"如何解读智能体轨迹"、"为什么智能体忽略我的 MCP server 或 skill"、"智能体使用了过时的 SDK 版本"、"扩展太多"、"如何解读 AX readout"、"如何让负责团队修复文档"、"对照检查清单审查我的评估",或 SPFx 实战示例。本技能以交互方式严格依据手册作答并引用章节。当手册中没有答案时,会明确说明,并清楚标注任何通用知识或网络内容。
TypeScript 代码开发规范
typescript
本 monorepo 的 TypeScript 最佳实践。适用本技能的场景:(1) 编写新的 TypeScript 代码,(2) 审查 TypeScript 代码,(3) 处理 API 响应、fetch 调用或 JSON 解析,(4) 添加或修改类型和接口。
Scope 基准平台 CLI 操作
scope-cli
使用 Scope CLI 与 Scope 基准测试平台交互——提交运行、列出结果、管理评判标准、生成报告,以及管理智能体、技能和 MCP 服务器。
Scope 平台 API 查询与控制
scope-api
查询并控制 Scope 平台 API,用于分析基准测试数据、管理运行/请求、技能、智能体、报告和洞察。当用户询问 SCOPE 数据、想要触发运行、检查状态、生成报告,或以编程方式与 SCOPE 平台交互时使用。