story-generation
Use this skill when the user asks to "generate stories for components", "parse component props", "detect component variants", "analyze components", "create stories automatically", mentions "component parser", "story automation", or wants to generate Storybook stories from existing component files. This skill provides intelligent component analysis and CSF 3.0 story generation with interaction tests and accessibility checks.
What this skill does
# Story Generation Skill
## Overview
Generate Storybook stories automatically from existing components by parsing prop types, detecting variants, and creating comprehensive CSF 3.0 stories with interaction tests and accessibility validation.
This skill provides a complete component analysis and story generation pipeline for React, Vue, and Svelte components.
## What This Skill Provides
### Component Analysis
Parse component files to extract:
- Component name and type classification
- Props with TypeScript types
- Required vs optional props
- Default values
- Children/slots detection
### Intelligent Variant Detection
Automatically detect story variants from:
- Enum/union types: `'primary' | 'secondary' | 'outline'`
- Size props: `small`, `medium`, `large`
- Boolean states: `disabled`, `loading`, `error`
- Component-type specific patterns
### Story Generation
Create complete story files with:
- **CSF 3.0 format** (`satisfies Meta<typeof Component>`)
- **ArgTypes** with smart control inference (see Controls section below)
- **Variant stories** for all detected variations
- **Interaction tests** with play functions (Testing Library)
- **Accessibility tests** with axe-core rules
- **Component-specific test patterns** (button clicks, input validation, modal focus)
### Storybook 10 Controls (argTypes)
The generator infers appropriate control types based on prop names and types:
| Prop Pattern | Control Type | Example |
|--------------|--------------|---------|
| `boolean` type | `{ control: 'boolean' }` | `disabled`, `loading` |
| `number` type | `{ control: 'number' }` | `count`, `index` |
| `opacity`, `progress` | `{ control: { type: 'range', min: 0, max: 1 } }` | `opacity`, `percent` |
| `size`, `width`, `height` | `{ control: { type: 'range', min: 0, max: 100 } }` | `padding`, `margin` |
| `color`, `background`, `fill` | `{ control: 'color' }` | `backgroundColor`, `textColor` |
| `*Date`, `*Time`, `timestamp` | `{ control: 'date' }` | `createdDate`, `startTime` |
| `object`, `Record<>` | `{ control: 'object' }` | `style`, `config` |
| `array`, `[]` | `{ control: 'object' }` | `items`, `options[]` |
| `file`, `src`, `source` | `{ control: 'file' }` | `avatarFile`, `imageSrc` |
| Union type (2-4 options) | `{ options: [...], control: { type: 'radio' } }` | `'sm' \| 'md' \| 'lg'` |
| Union type (5+ options) | `{ options: [...], control: { type: 'select' } }` | `'a' \| 'b' \| 'c' \| 'd' \| 'e'` |
| `on*` (callbacks) | `{ action: 'propName' }` | `onClick`, `onChange` |
| `string` type | `{ control: 'text' }` | `label`, `placeholder` |
| `ReactNode`, `ReactElement` | `{ control: false }` | `children`, `icon` |
**Example generated argTypes:**
```typescript
argTypes: {
variant: { options: ['primary', 'secondary', 'outline'], control: { type: 'radio' } },
size: { options: ['sm', 'md', 'lg'], control: { type: 'radio' } },
disabled: { control: 'boolean' },
backgroundColor: { control: 'color' },
onClick: { action: 'onClick' },
label: { control: 'text' },
}
```
**Recommended preview.ts configuration:**
```typescript
// .storybook/preview.ts
const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};
```
### Multi-Framework Support
- **React/TypeScript**: Parse interfaces, types, function components
- **Vue 3**: Parse `defineProps<T>` and runtime props
- **Svelte**: Parse `export let` statements
## Core Scripts
The skill provides four main scripts in `scripts/`:
### 1. parse_component.py
Parse component files to extract metadata.
**Usage:**
```bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/story-generation/scripts/parse_component.py \
path/to/Component.tsx \
--json
```
**Output:** Component metadata (name, framework, props, type classification)
### 2. detect_variants.py
Detect story variants from component props.
**Usage:**
```bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/story-generation/scripts/detect_variants.py \
path/to/Component.tsx \
--json
```
**Output:** List of variants with args and priorities
### 3. generate_story.py
Generate complete story file with tests.
**Usage:**
```bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/story-generation/scripts/generate_story.py \
path/to/Component.tsx \
--level full \
--output path/to/Component.stories.tsx
```
**Testing levels:**
- `full`: All features (variants + interaction tests + a11y tests)
- `standard`: Variants + interaction tests
- `basic`: Variants with args/controls only
- `minimal`: Single default story
### 4. scan_components.py
Scan project directories for components.
**Usage:**
```bash
python3 ${CLAUDE_PLUGIN_ROOT}/skills/story-generation/scripts/scan_components.py \
src \
--json
```
**Output:** JSON array of discovered components with metadata
## Story Templates
Templates are located in `templates/` directory:
- `react-full.template` - React with full testing
- `react-basic.template` - React basic stories
- `vue-full.template` - Vue 3 with full testing
- `svelte-full.template` - Svelte with full testing
Templates use variable replacement:
- `{{COMPONENT_NAME}}` - Component name
- `{{VARIANT_STORIES}}` - Generated variant exports
- `{{INTERACTION_TEST_CODE}}` - Test code
- `{{A11Y_RULES}}` - Accessibility rules
## Workflow Integration
This skill integrates with the `/generate-stories` command:
1. **Scan**: Discover components with `scan_components.py`
2. **Parse**: Extract metadata with `parse_component.py`
3. **Detect**: Find variants with `detect_variants.py`
4. **Generate**: Create story with `generate_story.py`
## Component Type Support
The parser automatically detects and generates appropriate tests for:
| Type | Example | Special Handling |
|------|---------|------------------|
| button | Button, SubmitButton | Click tests, disabled check |
| input | TextField, Input | Type tests, value validation |
| checkbox | Checkbox | Click, checked state |
| select | Dropdown, Select | Option selection |
| card | Card, ProductCard | Render tests |
| modal | Dialog, Modal | Focus trap, ESC handler |
| table | DataTable, Table | Row/column tests |
15+ component types supported with custom test patterns.
## Example Usage
### Parse a Button Component
```bash
# Parse component
python3 scripts/parse_component.py src/components/Button.tsx
# Output:
# Component: Button
# Framework: react
# Type: button
# Props (6):
# - variant: 'primary' | 'secondary' | 'outline' | 'ghost' (required)
# - size: 'small' | 'medium' | 'large' (optional)
# - disabled: boolean (optional)
# - loading: boolean (optional)
# - onClick: () => void (optional)
# - children: React.ReactNode (required)
```
### Detect Variants
```bash
# Detect variants
python3 scripts/detect_variants.py src/components/Button.tsx
# Output:
# Detected 11 variants:
# 1. Primary (variant: primary)
# 2. Secondary (variant: secondary)
# 3. Outline (variant: outline)
# 4. Ghost (variant: ghost)
# 5-7. Small/Medium/Large (size variants)
# 8. Disabled (boolean state)
# 9. Loading (boolean state)
```
### Generate Complete Story
```bash
# Generate story with full testing
python3 scripts/generate_story.py \
src/components/Button.tsx \
--level full \
--output src/components/Button.stories.tsx
```
**Generated story includes:**
- Meta configuration with argTypes
- 11 variant stories (Primary, Secondary, Outline, Ghost, Small, Large, Disabled, Loading, etc.)
- Interaction test with play function
- Accessibility test with axe-core rules
## Performance
- Component parsing: ~10ms per component
- Variant detection: ~1ms per component
- Story generation: ~15ms per component
- **Total**: ~26ms per component
Can process 100+ components in 2-3 seconds.
## Error Handling
The scripts handle common errors gracefully:
- **Parse failures**: Skip component, continue with others
- **Unknown types**: Fall back to generic component template
- **Missing files**: Clear error messages
- **Invalid syntax**: Report parsiRelated 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.