| name | design-context-extract |
| license | MIT |
| compatibility | Claude Code 2.1.139+. Optional: stitch (official Google Stitch) MCP server. |
| description | Extract design DNA from existing app screenshots or live URLs using Google Stitch. Produces color palettes, typography specs, spacing tokens, and component patterns as design-tokens.json or Tailwind config. Use when auditing an existing design, creating a design system from a live app, or ensuring new pages match an established visual identity. |
| argument-hint | [screenshot-path | url | 'current project'] |
| tags | ["design-context","design-tokens","stitch","extraction","colors","typography","audit","visual-identity"] |
| context | fork |
| version | 1.0.1 |
| author | OrchestKit |
| user-invocable | true |
| complexity | medium |
| persuasion-type | collaborative |
| model | sonnet |
| agent | design-context-extractor |
| allowed-tools | ["Read","Write","Glob","Grep","Bash","WebFetch","AskUserQuestion","TaskCreate","TaskUpdate","TaskList"] |
| skills | ["design-system-tokens","remember","memory"] |
| metadata | {"category":"document-asset-creation","mcp-server":"stitch"} |
| triggers | {"keywords":["extract design","design tokens","color palette","typography","design dna","visual identity","design system from"],"examples":["extract the design tokens from this screenshot","what colors and fonts does this app use","create a design system from this live URL"],"anti-triggers":["implement","build","component","explore","brainstorm"]} |
Design Context Extract
Extract the "Design DNA" from existing applications ā colors, typography, spacing, and component patterns ā and output as structured tokens.
/ork:design-context-extract /tmp/screenshot.png
/ork:design-context-extract https://example.com
/ork:design-context-extract current project
Pipeline
Input (screenshot/URL/project)
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Capture ā Screenshot or fetch HTML/CSS
āāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Extract ā Stitch extract_design_context
ā ā OR multimodal analysis (fallback)
ā ā Colors (hex + oklch) ā
ā ā Typography (families, scale)ā
ā ā Spacing (padding, gaps) ā
ā ā Components (structure) ā
āāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Output ā Choose format:
ā ā design-tokens.json (W3C) ā
ā ā tailwind.config.ts ā
ā ā tokens.css (CSS variables) ā
ā ā Markdown spec ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Step 0: Detect Input and Context
INPUT = ""
TaskCreate(subject="Extract design context: {INPUT}", description="Extract design DNA", activeForm="Extracting design from {INPUT}")
TaskCreate(subject="Detect input type and context", activeForm="Detecting input type")
TaskCreate(subject="Capture source material", activeForm="Capturing source")
TaskCreate(subject="Extract design tokens", activeForm="Extracting tokens")
TaskCreate(subject="Choose output format and generate", activeForm="Generating output")
TaskCreate(subject="Recommend shadcn/ui style", activeForm="Recommending style")
TaskUpdate(taskId="3", addBlockedBy=["2"])
TaskUpdate(taskId="4", addBlockedBy=["3"])
TaskUpdate(taskId="5", addBlockedBy=["4"])
TaskUpdate(taskId="6", addBlockedBy=["5"])
task = TaskGet(taskId="2")
TaskUpdate(taskId="2", status="in_progress")
TaskUpdate(taskId="2", status="completed")
Step 1: Capture Source
For screenshots: Read the image directly (Claude is multimodal). Pasted/attached images are compressed to the same token budget as Read tool images (CC 2.1.97), so both workflows are equally efficient.
Resolution budget (Opus 4.7 / CC 2.1.111+): Max input is 2,576 px on the long edge (~3.75 MP) ā roughly 3Ć Opus 4.6. Dense dashboards, dark-mode UIs, and technical diagrams benefit the most from the higher ceiling; extraction reads tiny labels, spacing ticks, and component boundaries that were previously blurred. Below 1,024 px, don't upscale ā the source bitmap is the ceiling. Resize only when input exceeds 2,576 px.
For URLs:
For current project:
Glob("**/tailwind.config.*")
Glob("**/tokens.css")
Glob("**/*.css")
Glob("**/theme.*")
Step 2: Extract Design Context
If stitch MCP is available:
If stitch MCP is NOT available (fallback):
Extracted data structure:
{
"colors": {
"primary": { "hex": "#3B82F6", "oklch": "oklch(0.62 0.21 255)" },
"secondary": { "hex": "#10B981", "oklch": "oklch(0.69 0.17 163)" },
"background": { "hex": "#FFFFFF" },
"text": { "hex": "#1F2937" },
"muted": { "hex": "#9CA3AF" }
},
"typography": {
"heading": { "family": "Inter", "weight": 700 },
"body": { "family": "Inter", "weight": 400 },
"scale": [12, 14, 16, 18, 24, 30, 36, 48]
},
"spacing": {
"base": 4,
"scale": [4, 8, 12, 16, 24, 32, 48, 64]
},
"components": ["navbar", "hero", "card", "button", "footer"]
}
Step 3: Choose Output Format
AskUserQuestion(questions=[{
"question": "Output format for extracted tokens?",
"header": "Format",
"options": [
{"label": "Tailwind config (Recommended)", "description": "tailwind.config.ts with extracted theme values", "markdown": "```\ntailwind.config.ts\nāāāāāāāāāāāāāāāāāā\nexport default {\n theme: {\n extend: {\n colors: {\n primary: '#0F172A',\n accent: '#3B82F6',\n },\n fontFamily: {\n sans: ['Inter', 'sans-serif'],\n }\n }\n }\n}\n```"},
{"label": "W3C Design Tokens", "description": "design-tokens.json following W3C DTCG spec", "markdown": "```\ndesign-tokens.json\nāāāāāāāāāāāāāāāāāā\n{\n \"$schema\": \"...\",\n \"color\": {\n \"primary\": { \"$value\": \"#0F172A\" },\n \"accent\": { \"$value\": \"#3B82F6\" }\n },\n \"typography\": {\n \"sans\": { \"$value\": \"Inter\" }\n }\n}\n```"},
{"label": "CSS Variables", "description": "tokens.css with CSS custom properties", "markdown": "```\ntokens.css\nāāāāāāāāāā\n:root {\n --color-primary: #0F172A;\n --color-accent: #3B82F6;\n --font-sans: Inter, sans-serif;\n --space-md: 1rem;\n --radius-sm: 4px;\n}\n```"},
{"label": "Markdown spec", "description": "Human-readable design specification document", "markdown": "```\nDESIGN_SPEC.md\nāāāāāāāāāāāāāā\n# Design Tokens\n\n## Colors\n primary #0F172A (slate-900)\n accent #3B82F6 (blue-500)\n\n## Typography\n sans Inter, sans-serif\n mono JetBrains Mono\n\n## Spacing\n md 1rem (16px)\n```"}
],
"multiSelect": false
}])
Step 4: Generate Output
Write the extracted tokens in the chosen format. If the project already has tokens, show a diff of what's new vs existing.
Step 5: Recommend Best-Fit shadcn/ui Style
After extracting design DNA, map the extracted characteristics to the best-fit shadcn/ui v4 style:
radius = extracted["radius"]
density = extracted["spacing"]
elevation = extracted["shadows"]
STYLE_MAP = {
("pill/large", "generous", "layered"): "Luma ā polished, macOS-like",
("medium", "balanced", "subtle"): "Vega ā general purpose",
("medium", "compact", "subtle"): "Nova ā dense dashboards",
("large", "generous", "subtle"): "Maia ā soft, consumer-facing",
("none/sharp", "balanced", "none"): "Lyra ā editorial, dev tools",
("small", "dense", "none"): "Mira ā ultra-dense data",
}
Skip condition: If the user only needs raw tokens (not a shadcn project), skip this step.
Anti-Patterns
- NEVER guess colors without analyzing the actual source ā use precise extraction
- NEVER skip the oklch conversion ā all colors must have oklch equivalents
- NEVER output flat token structures ā use three-tier hierarchy (global/alias/component)
Related Skills
ork:design-to-code ā Full pipeline that uses this as Stage 1
ork:design-system-tokens ā Token architecture and W3C spec compliance
ork:component-search ā Find components that match extracted patterns