component-scaffold
Scaffold new components with stories, tests, and documentation following SOTA patterns and best practices
What this skill does
# Component Scaffold Skill
This skill provides comprehensive component scaffolding with:
- Framework-specific component templates (React, Vue, Svelte)
- TypeScript interfaces with proper types
- Accessibility attributes (ARIA labels, roles)
- Storybook stories with variants and tests
- Optional visual mockups
- Best practice patterns for each framework
## Features
### Component Generation
- **Type-Based Templates**: Pre-built templates for common component types (Button, Input, Card, Modal, Table, etc.)
- **Custom Components**: Generate components with user-defined props
- **Framework Support**: React, Vue 3, Svelte 5
- **TypeScript First**: All components generated with proper TypeScript types
- **Accessibility**: Built-in ARIA attributes and semantic HTML
### Testing Support
- **Storybook Stories**: Automatically generated with CSF 3.0 format
- **Variant Detection**: Intelligent variants based on component type
- **Interaction Tests**: Play functions with Testing Library
- **A11y Tests**: Accessibility testing with axe-core
### Visual Design
- **AI Mockups**: Optional visual references using NanoBanana
- **Design Tokens**: Integration with design system tokens
- **Responsive**: Mobile-first, responsive patterns
## Component Types Supported
### Form Components
- **Button**: Variants, sizes, loading states, icons
- **Input**: Validation, error states, helper text
- **Checkbox**: Indeterminate state, controlled/uncontrolled
- **Radio**: Radio groups with proper accessibility
- **Select**: Dropdown with search, multi-select
- **Textarea**: Auto-resize, character count
- **Switch/Toggle**: Binary state with labels
### Layout Components
- **Card**: Header, footer, image, variants
- **Container**: Max-width, padding, responsive
- **Grid**: CSS Grid with responsive columns
- **Stack**: Vertical/horizontal spacing
- **Divider**: Horizontal/vertical separators
### Navigation Components
- **Tabs**: Controlled tabs with keyboard navigation
- **Menu**: Dropdown menu with submenus
- **Breadcrumb**: Navigation breadcrumbs
- **Pagination**: Page navigation with ellipsis
### Feedback Components
- **Alert**: Success, warning, error, info variants
- **Toast**: Toast notifications with auto-dismiss
- **Modal/Dialog**: Focus trap, backdrop, ESC handling
- **Spinner**: Loading indicators
- **Progress**: Progress bars and circular progress
- **Skeleton**: Loading skeletons
### Data Display Components
- **Table**: Sorting, filtering, pagination, selection
- **List**: Virtual scrolling for large lists
- **Avatar**: User avatars with fallbacks
- **Badge**: Status badges with variants
- **Tooltip**: Hover tooltips with positioning
- **Popover**: Contextual popovers
## Templates
Templates are located in `templates/` directory:
```
templates/
├── react/
│ ├── button.template.tsx
│ ├── input.template.tsx
│ ├── card.template.tsx
│ ├── modal.template.tsx
│ ├── table.template.tsx
│ └── custom.template.tsx
├── vue/
│ ├── button.template.vue
│ ├── input.template.vue
│ └── ...
├── svelte/
│ ├── button.template.svelte
│ ├── input.template.svelte
│ └── ...
└── styles/
├── button.template.css
├── input.template.css
└── ...
```
## Scripts
### create_component.py
Main script for component generation:
```bash
python3 create_component.py \
--name Button \
--type button \
--framework react \
--typescript \
--output src/components/Button.tsx
```
**Arguments:**
- `--name`: Component name (PascalCase)
- `--type`: Component type (button, input, card, modal, table, custom)
- `--framework`: Target framework (react, vue, svelte)
- `--typescript`: Generate TypeScript (default: true)
- `--output`: Output file path
- `--props`: Custom props (comma-separated, for custom type)
- `--variants`: Custom variants (comma-separated)
### get_component_template.py
Helper to retrieve appropriate template:
```python
from get_component_template import get_template
template = get_template(
component_type='button',
framework='react',
typescript=True
)
```
## Usage Examples
### Example 1: Create Button Component
```bash
python3 create_component.py \
--name MyButton \
--type button \
--framework react \
--output src/components/MyButton.tsx
```
**Generated:**
```typescript
import React from 'react';
import './MyButton.css';
export interface MyButtonProps {
variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
size?: 'small' | 'medium' | 'large';
disabled?: boolean;
loading?: boolean;
onClick?: () => void;
children: React.ReactNode;
}
/**
* MyButton component with multiple variants and sizes
*/
export function MyButton({
variant = 'primary',
size = 'medium',
disabled = false,
loading = false,
onClick,
children,
}: MyButtonProps) {
return (
<button
className={`btn btn-${variant} btn-${size}`}
disabled={disabled || loading}
onClick={onClick}
aria-busy={loading}
>
{loading ? 'Loading...' : children}
</button>
);
}
```
### Example 2: Create Modal Component
```bash
python3 create_component.py \
--name Dialog \
--type modal \
--framework react \
--output src/components/Dialog.tsx
```
**Generated:**
- Dialog.tsx with focus trap
- Backdrop click handling
- ESC key handling
- Accessibility attributes (aria-modal, role="dialog")
### Example 3: Create Custom Component
```bash
python3 create_component.py \
--name UserCard \
--type custom \
--framework react \
--props "name:string,email:string,avatar:string,onEdit:function" \
--output src/components/UserCard.tsx
```
## Integration with Story Generation
After creating a component, automatically generate its story:
```bash
# Create component
python3 create_component.py --name Button --type button --output src/components/Button.tsx
# Generate story (using story-generation skill)
python3 ../story-generation/scripts/generate_story.py \
src/components/Button.tsx \
--level full \
--output src/components/Button.stories.tsx
```
## Best Practices
### React Components
- Use function components (not class components)
- Use hooks for state and effects
- Proper TypeScript interfaces for props
- Export component and interface
- Include displayName for dev tools
### Vue 3 Components
- Use Composition API (not Options API)
- Use `<script setup lang="ts">`
- Define props with `defineProps<T>()`
- Use `defineEmits` for events
- Scoped styles
### Svelte Components
- Use TypeScript in script blocks
- Export props with `export let`
- Use stores for state management
- Component-scoped styles
- Proper event forwarding
### Accessibility
- Include ARIA attributes (aria-label, aria-describedby)
- Use semantic HTML (button, nav, dialog)
- Keyboard navigation (Tab, Enter, ESC)
- Focus management (focus trap in modals)
- Screen reader support
## Customization
### Adding New Component Types
1. Create template file in `templates/{framework}/{type}.template.{ext}`
2. Add type definition in `create_component.py`
3. Define default props for the type
4. Update this documentation
### Modifying Templates
Templates use variable replacement:
- `{{COMPONENT_NAME}}`: Component name (PascalCase)
- `{{COMPONENT_CLASS}}`: CSS class name (kebab-case)
- `{{PROPS}}`: Props interface
- `{{PROP_DESTRUCTURING}}`: Destructured props with defaults
- `{{COMPONENT_LOGIC}}`: Component logic (hooks, computed, etc.)
- `{{COMPONENT_CONTENT}}`: JSX/template content
- `{{ATTRIBUTES}}`: HTML attributes (aria, data, etc.)
## Error Handling
The script handles common errors:
- Invalid component names
- Missing required arguments
- Unsupported frameworks
- File already exists
- Invalid prop definitions
## Platform Support
### Tauri
- Components work fully in Tauri applications
- IPC mocking included in generated stories
- Native API mocks provided
### Electron
- Components follow container/presentational pattern
- IPC interactions isolated in container components
- Testable presentational components in Storybook
### Web
- Full supRelated 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.