component-scaffold
# Component Scaffolding Skill
What this skill does
# Component Scaffolding Skill
This skill allows Claude to automatically scaffold UI components with all necessary files and boilerplate code when the context suggests a component needs to be created.
## When to Use This Skill
Claude should invoke this skill autonomously when:
- User mentions creating a new component
- Discussion involves building UI elements
- Task requires adding new views or pages
- User describes a component they need
- Code analysis shows a component is referenced but doesn't exist
## What This Skill Does
Automatically generates a complete component structure including:
1. Main component file with TypeScript
2. Styles file (CSS Module, SCSS, or styled-components)
3. Test file with basic tests
4. Storybook story (if Storybook is detected)
5. Type definitions file
6. Index file for clean exports
## Framework Detection
The skill detects the project framework and generates appropriate code:
- **React**: Functional components with hooks
- **Next.js**: React Server Components or Client Components as appropriate
- **Vue 3**: Composition API with script setup
## Input Parameters
When invoked, the skill expects:
- `componentName`: Name of the component (e.g., "UserCard", "LoginForm")
- `componentType`: Type of component ("page", "layout", "ui", "feature")
- `hasProps`: Whether the component accepts props
- `needsState`: Whether the component needs internal state
- `async`: Whether the component fetches data
## Generated Structure
### For React/Next.js Component:
```
ComponentName/
├── ComponentName.tsx # Main component
├── ComponentName.module.css # Styles (if using CSS Modules)
├── ComponentName.test.tsx # Unit tests
├── ComponentName.stories.tsx # Storybook (if applicable)
├── ComponentName.types.ts # TypeScript types
└── index.ts # Barrel export
```
### For Vue Component:
```
ComponentName/
├── ComponentName.vue # Main component
├── ComponentName.spec.ts # Unit tests
├── ComponentName.stories.ts # Storybook (if applicable)
└── index.ts # Export
```
## Component Template Features
All generated components include:
### 1. TypeScript Types
```typescript
export interface ComponentNameProps {
// Props with JSDoc comments
title: string
onAction?: () => void
}
```
### 2. Accessibility
```typescript
// Semantic HTML
<button
type="button"
aria-label="Descriptive label"
onClick={handleClick}
>
```
### 3. Documentation
```typescript
/**
* ComponentName - Brief description
*
* @param title - Description of title prop
* @param onAction - Optional callback function
*
* @example
* <ComponentName title="Hello" onAction={handleAction} />
*/
```
### 4. Error Boundaries (React)
```typescript
// For complex components
export class ComponentNameErrorBoundary extends Component {
// Error boundary implementation
}
```
### 5. Loading States
```typescript
if (isLoading) {
return <Skeleton />
}
```
### 6. Tests
```typescript
describe('ComponentName', () => {
it('renders correctly', () => {
render(<ComponentName title="Test" />)
expect(screen.getByText('Test')).toBeInTheDocument()
})
it('handles user interaction', async () => {
const handleAction = vi.fn()
render(<ComponentName title="Test" onAction={handleAction} />)
await userEvent.click(screen.getByRole('button'))
expect(handleAction).toHaveBeenCalled()
})
})
```
## Styling Approaches
The skill adapts to the project's styling method:
### CSS Modules
```typescript
import styles from './ComponentName.module.css'
return <div className={styles.container}>...</div>
```
### Tailwind CSS
```typescript
return <div className="flex items-center gap-4 p-4">...</div>
```
### Styled Components
```typescript
import styled from 'styled-components'
const Container = styled.div`
display: flex;
/* styles */
`
```
## Best Practices Included
1. **Atomic Design Principles**
- Atoms: Basic building blocks (Button, Input)
- Molecules: Simple combinations (SearchBar)
- Organisms: Complex components (Header, UserProfile)
- Templates: Page layouts
- Pages: Actual pages
2. **Component Composition**
- Prefer composition over prop drilling
- Use children for flexible layouts
- Create compound components when appropriate
3. **Performance Optimization**
- Memo components when needed
- Lazy load heavy components
- Optimize re-renders
4. **Code Organization**
- Hooks at the top
- Event handlers in the middle
- Render logic at the bottom
- Helper functions outside component or in utils
## Integration with Project
The skill:
- Reads project structure to determine correct location
- Detects existing component patterns and follows them
- Uses project's ESLint/Prettier configuration
- Imports from existing utility/helper files
- Follows existing naming conventions
## Advanced Features
### Context Integration
Automatically imports and uses context:
```typescript
const { user } = useAuth()
const { theme } = useTheme()
```
### Form Handling
Integrates with form libraries if detected:
```typescript
import { useForm } from 'react-hook-form'
const { register, handleSubmit, formState: { errors } } = useForm()
```
### Data Fetching
Uses project's data fetching approach:
```typescript
// TanStack Query
const { data, isLoading, error } = useQuery({
queryKey: ['users'],
queryFn: fetchUsers,
})
// SWR
const { data, error, isLoading } = useSWR('/api/users', fetcher)
```
## Example Invocations
### Simple UI Component
```
User: "I need a card component to display user information"
Skill generates:
- UserCard.tsx with props for user data
- Styles with card layout
- Tests for rendering and interactions
- TypeScript types for user data
```
### Complex Feature Component
```
User: "Create a product listing page with filters"
Skill generates:
- ProductListing.tsx with state management
- Filter components
- Product card components
- API integration for fetching products
- Loading and error states
- Comprehensive tests
```
### Form Component
```
User: "Build a registration form"
Skill generates:
- RegistrationForm.tsx with validation
- Form fields (email, password, etc.)
- react-hook-form integration
- Error display
- Submit handling
- Accessibility attributes
- Tests for validation and submission
```
## Customization Options
Users can provide additional context:
- "with dark mode support"
- "mobile responsive"
- "with animations"
- "accessible for screen readers"
- "with loading skeleton"
The skill adapts the generated code accordingly.
## Error Handling
If the skill cannot determine:
- Framework: Asks the user
- Component location: Suggests based on type
- Styling approach: Uses project default or asks
## Output
After scaffolding, the skill provides:
1. Summary of created files
2. Import statement for using the component
3. Basic usage example
4. Notes on customization needed
5. Next steps (adding logic, styling, etc.)
This skill dramatically speeds up component creation while ensuring consistency and best practices across the codebase.
Related 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.