Generate Storybook Stories from Your Existing Components
Writing Storybook stories by hand takes time you rarely have — paste your components and ask Claude to generate a complete stories file with edge cases and variants already covered.
Ask Claude: "Write a complete Storybook 8 CSF3 stories file for this component.
Include all prop variants, edge cases like loading and error states, and make
the main story interactive with controls."
Claude generates properly typed CSF3 format stories with ArgTypes for interactive controls, sensible decorators if your component needs providers, and stories for every meaningful state:
export default {
title: 'UI/Button',
component: Button,
tags: ['autodocs'],
} satisfies Meta<typeof Button>;
type Story = StoryObj<typeof Button>;
export const Primary: Story = { args: { variant: 'primary', children: 'Click me' } };
export const Loading: Story = { args: { isLoading: true, children: 'Saving...' } };
export const Disabled: Story = { args: { disabled: true, children: 'Unavailable' } };
export const Destructive: Story = { args: { variant: 'destructive', children: 'Delete' } };
For a whole directory of components, ask Claude to identify which ones are missing stories files and batch-generate them:
claude -p "List every component in src/components/ that doesn't have a .stories.tsx file, then write stories for each one."
Storybook documentation pays dividends for teams — get Claude to write the boilerplate so you can focus on building the components.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.