AI駆動Storybook 9/10開発アシスタント。フレームワーク自動検出(React/Vue/Svelte/Angular等)。/setup-storybook、/generate-stories、/fix-accessibilityコマンド。Vitest + Playwrightテスト、axe-coreアクセシビリティ監査対応。
Complete SOTA 2026 Storybook assistant with Vision AI design-to-code, natural language generation, AI-powered accessibility remediation, React Server Components, AI visual regression testing, design token sync, usage analytics, dark mode generation, and comprehensive testing (Storybook 10, React 19, Next.js 15).
🚀 First time here? Start with the ELI5 section for a quick overview, then check How to Use to get started, or ask "What can the Storybook Assistant do?" to see all available features!
/setup-storybookCLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEYMethod 1: Via Claude Code CLI (Recommended)
claude
# In Claude prompt:
/plugin
# When prompted, enter:
flight505/storybook-assistant-plugin
Method 2: Manual Clone
# Clone to Claude plugins directory
git clone https://github.com/flight505/storybook-assistant-plugin.git ~/.claude/plugins/storybook-assistant
# Start Claude normally - plugin auto-loads
claude
Method 3: Project-Specific
# In your project directory
git clone https://github.com/flight505/storybook-assistant-plugin.git
# Start Claude with plugin
claude --plugin-dir ./storybook-assistant-plugin
Verify installation: Plugin will automatically check environment on SessionStart and display available features.
Once installed, the plugin is available in your Claude Code CLI sessions:
cd your-project
claude
# Ask what the Storybook Assistant can do
"What can the Storybook Assistant do?"
"Show me Storybook plugin features"
"What Storybook commands are available?"
"Help with Storybook Assistant"
/# Initialize Storybook in your project
/setup-storybook
# Generate stories for existing components
/generate-stories
# Create new component with story and tests
/create-component
"Set up Storybook in this Next.js project"
"Generate stories for my Button component"
"Create a new Card component with dark mode support"
"Fix accessibility issues in LoginForm.tsx"
The plugin understands natural language and will automatically trigger the right skills!
| Command | Description |
|---|---|
/setup-storybook | Initialize Storybook 10 in your project |
/generate-stories | Generate stories for existing components |
/create-component | Scaffold new component with stories |
/design-to-code | Transform design screenshots to React components |
/fix-accessibility | AI-powered WCAG 2.2 accessibility fixes |
/generate-dark-mode | Auto-generate dark mode color schemes |
/setup-visual-testing | Configure AI visual regression testing |
/sync-design-tokens | Sync design tokens between Figma and code |
/analyze-usage | Analyze component usage across codebase |
# 1. Start Claude in your project
cd my-react-app
claude
# 2. See what's available
"What Storybook commands are available?"
# 3. Set up Storybook
/setup-storybook
# 4. Generate stories for components
/generate-stories
# 5. Or create something new
/create-component
# Then follow the interactive prompts!
Imagine you're building a house (your app), and you need to organize all your building blocks (components) in one place where you can see them, test them, and make sure they work.
That's what Storybook does—it's like a workshop for your UI components.
When building apps, developers create lots of UI pieces (buttons, cards, forms). It's hard to:
This plugin is your AI assistant that:
Before (traditional way):
npm install storybook
npx storybook init
# Answer 10 questions by typing
# Edit 5 config files manually
# Create example stories
# Install testing addons
# Configure webpack/vite
After (with this plugin):
claude
/setup-storybook
# Click your choices from menus
# Everything is done for you
The plugin detects your project automatically (React? Vue? Next.js?), asks what you want (testing? dark mode? visual mockups?), and sets everything up perfectly.
The Storybook Assistant plugin has 4 core component types that work together:
What they are: Knowledge modules that activate when you use specific keywords in conversation.
How they work:
visual-regression-testing skillExamples:
visual-design - Activates on: "generate mockup", "style guide", "design system"component-scaffold - Activates on: "create component", "new component"accessibility-remediation - Activates on: "fix accessibility", "a11y issues"Think of skills as: Auto-loading expert consultants who appear when their expertise is needed.
What they are: Slash commands (/command-name) that perform specific tasks.
How they work:
/setup-storybookAskUserQuestion to create interactive menusExamples:
/setup-storybook # Initialize Storybook
/generate-stories # Generate stories for components
/create-component # Scaffold new component
/fix-accessibility # Run accessibility audits
Think of commands as: Direct action buttons with interactive wizards.
What they are: Specialized AI agents that work autonomously on complex tasks.
How they work:
Examples:
accessibility-auditor - Scans codebase, finds a11y issues, generates fixescomponent-generator - Analyzes designs, generates React componentsvisual-regression-analyzer - Compares screenshots, detects UI changesThink of agents as: Automated specialists who handle complex multi-step tasks.
What they are: Scripts that run automatically on specific events.
How they work:
Example output:
✅ Environment Check:
✓ Node.js v25.3.0 (>= 20.0.0)
✓ pnpm 10.28.0
✓ CLAUDE_CODE_OAUTH_TOKEN found
⚠ OPENROUTER_API_KEY not found (visual generation disabled)
Think of hooks as: Pre-flight checks that run before takeoff.
Instead of making you type answers or edit config files, the plugin creates interactive menus where you click your choices.
Behind the scenes:
// Plugin code (simplified)
AskUserQuestion({
questions: [{
question: "Which framework detected?",
header: "Framework",
options: [
{ label: "React 19", description: "Modern React with hooks" },
{ label: "Vue 3", description: "Composition API" },
{ label: "Svelte 5", description: "With Runes" }
]
}]
})
What you see:
? Which framework detected? (Framework)
❯ React 19 - Modern React with hooks
Vue 3 - Composition API
Svelte 5 - With Runes
/setup-storybookThe Flow:
Framework Detection (automatic)
package.jsonPlatform Detection (automatic)
tauri.conf.json or electron-builder.ymlDesign System Detection (automatic)
User Preferences (interactive menu)
? What testing features do you want?
❯ Full Testing (Recommended) - Interaction + A11y + Coverage
Basic Testing - Interaction tests only
No Testing - Stories only
? Enable visual generation features?
❯ Yes - Generate style guides and mockups (requires API key)
No - Skip visual generation
Execution (automatic)
Result
✅ Storybook 10 Setup Complete!
Configured for: React 19 (Next.js 15, Tauri)
Design System: shadcn/ui
Testing: Full (Vitest + Playwright + axe-core)
Next: npm run storybook
Traditional approach (other tools):
This plugin:
/setup-storybookInitialize Storybook 10 with automatic framework detection and SOTA configuration.
What it does:
Example:
/setup-storybook
# Output:
✅ Storybook 10 Setup Complete!
Configured for: React 18.2.0 (Vite)
Platform: Tauri
Design System: shadcn/ui
Features Enabled:
✓ Interaction Tests (Vitest + Playwright)
✓ Accessibility Tests (axe-core)
✓ Code Coverage (V8)
✓ Visual Generation (Style guide & mockups)
Next Steps:
1. Run: npm run storybook
2. Open: http://localhost:6006
/generate-storiesGenerate story files for existing components with tests and variants.
What it does:
Example:
/generate-stories
# Interactive selection:
? I found 32 components. Which should I generate stories for?
☑ Button (src/components/Button.tsx) • 5 props • Button • 3 variants detected
☑ Card (src/components/Card.tsx) • 8 props • Layout • 2 variants detected
☑ DataTable (src/components/DataTable.tsx) • 12 props • Data Display • 4 variants detected
? What level of testing should I include?
● Full Testing (Recommended)
✅ Generated Stories: 3 components
✓ Button - 7 stories (3 variants + 2 interaction tests + 2 a11y tests)
✓ Card - 4 stories (2 variants + 1 interaction test + 1 a11y test)
✓ DataTable - 8 stories (4 variants + 2 interaction tests + 2 a11y tests)
/create-componentScaffold a new component with story, tests, and documentation.
What it does:
Example:
/create-component
? What type of component are you creating?
● Card/Layout component
? Component name?
ProfileCard
? Generate visual mockup using AI?
● Yes (Recommended)
🎨 Generating mockup...
✅ Mockup saved: mockups/ProfileCard.png
✅ Component Created:
- src/components/ProfileCard/ProfileCard.tsx
- src/components/ProfileCard/ProfileCard.stories.tsx
- src/components/ProfileCard/ProfileCard.test.tsx
- mockups/ProfileCard.png
Next: Implement component following the mockup
/migrate-storybookMigrate from older Storybook versions to Storybook 10.
What it does:
storybook automigrateSupported Frameworks:
All Features Work:
Why It Works:
Development Workflow:
Terminal 1: npm run tauri dev # Port 5173 - Tauri app
Terminal 2: npm run storybook # Port 6006 - Component development
Terminal 3: npm run test:watch # Vitest watch mode
IPC Mocking: Plugin automatically generates Tauri IPC mocks:
// Auto-generated: .storybook/tauri-mocks.ts
export const tauriMocks = {
invoke: async (cmd: string, args?: any) => { /* mock */ },
listen: (event: string, handler: Function) => { /* mock */ },
};
Best Practice:
What Works:
What Doesn't Work:
electron module importsPlugin Provides:
Recommended Pattern:
// ✅ Pure component - works in Storybook
function DataDisplay({ data, onRefresh }) {
return <div onClick={onRefresh}>{data}</div>;
}
// ❌ Electron-aware container - doesn't work in Storybook
function DataDisplayContainer() {
const [data, setData] = useState(null);
const handleRefresh = async () => {
const result = await window.api.fetchData(); // Electron IPC
setData(result);
};
return <DataDisplay data={data} onRefresh={handleRefresh} />;
}
// Storybook story - test pure component
export const Default = () => (
<DataDisplay data="Test Data" onRefresh={() => {}} />
);
# 1. Get API key
# Visit: https://openrouter.ai/keys
# 2. Add to .env
echo "OPENROUTER_API_KEY=your_key_here" >> .env
# 3. Restart Claude Code
Style Guides:
Component Mockups:
Architecture Diagrams:
Without OPENROUTER_API_KEY:
export const WithInteraction: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const button = canvas.getByRole('button');
await userEvent.click(button);
await expect(button).toBeInTheDocument();
},
};
Powered by:
export const AccessibilityTest: Story = {
parameters: {
a11y: {
config: {
rules: [
{ id: 'color-contrast', enabled: true },
{ id: 'button-name', enabled: true },
],
},
},
},
};
Powered by:
# Run tests with coverage
npm run storybook:coverage
# View report
open coverage/index.html
Powered by:
The plugin checks for API keys in this order:
For Claude API:
CLAUDE_CODE_OAUTH_TOKEN (preferred)ANTHROPIC_API_KEY (fallback)For Visual Generation:
OPENROUTER_API_KEY (optional)# Required (one of):
CLAUDE_CODE_OAUTH_TOKEN=your_token_here
# OR
ANTHROPIC_API_KEY=your_key_here
# Optional (for visual generation):
OPENROUTER_API_KEY=your_key_here
# Create .env in project root
CLAUDE_CODE_OAUTH_TOKEN=your_token_here
OPENROUTER_API_KEY=your_key_here # Optional
Contributions welcome! Please read CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
Built with ❤️ by Jesper Vang
Powered by State-of-the-Art 2026 best practices 🚀
互換性