frontend-storybook
Use when the user asks to document button variants or other components in Storybook, CSF 3 stories, args and controls, play functions, interaction or a11y…
от j4flmao★ 47 звёзд на GitHub
Установить frontend-storybook в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Frontend Storybook
Purpose
Create, maintain, and optimize Storybook stories using CSF 3.x format with interaction tests, accessibility checks, and addon-driven workflows. Covers setup across React/Vue/Angular/Svelte, visual testing via Chromatic, custom theming, and documentation mode.
Agent Protocol
Trigger
Exact phrases: "write stories", "storybook", "CSF", "component story", "storybook addon", "visual test", "story for", "stories for", "storybook setup", "interaction test", "chromatic", "storybook docs", "storybook theme", "storybook decorator"
Input Context
- Check for
.storybook/main.jsormain.tsto detect existing Storybook config - Determine CSF version (2.x vs 3.x) from existing stories or package.json Storybook version
- Identify the component framework (React, Vue, Angular, Svelte, Web Components) for framework-specific story patterns
- Check for existing addons in
.storybook/main.jsunderaddonsarray - Verify whether
autodocsis enabled globally or per-component - Check for existing Chromatic or visual testing setup
Output Artifact
No file output unless requested.
Response Format
- Output stories in CSF 3.x
.stories.tsx/.stories.tsformat (default export withmeta, named exports for stories) - Include
importstatements andmetaobject withcomponent,title,tags,argTypes - For interactive stories, use
playfunction fromstorybook/test(@storybook/testin v8) - When suggesting addon config, output the full addon registration snippet
- When configuring Chromatic, output the full CI workflow YAML
- No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- Story follows CSF 3.x:
const meta = { component } satisfies Meta<typeof Component>with named story exports - Stories cover default/empty state, loading state, error state, edge cases (long text, missing props, zero data)
- Accessibility tests via
@storybook/addon-a11yincluded in at least one story per component - Interaction tests via
playfunction for any component with user input or animations - Responsive/layout stories use
parameters.viewportto test mobile/tablet/desktop - Documentation tab (
@storybook/addon-docs) configured with autodocs for the component - No hardcoded strings — use
argsmapping for story variations - Chromatic or visual regression tests configured for PR pipeline
Max Response Length
120 lines per component story set.
Storybook Architecture / Decision Trees
Story Organization Decision Tree
How many components?
|-- 1-10 components -->
| Simple structure: Components/Button, Components/Card
| Co-locate stories with components (Button.stories.tsx next to Button.tsx)
|
|-- 10-50 components -->
| Feature-based grouping: Feature/Orders/OrderList, Feature/Orders/OrderCard
| Group by domain, not by type
|
|-- 50+ components (design system) -->
Nested structure: DesignSystem/Buttons/Primary, DesignSystem/Buttons/Secondary
Each variant gets its own story
Atomic structure: Atoms, Molecules, Organisms
Story Coverage Decision Tree
What states does the component have?
|-- Default / empty state -->
| STORY REQUIRED: shows component with no data
| Example: empty list, empty card, skeleton state
|
|-- Loading state -->
| STORY REQUIRED: skeleton or spinner
| Example: SkeletonList, LoadingButton
|
|-- Error state -->
| STORY REQUIRED: error message, retry action
| Example: ErrorCard, ErrorForm
|
|-- Edge cases -->
| STORY REQUIRED: long text, missing props, zero data, overflow
| Example: VeryLongText, MissingImage, SingleItem
|
|-- Interactive behavior -->
| STORY REQUIRED if component has user input
| Use play() function to simulate clicks, typing, hover
|
|-- Responsive variants -->
STORY REQUIRED: mobile (375px), tablet (768px), desktop (1280px)
Use parameters.viewport
Workflow
Step 1: Initialize or Verify Setup
npx storybook@latest init --type react # or vue3, angular, nextjs, sveltekit
Check .storybook/main.ts for required addons:
| Addon | Package | Purpose |
|---|---|---|
| Core (built in since Storybook 9) | storybook |
Controls, Actions, Viewport, Backgrounds, interactions/play testing — addon-essentials and addon-interactions are no longer installed separately |
| Docs | @storybook/addon-docs |
Autodocs and MDX |
| Vitest | @storybook/addon-vitest |
Runs stories as Vitest browser tests (successor to the test-runner for Vite projects) |
| Accessibility | @storybook/addon-a11y |
aXe-based accessibility audits |
| Themes | @storybook/addon-themes |
Theme switching toolbar |
| Designs | @storybook/addon-designs |
Figma design embeds |
Step 2: Configure Preview
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/addons-testing.md
- references/addons.md
- references/story-writing.md
- references/storybook-setup.md
- references/visual-testing.md
- references/writing-stories.md
FAQ
Что делает скилл frontend-storybook?
Use when the user asks to document button variants or other components in Storybook, CSF 3 stories, args and controls, play functions, interaction or a11y tests in Storybook, Chromatic visual tests or Storybook config. Produces stories, docs and test setup for Storybook 9+. Not for general unit and E2E testing (use frontend-testing).
Как установить скилл frontend-storybook?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frontend-storybook запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…