Storybook Generator
When to activate
User runs /generate-storybook or requests Storybook story generation for a component with all prop variants and interactive controls.
When NOT to use
- Component audits (use
/component-auditor instead)
- Accessibility reviews (use
/review-a11y instead)
- Existing well-documented Storybook stories (update instead)
Instructions
Analyze component props
- Extract all props and their types (required vs. optional)
- Identify variant combinations (size, color, state, etc.)
- Map props to Storybook controls (boolean, select, text, etc.)
Generate story template
- Meta export with component, title, and controls config
- Default story showing primary variant
- Variant stories for each meaningful combination (Size, Variant, State, etc.)
- Edge case stories (empty state, error state, loading state)
Add interactive controls
- Boolean controls for toggles (disabled, loading, etc.)
- Select controls for variants (size: small/medium/large)
- Text controls for content
- Suggest control groups (e.g., "Button" group for size + variant)
Document usage examples
- Show primary use case
- Show edge cases
- Add JSDoc comments for prop descriptions
- Include accessibility notes if relevant
Export story code
- TypeScript with proper types
- Modern Storybook CSF 3.0+ syntax
- Ready to commit without modification
Example
User: "Generate Storybook for this Button component."
Response generates:
export default {
title: 'Components/Button',
component: Button,
argTypes: {
size: { control: 'select', options: ['small', 'medium', 'large'] },
variant: { control: 'select', options: ['primary', 'secondary', 'outline'] },
disabled: { control: 'boolean' },
children: { control: 'text' },
},
};
export const Primary = { args: { variant: 'primary', children: 'Click me' } };
export const Secondary = { args: { variant: 'secondary', children: 'Click me' } };
export const Disabled = { args: { disabled: true, children: 'Click me' } };
export const AllSizes = { render: () => <div>...</div> };
1---2name: storybook-generator3description: Storybook Generator4metadata:5 source: https://skillmd.com/skills/uitbreidenos/storybook-generator6---7# Storybook Generator89## When to activate1011User runs `/generate-storybook` or requests Storybook story generation for a component with all prop variants and interactive controls.1213## When NOT to use1415- Component audits (use `/component-auditor` instead)16- Accessibility reviews (use `/review-a11y` instead)17- Existing well-documented Storybook stories (update instead)1819## Instructions20211. **Analyze component props**22 - Extract all props and their types (required vs. optional)23 - Identify variant combinations (size, color, state, etc.)24 - Map props to Storybook controls (boolean, select, text, etc.)25262. **Generate story template**27 - Meta export with component, title, and controls config28 - Default story showing primary variant29 - Variant stories for each meaningful combination (Size, Variant, State, etc.)30 - Edge case stories (empty state, error state, loading state)31323. **Add interactive controls**33 - Boolean controls for toggles (disabled, loading, etc.)34 - Select controls for variants (size: small/medium/large)35 - Text controls for content36 - Suggest control groups (e.g., "Button" group for size + variant)37384. **Document usage examples**39 - Show primary use case40 - Show edge cases41 - Add JSDoc comments for prop descriptions42 - Include accessibility notes if relevant43445. **Export story code**45 - TypeScript with proper types46 - Modern Storybook CSF 3.0+ syntax47 - Ready to commit without modification4849## Example5051User: "Generate Storybook for this Button component."5253Response generates:54```55export default {56 title: 'Components/Button',57 component: Button,58 argTypes: {59 size: { control: 'select', options: ['small', 'medium', 'large'] },60 variant: { control: 'select', options: ['primary', 'secondary', 'outline'] },61 disabled: { control: 'boolean' },62 children: { control: 'text' },63 },64};6566export const Primary = { args: { variant: 'primary', children: 'Click me' } };67export const Secondary = { args: { variant: 'secondary', children: 'Click me' } };68export const Disabled = { args: { disabled: true, children: 'Click me' } };69export const AllSizes = { render: () => <div>...</div> };70```