figma-to-code
Convert Figma designs into production-ready frontend code. Use when someone shares a Figma URL, design screenshot, or exported design tokens and needs React/Vue/HTML components, responsive layouts, or design system code. Trigger words: Figma, design to code, mockup, wireframe, UI implementation, pixel perfect, design handoff, component from design.
What this skill does
# Figma to Code
## Overview
This skill converts Figma designs into production-ready frontend components. It extracts layout structure, spacing, typography, colors, and interactive states from designs and generates clean, responsive code using the team's existing tech stack and design system.
## Instructions
### Getting Design Information
There are three ways to receive design input:
1. **Figma URL** — Extract via Figma REST API:
```bash
curl -s -H "X-Figma-Token: $FIGMA_TOKEN" \
"https://api.figma.com/v1/files/<file_key>/nodes?ids=<node_id>"
```
Parse the JSON response for layout, styles, and component structure.
2. **Screenshot/Image** — Analyze the image visually to identify:
- Layout grid (columns, gutters, margins)
- Component hierarchy (cards, headers, lists, forms)
- Typography scale (headings, body, captions)
- Color palette and spacing patterns
3. **Exported Design Tokens** — Parse JSON/CSS design tokens directly.
### Generating Components
1. **Identify the component tree** — Break the design into a hierarchy:
- Page → Sections → Components → Elements
- Map each to a React/Vue component or HTML section
2. **Extract design tokens:**
- Colors: Map to CSS custom properties or theme variables
- Typography: Font family, size, weight, line-height, letter-spacing
- Spacing: Padding, margin, gap values — normalize to a spacing scale (4px base)
- Border radius, shadows, opacity
3. **Generate the code following these rules:**
- Use semantic HTML (`<nav>`, `<main>`, `<article>`, `<section>`)
- Use CSS Grid or Flexbox for layout — never absolute positioning for flow content
- Make it responsive: mobile-first, use `clamp()` for fluid typography
- Use the team's existing component library if specified (e.g., Tailwind, shadcn/ui, MUI)
- Extract repeated patterns into reusable components
- Add proper ARIA attributes for accessibility
4. **Handle responsive breakpoints:**
- If the design shows multiple viewport sizes, implement all of them
- If only desktop is shown, create sensible mobile breakpoints:
- Stack horizontal layouts vertically below 768px
- Collapse navigation to a hamburger menu
- Adjust font sizes with `clamp()`
5. **Handle interactive states:**
- Hover, focus, active, disabled states
- Loading skeletons where data is dynamic
- Empty states and error states if visible in the design
### Output Structure
Deliver code as individual files:
```
components/
ComponentName/
ComponentName.tsx # Component code
ComponentName.module.css # Styles (or .tailwind if using Tailwind)
index.ts # Re-export
```
## Examples
### Example 1: Pricing Card from Figma Screenshot
**User provides:** Screenshot of a pricing card with three tiers
**Agent output:**
```tsx
// components/PricingCard/PricingCard.tsx
interface PricingCardProps {
name: string;
price: number;
period: "monthly" | "yearly";
features: string[];
highlighted?: boolean;
onSelect: () => void;
}
export function PricingCard({ name, price, period, features, highlighted, onSelect }: PricingCardProps) {
return (
<article className={`${styles.card} ${highlighted ? styles.highlighted : ""}`}>
<h3 className={styles.planName}>{name}</h3>
<div className={styles.price}>
<span className={styles.currency}>$</span>
<span className={styles.amount}>{price}</span>
<span className={styles.period}>/{period === "monthly" ? "mo" : "yr"}</span>
</div>
<ul className={styles.features} role="list">
{features.map((feature) => (
<li key={feature} className={styles.feature}>
<CheckIcon aria-hidden="true" />
{feature}
</li>
))}
</ul>
<button className={styles.cta} onClick={onSelect}>
Get started
</button>
</article>
);
}
```
### Example 2: Dashboard Layout from Figma URL
**User provides:** Figma URL to a dashboard with sidebar navigation, stats cards, and a data table
**Agent extracts from API:**
```
Layout: 240px fixed sidebar + fluid main content
Grid: Stats row (4 columns) + full-width table below
Colors: --bg-primary: #0F172A, --bg-surface: #1E293B, --accent: #3B82F6
Type scale: heading-lg: 24/32 Inter 600, body: 14/20 Inter 400
```
**Agent generates:** Sidebar component, StatsGrid component, DataTable component with responsive collapse behavior, and a shared theme file with extracted design tokens.
## Guidelines
- Always ask which framework/library the team uses before generating code
- Prefer the team's existing design system tokens over hardcoded values
- Don't generate pixel values from designs without normalizing to a consistent scale
- Include alt text placeholders for images and meaningful ARIA labels
- Generate TypeScript interfaces for all component props
- If the design has inconsistent spacing, normalize it and flag the discrepancies
- Test responsive behavior — the design may only show one viewport size
- Never hardcode content strings — make them props or use i18n keys
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.