component-architecture
Design and build reusable, well-documented components. Master component composition, prop design, variant systems, state management, and documentation. Create a scalable component library that enables consistency and speeds up development. Works with React, TypeScript, and Tailwind CSS.
What this skill does
# Component Architecture
## Overview
Components are the building blocks of modern interfaces. A well-designed component system enables consistency, speeds up development, and makes maintenance easier. This skill teaches you to think about components systematically: designing for reusability, managing complexity, documenting thoroughly, and building a library that your team loves to use.
## Core Methodology: Atomic Design
Atomic Design is a methodology for creating design systems by breaking down interfaces into fundamental building blocks.
### The Five Levels
**1. Atoms**
The smallest, most basic components. They can't be broken down further without losing their meaning.
Examples: Button, Input, Label, Icon, Badge, Spinner
**Characteristics:**
- Single responsibility
- Highly reusable
- No dependencies on other components (except styling)
- Fully self-contained
**Example Atom: Button**
```typescript
interface ButtonProps {
variant?: 'primary' | 'secondary' | 'ghost';
size?: 'sm' | 'md' | 'lg';
disabled?: boolean;
loading?: boolean;
onClick?: () => void;
children: React.ReactNode;
}
export const Button: React.FC<ButtonProps> = ({
variant = 'primary',
size = 'md',
disabled = false,
loading = false,
onClick,
children,
}) => {
return (
<button
className={`button button--${variant} button--${size}`}
disabled={disabled || loading}
onClick={onClick}
>
{loading && <Spinner size="sm" />}
{children}
</button>
);
};
```
**2. Molecules**
Groups of atoms bonded together to form relatively simple functional units.
Examples: Form Input (Label + Input + Error Message), Search Bar (Icon + Input + Button), Card Header (Avatar + Name + Date)
**Characteristics:**
- Composed of atoms
- Serve a specific purpose
- Reusable across the product
- Have a clear interface (props)
**Example Molecule: Form Input**
```typescript
interface FormInputProps {
label: string;
placeholder?: string;
error?: string;
value: string;
onChange: (value: string) => void;
disabled?: boolean;
}
export const FormInput: React.FC<FormInputProps> = ({
label,
placeholder,
error,
value,
onChange,
disabled,
}) => {
return (
<div className="form-input">
<Label>{label}</Label>
<Input
placeholder={placeholder}
value={value}
onChange={(e) => onChange(e.target.value)}
disabled={disabled}
aria-invalid={!!error}
/>
{error && <ErrorMessage>{error}</ErrorMessage>}
</div>
);
};
```
**3. Organisms**
Relatively complex UI sections composed of groups of molecules and/or atoms and/or other organisms.
Examples: Navigation Bar, Form, Card, Modal, Sidebar
**Characteristics:**
- Composed of molecules and atoms
- Serve a specific business purpose
- More complex interfaces
- Often have state management
**Example Organism: Card**
```typescript
interface CardProps {
title: string;
description?: string;
image?: string;
action?: {
label: string;
onClick: () => void;
};
children?: React.ReactNode;
}
export const Card: React.FC<CardProps> = ({
title,
description,
image,
action,
children,
}) => {
return (
<div className="card">
{image && <img src={image} alt={title} className="card-image" />}
<div className="card-content">
<h3 className="card-title">{title}</h3>
{description && <p className="card-description">{description}</p>}
{children}
{action && (
<Button onClick={action.onClick} variant="secondary">
{action.label}
</Button>
)}
</div>
</div>
);
};
```
**4. Templates**
Page-level objects that place components into a layout and articulate the design's underlying content structure.
Examples: Blog Post Template, Product Page Template, Dashboard Template
**Characteristics:**
- Composed of organisms, molecules, and atoms
- Define page structure and layout
- Show how components work together
- Not typically reusable (specific to page type)
**Example Template: Blog Post**
```typescript
export const BlogPostTemplate: React.FC<BlogPostTemplateProps> = ({
title,
author,
date,
image,
content,
relatedPosts,
}) => {
return (
<div className="blog-post-template">
<Header />
<article className="blog-post">
<div className="blog-post-hero">
<img src={image} alt={title} />
</div>
<div className="blog-post-content">
<h1>{title}</h1>
<div className="blog-post-meta">
<Avatar src={author.avatar} alt={author.name} />
<span>{author.name}</span>
<span>{formatDate(date)}</span>
</div>
<div className="blog-post-body">{content}</div>
</div>
</article>
<section className="related-posts">
<h2>Related Posts</h2>
<div className="related-posts-grid">
{relatedPosts.map((post) => (
<Card key={post.id} {...post} />
))}
</div>
</section>
<Footer />
</div>
);
};
```
**5. Pages**
Specific instances of templates that show what the UI looks like with real data.
Examples: Homepage, Product Page, User Profile, Dashboard
**Characteristics:**
- Instances of templates with real data
- Used for testing and demonstration
- Show how components behave with actual content
- Help identify edge cases and issues
## Component Design Principles
### Principle 1: Single Responsibility
Each component should have one clear purpose. If a component does too much, break it down.
**Bad:**
```typescript
// Does too much: rendering, data fetching, form handling, validation
const UserProfile = () => {
const [user, setUser] = useState(null);
const [formData, setFormData] = useState({});
const [errors, setErrors] = useState({});
useEffect(() => {
fetchUser().then(setUser);
}, []);
const handleSubmit = () => {
// validation logic
// submission logic
};
return (
// complex JSX
);
};
```
**Good:**
```typescript
// UserProfile: Orchestrates the page
const UserProfile = () => {
const { user } = useUser();
return (
<>
<UserHeader user={user} />
<UserEditForm user={user} />
<UserActivity user={user} />
</>
);
};
// UserHeader: Displays user info
const UserHeader = ({ user }) => (
<div className="user-header">
<Avatar src={user.avatar} />
<h1>{user.name}</h1>
</div>
);
// UserEditForm: Handles form state and submission
const UserEditForm = ({ user }) => {
// form logic
};
// UserActivity: Displays user activity
const UserActivity = ({ user }) => {
// activity logic
};
```
### Principle 2: Composition Over Inheritance
Build complex components by composing simpler ones, not by inheritance.
**Bad:**
```typescript
// Inheritance approach (avoid)
class Button extends React.Component {}
class PrimaryButton extends Button {}
class LargeButton extends Button {}
class LargePrimaryButton extends Button {}
```
**Good:**
```typescript
// Composition approach (prefer)
const Button = ({ variant = 'primary', size = 'md', ...props }) => (
<button className={`button button--${variant} button--${size}`} {...props} />
);
// Use composition to create variants
const PrimaryButton = (props) => <Button variant="primary" {...props} />;
const LargeButton = (props) => <Button size="lg" {...props} />;
const LargePrimaryButton = (props) => <Button variant="primary" size="lg" {...props} />;
```
### Principle 3: Props Interface Design
Design component props carefully. Props should be:
- **Intuitive** — Props should be self-explanatory
- **Flexible** — Props should support common use cases
- **Constrained** — Props should prevent invalid states
- **Documented** — Props should be clearly documented
**Example: Well-Designed Props**
```typescript
interface ButtonProps {
// Variant and size are constrained to valid options
variant?: 'primary' | 'secondary' | 'ghost' | 'dangRelated 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.