Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
thebushidocollective avatar

Storybook Story Writing

  • 633 installs
  • 186 repo stars
  • Updated July 19, 2026
  • thebushidocollective/han

storybook-story-writing is a Claude Code skill that generates and edits Component Story Format 3 (CSF3) Storybook stories for developers who maintain React component libraries and need consistent, buildable story files.

About

storybook-story-writing is a frontend-focused agent skill from thebushidocollective/han that writes and refactors Storybook stories using Component Story Format 3 (CSF3) with typed Meta and StoryObj imports from @storybook/react. The skill reads component source, applies CSF3 object-syntax patterns, showcases prop variations and render states, and validates that stories compile and render consistently across a library. Allowed tools include Read, Write, Edit, Bash, Grep, and Glob so agents can locate components, patch .stories.tsx files, and run local Storybook builds when needed. Developers reach for storybook-story-writing when onboarding new UI components, fixing broken stories after API changes, or standardizing story structure across a design system. It fits teams shipping SaaS dashboards, browser extensions, or content sites where Storybook is the contract between design and application code.

  • Generates Storybook stories
  • Integrates with component libraries
  • Supports UI testing workflows

Storybook Story Writing by the numbers

  • 633 all-time installs (skills.sh)
  • +5 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #550 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/thebushidocollective/han --skill storybook-story-writing

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs633
repo stars186
Last updatedJuly 19, 2026
Repositorythebushidocollective/han

How do you write CSF3 Storybook stories for React?

Generates Storybook stories for component libraries and UI development.

Who is it for?

Frontend developers maintaining a React component library who already use Storybook and want agent-generated CSF3 stories that match project conventions.

Skip if: Teams not using Storybook, Vue or Svelte-only codebases, or projects that only need visual regression snapshots without story authoring.

When should I use this skill?

A developer asks to create, update, or fix Storybook stories, CSF3 format, or component variation showcases.

What you get

CSF3 .stories.tsx files with Meta and StoryObj typings, component variation stories, and buildable Storybook entries.

  • .stories.tsx CSF3 files
  • Component variation stories

Files

SKILL.mdMarkdownGitHub ↗

Storybook - Story Writing

Write well-structured, maintainable Storybook stories using Component Story Format 3 (CSF3) that showcase component variations and ensure consistent rendering.

Key Concepts

Component Story Format 3 (CSF3)

CSF3 is the modern Storybook format that uses object syntax for stories:

import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './Button';

const meta = {
  title: 'Components/Button',
  component: Button,
  parameters: {
    layout: 'centered',
  },
  tags: ['autodocs'],
  argTypes: {
    backgroundColor: { control: 'color' },
  },
} satisfies Meta<typeof Button>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
  args: {
    primary: true,
    label: 'Button',
  },
};

export const Secondary: Story = {
  args: {
    label: 'Button',
  },
};

Story Organization

  • One story file per component: Component.stories.tsx
  • Use descriptive story names: Primary, Secondary, Large, Disabled
  • Group related stories under a title hierarchy: Components/Forms/Input

Default Export (Meta)

The default export defines metadata for all stories:

const meta = {
  title: 'Components/Button',        // Navigation path
  component: Button,                  // Component reference
  parameters: {},                     // Story-level config
  tags: ['autodocs'],                // Enable auto-documentation
  argTypes: {},                       // Control types
  decorators: [],                     // Wrappers for stories
} satisfies Meta<typeof Button>;

Best Practices

1. Use TypeScript for Type Safety

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
  component: Button,
} satisfies Meta<typeof Button>;

type Story = StoryObj<typeof meta>;

2. Show All Component States

Create stories for each meaningful state:

export const Default: Story = {
  args: {
    label: 'Click me',
  },
};

export const Loading: Story = {
  args: {
    label: 'Loading...',
    loading: true,
  },
};

export const Disabled: Story = {
  args: {
    label: 'Disabled',
    disabled: true,
  },
};

export const WithIcon: Story = {
  args: {
    label: 'Download',
    icon: 'download',
  },
};

3. Use Sensible Defaults

export const Primary: Story = {
  args: {
    primary: true,
    label: 'Button',
    size: 'medium',
  },
};

// Extend existing stories
export const PrimaryLarge: Story = {
  ...Primary,
  args: {
    ...Primary.args,
    size: 'large',
  },
};

4. Add Descriptive Parameters

export const WithTooltip: Story = {
  args: {
    label: 'Hover me',
    tooltip: 'Click to submit',
  },
  parameters: {
    docs: {
      description: {
        story: 'Shows a tooltip on hover to provide additional context.',
      },
    },
  },
};

5. Use Decorators for Context

import { RouterDecorator } from '../decorators';

const meta = {
  component: Navigation,
  decorators: [
    (Story) => (
      <div style={{ padding: '3rem' }}>
        <Story />
      </div>
    ),
    RouterDecorator,
  ],
} satisfies Meta<typeof Navigation>;

Common Patterns

Form Components

export const EmptyForm: Story = {
  args: {
    onSubmit: (data) => console.log(data),
  },
};

export const PrefilledForm: Story = {
  args: {
    defaultValues: {
      email: 'user@example.com',
      name: 'John Doe',
    },
  },
};

export const WithValidationErrors: Story = {
  args: {
    errors: {
      email: 'Invalid email format',
      name: 'Name is required',
    },
  },
};

Layout Components

export const WithSidebar: Story = {
  args: {
    sidebar: <Sidebar items={sidebarItems} />,
    children: <Content />,
  },
  parameters: {
    layout: 'fullscreen',
  },
};

Data-Driven Components

const mockData = [
  { id: 1, name: 'Item 1' },
  { id: 2, name: 'Item 2' },
  { id: 3, name: 'Item 3' },
];

export const WithData: Story = {
  args: {
    items: mockData,
  },
};

export const Empty: Story = {
  args: {
    items: [],
    emptyMessage: 'No items found',
  },
};

Responsive Components

export const Mobile: Story = {
  args: {
    variant: 'mobile',
  },
  parameters: {
    viewport: {
      defaultViewport: 'mobile1',
    },
  },
};

export const Desktop: Story = {
  args: {
    variant: 'desktop',
  },
  parameters: {
    viewport: {
      defaultViewport: 'desktop',
    },
  },
};

Anti-Patterns

❌ Don't Use Template Binding (CSF2)

// Bad - Old CSF2 format
const Template = (args) => <Button {...args} />;
export const Primary = Template.bind({});
Primary.args = { label: 'Button' };
// Good - CSF3 format
export const Primary: Story = {
  args: { label: 'Button' },
};

❌ Don't Mix Logic in Stories

// Bad
export const Complex: Story = {
  render: (args) => {
    const [state, setState] = useState(false);
    useEffect(() => {
      // Complex side effects
    }, []);
    return <Component {...args} />;
  },
};
// Good - Move logic to component or use play functions
export const Complex: Story = {
  args: { initialState: false },
};

❌ Don't Hardcode Repetitive Props

// Bad
export const Story1: Story = {
  args: { label: 'Button', size: 'medium', theme: 'light' },
};
export const Story2: Story = {
  args: { label: 'Submit', size: 'medium', theme: 'light' },
};
// Good - Use meta-level defaults
const meta = {
  component: Button,
  args: {
    size: 'medium',
    theme: 'light',
  },
} satisfies Meta<typeof Button>;

export const Story1: Story = {
  args: { label: 'Button' },
};
export const Story2: Story = {
  args: { label: 'Submit' },
};

❌ Don't Skip Story Types

// Bad - Missing type annotation
export const Primary = {
  args: { label: 'Button' },
};
// Good - With type
export const Primary: Story = {
  args: { label: 'Button' },
};

Related Skills

  • storybook-args-controls: Advanced arg configuration and interactive controls
  • storybook-play-functions: Automated interaction testing within stories
  • storybook-component-documentation: Auto-generating component documentation

Related skills

How it compares

Pick storybook-story-writing when you need new or updated CSF3 story files inside an existing Storybook setup, not when you only want screenshot or visual-regression test generation.

FAQ

What Storybook format does storybook-story-writing use?

storybook-story-writing targets Component Story Format 3 (CSF3), the object-syntax Storybook format with typed Meta and StoryObj imports from @storybook/react, so stories showcase variations and stay maintainable.

Which tools can storybook-story-writing run?

storybook-story-writing allows Read, Write, Edit, Bash, Grep, and Glob, enabling agents to locate components, edit .stories.tsx files, search the repo, and run Storybook-related shell commands when validation is needed.

Frontend Developmentfrontendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.