storybook-component-documentation
Use when creating or improving component documentation in Storybook. Helps generate comprehensive docs using MDX, autodocs, and JSDoc comments.
What this skill does
# Storybook - Component Documentation
Create comprehensive, auto-generated component documentation using Storybook's autodocs feature, MDX pages, and JSDoc comments.
## Key Concepts
### Autodocs
Automatically generate documentation pages from stories:
```typescript
const meta = {
title: 'Components/Button',
component: Button,
tags: ['autodocs'], // Enable auto-documentation
parameters: {
docs: {
description: {
component: 'A versatile button component with multiple variants and sizes.',
},
},
},
} satisfies Meta<typeof Button>;
```
### MDX Documentation
Create custom documentation pages with full control:
```mdx
import { Meta, Canvas, Story, Controls } from '@storybook/blocks';
import * as ButtonStories from './Button.stories';
<Meta of={ButtonStories} />
# Button Component
A versatile button component for user interactions.
## Usage
<Canvas of={ButtonStories.Primary} />
## Props
<Controls of={ButtonStories.Primary} />
```
### JSDoc Comments
Document component props for auto-extraction:
```typescript
interface ButtonProps {
/**
* The button label text
*/
label: string;
/**
* Is this the principal call to action?
* @default false
*/
primary?: boolean;
/**
* Button size variant
* @default 'medium'
*/
size?: 'small' | 'medium' | 'large';
}
```
## Best Practices
### 1. Enable Autodocs
Add the `autodocs` tag to generate documentation automatically:
```typescript
const meta = {
component: Button,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'Button component with primary and secondary variants.',
},
},
},
} satisfies Meta<typeof Button>;
```
### 2. Document Component Descriptions
Provide clear, concise component descriptions:
```typescript
const meta = {
component: Tooltip,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: `
Tooltip displays helpful information when users hover over an element.
Supports multiple placements and can be triggered by hover, click, or focus.
## Features
- Multiple placement options
- Customizable delay
- Accessible (ARIA compliant)
- Keyboard navigation support
`.trim(),
},
},
},
} satisfies Meta<typeof Tooltip>;
```
### 3. Document Story Variations
Add descriptions to individual stories:
```typescript
export const WithIcon: Story = {
args: {
label: 'Download',
icon: 'download',
},
parameters: {
docs: {
description: {
story: 'Buttons can include icons to enhance visual communication.',
},
},
},
};
export const Loading: Story = {
args: {
loading: true,
label: 'Processing...',
},
parameters: {
docs: {
description: {
story: 'Loading state disables interaction and shows a spinner.',
},
},
},
};
```
### 4. Use JSDoc for Type Documentation
Document props with JSDoc for rich documentation:
```typescript
interface CardProps {
/**
* Card title displayed at the top
*/
title: string;
/**
* Optional subtitle below the title
*/
subtitle?: string;
/**
* Card variant affecting visual style
* @default 'default'
*/
variant?: 'default' | 'outlined' | 'elevated';
/**
* Card content
*/
children: React.ReactNode;
/**
* Called when card is clicked
* @param event - The click event
*/
onClick?: (event: React.MouseEvent) => void;
/**
* Elevation level (shadow depth)
* @minimum 0
* @maximum 5
* @default 1
*/
elevation?: number;
}
```
### 5. Create Usage Examples
Show realistic usage examples in MDX:
```mdx
import { Meta, Canvas, Story } from '@storybook/blocks';
import * as FormStories from './Form.stories';
<Meta of={FormStories} />
# Form Component
## Basic Usage
<Canvas of={FormStories.Default} />
## With Validation
<Canvas of={FormStories.WithValidation} />
```tsx
import { Form } from './Form';
function MyForm() {
return (
<Form
onSubmit={(data) => console.log(data)}
validationSchema={schema}
>
<Input name="email" label="Email" />
<Button type="submit">Submit</Button>
</Form>
);
}
```
```
## Common Patterns
### Component Overview Page
```mdx
import { Meta, Canvas, Controls } from '@storybook/blocks';
import * as ButtonStories from './Button.stories';
<Meta of={ButtonStories} />
# Button
Buttons trigger actions and events throughout the application.
## Variants
### Primary
Use primary buttons for the main call-to-action.
<Canvas of={ButtonStories.Primary} />
### Secondary
Use secondary buttons for less important actions.
<Canvas of={ButtonStories.Secondary} />
## Props
<Controls of={ButtonStories.Primary} />
## Accessibility
- Keyboard accessible (Enter/Space to activate)
- Screen reader friendly
- Focus visible indicator
- Proper ARIA labels
## Best Practices
- Use clear, action-oriented labels
- Provide sufficient click target size (min 44×44px)
- Don't use more than one primary button per section
- Include loading states for async actions
```
### API Documentation
```typescript
const meta = {
component: DataGrid,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'Advanced data grid with sorting, filtering, and pagination.',
},
},
},
argTypes: {
data: {
description: 'Array of data objects to display',
table: {
type: { summary: 'Array<Record<string, any>>' },
},
},
columns: {
description: 'Column configuration',
table: {
type: { summary: 'ColumnDef[]' },
},
},
onRowClick: {
description: 'Callback fired when a row is clicked',
table: {
type: { summary: '(row: any, index: number) => void' },
},
},
},
} satisfies Meta<typeof DataGrid>;
```
### Migration Guides
```mdx
import { Meta } from '@storybook/blocks';
<Meta title="Guides/Migration/v2 to v3" />
# Migration Guide: v2 → v3
## Breaking Changes
### Button Component
**Before (v2):**
```tsx
<Button type="primary">Click me</Button>
```
**After (v3):**
```tsx
<Button variant="primary">Click me</Button>
```
The `type` prop has been renamed to `variant` for consistency.
### Input Component
**Before (v2):**
```tsx
<Input error="Invalid email" />
```
**After (v3):**
```tsx
<Input error={{ message: "Invalid email" }} />
```
Error handling now uses an object to support additional metadata.
## New Features
### Icon Support
Buttons now support icons:
```tsx
<Button variant="primary" icon="check">
Save
</Button>
```
```
### Design Tokens
Document design tokens and theming:
```mdx
import { Meta, ColorPalette, ColorItem, Typeset } from '@storybook/blocks';
<Meta title="Design System/Colors" />
# Color Palette
## Primary Colors
<ColorPalette>
<ColorItem
title="Primary"
subtitle="Main brand color"
colors={{ Primary: '#007bff' }}
/>
<ColorItem
title="Secondary"
subtitle="Supporting color"
colors={{ Secondary: '#6c757d' }}
/>
</ColorPalette>
## Typography
<Typeset
fontSizes={[12, 14, 16, 20, 24, 32, 40, 48]}
fontWeight={400}
sampleText="The quick brown fox jumps over the lazy dog"
/>
```
## Advanced Patterns
### Inline Stories in MDX
```mdx
import { Meta, Story } from '@storybook/blocks';
import { Button } from './Button';
<Meta title="Components/Button/Examples" component={Button} />
# Button Examples
## Inline Story
<Story name="Custom">
{() => {
const [count, setCount] = React.useState(0);
return (
<Button onClick={() => setCount(count + 1)}>
Clicked {count} times
</Button>
);
}}
</Story>
```
### Code Snippets
```mdx
import { Source } from '@storybook/blocks';
<Meta title="Guides/Setup" />
# Installation
Install the component library:
<Source
language="bash"
code={`
npm install @company/ui-components
# or
yarn add @company/ui-components
`}
/>
Then import components:
<SoRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.