design-spec-extraction
Extract comprehensive JSON design specifications from visual sources including Figma exports, UI mockups, screenshots, or live website captures. Produces W3C DTCG-compliant output with component trees, suitable for code generation, design documentation, and developer handoff.
What this skill does
# Design Specification Extraction
Extract comprehensive, production-ready JSON design specifications from visual inputs using a 7-pass serial subtask architecture that ensures complete coverage and cross-validation.
## When to Use This Skill
- Extracting design tokens from Figma exports or screenshots
- Converting visual mockups into structured component specifications
- Creating developer handoff documentation from designs
- Generating design system documentation from existing UIs
- Preparing design data for code generation tools
- Analyzing website screenshots for design reverse-engineering
## Output Format
The extraction produces JSON following the W3C Design Tokens Community Group (DTCG) 2025.10 format with extensions:
- **$version**: Schema version
- **$source**: Metadata (type, dimensions, extraction timestamp)
- **tokens**: Design tokens (colors, typography, spacing, sizing, shadows, radii)
- **components**: Hierarchical component tree with bounding boxes
- **accessibility**: WCAG analysis, contrast issues, semantic structure
- **$extensions**: Layout, component catalog, confidence scores
## CRITICAL: File-Based Architecture
**EVERY pass MUST write its output to a JSON file on disk.** This is non-negotiable.
### Directory Structure
Before starting extraction, create the output directory:
```bash
mkdir -p .design-specs/{project-name}
```
### Required File Outputs
| Pass | Output File | Description |
|------|-------------|-------------|
| 1 | `.design-specs/{project}/pass-1-layout.json` | Layout and structure |
| 2 | `.design-specs/{project}/pass-2-colors.json` | Color tokens |
| 3 | `.design-specs/{project}/pass-3-typography.json` | Typography tokens |
| 4 | `.design-specs/{project}/pass-4-components.json` | Component tree |
| 5 | `.design-specs/{project}/pass-5-spacing.json` | Spacing and dimensions |
| 6 | `.design-specs/{project}/pass-6-states.json` | States and accessibility |
| 7 | `.design-specs/{project}/design-spec.json` | **Final consolidated output** |
### Why File-Based?
1. **Persistence**: Each pass result is saved, enabling resumption if interrupted
2. **Debugging**: Intermediate files allow inspection of each extraction phase
3. **Validation**: Each JSON file can be validated independently
4. **Context Passing**: Subtask agents read previous pass files directly
5. **Audit Trail**: Complete record of extraction process
## Multipass Architecture
The extraction uses 7 serial passes. Each pass MUST:
1. Read previous pass JSON files from disk
2. Perform its analysis
3. **WRITE its output to the designated JSON file**
4. Complete before the next pass begins
```
Screenshot Input
|
v
[Pass 1] Source Analysis & Layout -----> pass-1-layout.json
|
v
[Pass 2] Color & Visual Style -----> pass-2-colors.json
|
v
[Pass 3] Typography Analysis -----> pass-3-typography.json
|
v
[Pass 4] Component Detection -----> pass-4-components.json
|
v
[Pass 5] Spacing & Dimensions -----> pass-5-spacing.json
|
v
[Pass 6] States & Accessibility -----> pass-6-states.json
|
v
[Pass 7] Consolidation -----> design-spec.json (FINAL)
```
---
## Pass 1: Source Analysis & Layout Structure
**Objective**: Establish foundational understanding of the design source and spatial organization.
### Subtask Agent Prompt
```
You are Pass 1 of a 7-pass design specification extraction system. Your focus: LAYOUT AND STRUCTURE ONLY.
## CRITICAL REQUIREMENT
You MUST write your output to a JSON file. This is mandatory - do not just return JSON in your response.
OUTPUT FILE: `.design-specs/{project}/pass-1-layout.json`
Use the Write tool to save your analysis as valid JSON to this file.
## Input
- Screenshot: [attached image]
## Your Task
Analyze the screenshot and extract:
### 1. Source Metadata
- Identify source type: Figma export, Sketch export, website screenshot, mockup, or wireframe
- Detect dimensions and estimate device class (mobile/tablet/desktop)
- Note any visible design tool artifacts (rulers, grids, selection boxes)
### 2. Layout Type Detection
Determine the primary layout strategy:
- Single-column centered layout
- Multi-column grid (count columns, estimate gutters)
- Sidebar + main content
- Dashboard/admin layout
- Full-bleed/edge-to-edge
### 3. Region Identification
Map the major layout regions with bounding boxes:
- Header (position, height, sticky?)
- Navigation (type: sidebar, topnav, or none)
- Main content area
- Footer
- Any overlays, modals, or floating elements
### 4. Grid System Analysis
- Identify underlying grid (12-column, 4-column, etc.)
- Measure or estimate gutter width
- Note container max-width if visible
## Output Format
Return JSON:
{
"$schema": "pass-1-layout",
"$source": {
"type": "figma-export|website-screenshot|mockup|...",
"dimensions": { "width": N, "height": N, "aspectRatio": "W:H", "deviceClass": "..." },
"confidence": 0.0-1.0
},
"layout": {
"type": "single-column|multi-column|sidebar|...",
"regions": [
{ "name": "header", "bounds": {"x":0,"y":0,"width":W,"height":H}, "sticky": true|false },
{ "name": "navigation", "type": "sidebar|topnav|none", "bounds": {...} },
{ "name": "main", "bounds": {...} },
{ "name": "footer", "bounds": {...}, "present": true|false }
],
"gridSystem": {
"columns": N,
"gutter": "Npx",
"margin": "Npx",
"maxWidth": "Npx"
}
},
"containers": [
{
"id": "container-N",
"bounds": { "x": N, "y": N, "width": N, "height": N },
"layout": "grid|flex|block",
"parent": "parent-id|null",
"childCount": N
}
],
"sections": [
{
"id": "section-N",
"purpose": "hero|features|testimonials|cta|...",
"bounds": {...}
}
]
}
Use pixel values. Be precise with bounds. Note confidence level for uncertain areas.
## FINAL STEP - MANDATORY
Use the Write tool to save this JSON to: `.design-specs/{project}/pass-1-layout.json`
Do NOT proceed without writing the file. Confirm the file was written successfully.
```
---
## Pass 2: Color & Visual Style Extraction
**Objective**: Extract complete color palette with semantic mappings.
### Subtask Agent Prompt
```
You are Pass 2 of a 7-pass design specification extraction system. Your focus: COLOR EXTRACTION.
## CRITICAL REQUIREMENT
You MUST write your output to a JSON file. This is mandatory - do not just return JSON in your response.
OUTPUT FILE: `.design-specs/{project}/pass-2-colors.json`
First, read the Pass 1 output: `.design-specs/{project}/pass-1-layout.json`
Then use the Write tool to save your analysis as valid JSON.
## Input
- Screenshot: [attached image]
- Layout data from Pass 1: Read from `.design-specs/{project}/pass-1-layout.json`
## Your Task
Extract ALL colors visible in this design:
### 1. Background Colors (by region)
- Page background
- Section/card backgrounds
- Header/footer backgrounds
- Modal/overlay backgrounds
- Input field backgrounds
- Button backgrounds (all variants)
### 2. Foreground Colors (text and icons)
- Primary heading text
- Body text
- Secondary/muted text
- Link text (if distinguishable)
- Icon colors
- Placeholder text
### 3. Border Colors
- Card/container borders
- Input field borders (default, focus, error states if visible)
- Divider/separator colors
### 4. Feedback Colors
- Error/danger indicators
- Success indicators
- Warning indicators
- Info indicators
### 5. Interactive Colors
- Primary action color (main CTA buttons)
- Secondary action color
- Hover states (if visible)
- Focus indicators
### Color Value Extraction
For each color, provide:
- Hex value (best estimate: #RRGGBB)
- Where it appears (semantic context)
- Suggested token name following pattern: color.[category].[variant]
## Output Format
Return JSON:
{
"$schema": "pass-2-colors",
"tokens": {
"colors": {
"primitive": {
"blue": {
"500": { "$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.