Design Reverse Engineer
Extract a design system from any URL and produce a reusable spec file for your project.
When to use
- Starting a new view/component and want to anchor it in proven design rather than generic output
- User points at a site and says "make it look like this"
- Refreshing an existing view — need a reference to measure against
- Exploring what works before writing any code
When NOT to use
- You already have a design direction — don't reverse-engineer on a whim
- The target site is login-gated and you don't have credentials (capture screenshots via
/webapp-testing instead)
- The target uses heavy runtime JS that WebFetch can't see through (use Playwright ultra-mode instead)
- Simple one-off style tweaks — use
/frontend-design token lookup directly
Workflow
Step 1 — Fetch the URL
Two modes depending on complexity:
Standard mode (WebFetch): Good for static/SSR sites with CSS in <style> blocks or linked sheets.
WebFetch url="<target>" prompt="Extract all CSS custom properties, font stacks, color values, spacing patterns, and component class names visible in the HTML."
Follow up with:
WebFetch url="<target>/about" or "/pricing" prompt="Same extraction — compare component variation."
Ultra mode (Playwright via /webapp-testing): Required when you need hover states, focus rings, animated transitions, or sites with heavy client-side rendering.
Steps for ultra mode:
- Open target in Chrome via
mcp__chrome-devtools__navigate_page
mcp__chrome-devtools__take_screenshot — initial state
mcp__chrome-devtools__hover over key interactive elements (buttons, nav, cards)
- Screenshot after each hover
mcp__chrome-devtools__evaluate_script to dump getComputedStyle for target elements:const el = document.querySelector('.btn-primary');
const s = getComputedStyle(el);
JSON.stringify({ bg: s.backgroundColor, color: s.color, radius: s.borderRadius, font: s.fontFamily });
- Dump all CSS custom properties from
:root:const props = {};
for (const sheet of document.styleSheets) {
try {
for (const rule of sheet.cssRules) {
if (rule.selectorText === ':root') {
for (const prop of rule.style) props[prop] = rule.style.getPropertyValue(prop).trim();
}
}
} catch(e) {}
}
JSON.stringify(props, null, 2);
Step 2 — Extract design tokens
Identify and record:
| Token category |
What to capture |
| Typography |
Font family names, weights used, size scale (px or rem), line-height values, letter-spacing |
| Colors |
Background palette (surface/elevated hierarchy), text hierarchy (primary/secondary/muted), accent/action color, semantic colors (error/warning/success), border colors |
| Spacing |
Base unit (4px? 8px?), common padding/margin values, gap between grid items |
| Radius |
Button radius, card radius, input radius, badge radius |
| Shadows |
Elevation levels used, exact box-shadow values |
| Animation |
Transition durations, easing functions, keyframe patterns |
Step 3 — Identify component patterns
For each major component type found:
- Buttons: background, border, text color, radius, hover delta, focus ring, disabled state
- Cards: background, border, shadow, padding, radius, hover lift or highlight
- Tables: header background, row hover, border style (full grid vs horizontal-only), cell padding
- Badges/Tags: background, text, radius, variants (success/warning/error)
- Forms/Inputs: border, focus ring, placeholder color, error state
- Empty states: illustration vs text-only, CTA placement
- Loading states: skeleton vs spinner vs shimmer pattern
- Modals/Dialogs: backdrop, surface, padding, header treatment
Step 4 — Capture micro-interactions (ultra mode only)
Document:
- Hover: background delta, transform (lift? scale?), transition duration
- Focus: ring color, ring offset, outline vs box-shadow approach
- Active/pressed: scale-down, brightness change
- Disabled: opacity level, cursor
- Loading: spinner position, text swap, skeleton pattern
Step 5 — Write the spec
Save to .claude/design-references/<slug>.md (create dir if needed).
Slug = kebab-case site name, e.g. linear-app.md, stripe-dashboard.md.
Output format
The spec file this skill produces:
# <Site Name> Design Reference
Source: <url>
Captured: <YYYY-MM-DD>
Mode: WebFetch | Playwright ultra
## Typography
- Display: <font, weight, size>
- Body: <font, size, line-height>
- Mono/Code: <font>
- Scale: <list of sizes used>
## Color palette
| Token | Value | Usage |
|-------------|---------|---------------------------|
| bg-app | #... | Page background |
| bg-surface | #... | Card/panel backgrounds |
| bg-elevated | #... | Hover states |
| text-primary| #... | Main content |
| text-muted | #... | Labels, timestamps |
| accent | #... | CTAs, active states |
| border | #... | Standard borders |
## Spacing
Base unit: 4px / 8px.
Common values: 4, 8, 12, 16, 24, 32, 48, 64 (in px).
Grid columns: N, gap: Xpx.
## Radius
| Element | Value |
|---------|-------|
| Button | ... |
| Card | ... |
| Input | ... |
| Badge | ... |
## Components
### Button
- Default: background `#...`, text `#...`, radius `...`
- Hover: background delta `...`, transition `...ms ease`
- Focus: ring `...`
- Disabled: opacity `...`
- (Copy any exposed CSS verbatim here)
### Card
...
### Table
...
### Badge / Tag
...
## Micro-interactions (Playwright ultra only)
| Interaction | Element | Duration | Easing | Effect |
|-------------|---------|----------|--------|--------|
| hover | .btn | 150ms | ease | bg lighten 10% |
| ... | ... | ... | ... | ... |
## What makes this design work
(2-4 sentences: the design philosophy, what creates the cohesion, what's distinctive)
## How to apply this reference
(Which views or components this reference informs, and what specific patterns to borrow)
- Data table → ...
- Info modal → ...
- Form inputs → ...
Practical tips
- Prioritize CSS custom properties — sites that use them expose the entire token system in one
getComputedStyle dump
- Capture dark mode separately —
prefers-color-scheme: dark may reveal a different palette; toggle via mcp__chrome-devtools__evaluate_script: document.documentElement.setAttribute('data-theme', 'dark')
- Font stack gotchas —
getComputedStyle returns the resolved font, not the CSS declaration. Check <link rel=stylesheet> for Google Fonts or @font-face declarations
- Spacing rhythm — look at the inspector's computed margin/padding on a few sibling elements; if they're multiples of 4 or 8 it confirms the base unit
- Don't copy brand colors — extract the palette structure (how many neutrals, how the accent is used) rather than the exact hex values
Cross-reference
/design-showcase — turn a reference into variant mockups for side-by-side comparison
/frontend-design — your project's design system tokens; map extracted tokens to your equivalents
/webapp-testing — Playwright infrastructure for ultra-mode capture
reference-sites.md (this directory) — curated list of high-quality design references by domain
1---2name: design-reverse-engineer3description: Reverse-engineer a design system from a given URL — typography, color palette, spacing, component patterns, micro-interactions — and produce a Claude-ready design spec that can guide future UI work. Use when building a new view and you want to anchor it in a proven design system rather than generic AI output.4---56# Design Reverse Engineer78Extract a design system from any URL and produce a reusable spec file for your project.910## When to use1112- Starting a new view/component and want to anchor it in proven design rather than generic output13- User points at a site and says "make it look like this"14- Refreshing an existing view — need a reference to measure against15- Exploring what works before writing any code1617## When NOT to use1819- You already have a design direction — don't reverse-engineer on a whim20- The target site is login-gated and you don't have credentials (capture screenshots via `/webapp-testing` instead)21- The target uses heavy runtime JS that WebFetch can't see through (use Playwright ultra-mode instead)22- Simple one-off style tweaks — use `/frontend-design` token lookup directly2324---2526## Workflow2728### Step 1 — Fetch the URL2930Two modes depending on complexity:3132**Standard mode (WebFetch)**: Good for static/SSR sites with CSS in `<style>` blocks or linked sheets.33```34WebFetch url="<target>" prompt="Extract all CSS custom properties, font stacks, color values, spacing patterns, and component class names visible in the HTML."35```36Follow up with:37```38WebFetch url="<target>/about" or "/pricing" prompt="Same extraction — compare component variation."39```4041**Ultra mode (Playwright via `/webapp-testing`)**: Required when you need hover states, focus rings, animated transitions, or sites with heavy client-side rendering.4243Steps for ultra mode:441. Open target in Chrome via `mcp__chrome-devtools__navigate_page`452. `mcp__chrome-devtools__take_screenshot` — initial state463. `mcp__chrome-devtools__hover` over key interactive elements (buttons, nav, cards)474. Screenshot after each hover485. `mcp__chrome-devtools__evaluate_script` to dump `getComputedStyle` for target elements:49 ```js50 const el = document.querySelector('.btn-primary');51 const s = getComputedStyle(el);52 JSON.stringify({ bg: s.backgroundColor, color: s.color, radius: s.borderRadius, font: s.fontFamily });53 ```546. Dump all CSS custom properties from `:root`:55 ```js56 const props = {};57 for (const sheet of document.styleSheets) {58 try {59 for (const rule of sheet.cssRules) {60 if (rule.selectorText === ':root') {61 for (const prop of rule.style) props[prop] = rule.style.getPropertyValue(prop).trim();62 }63 }64 } catch(e) {}65 }66 JSON.stringify(props, null, 2);67 ```6869### Step 2 — Extract design tokens7071Identify and record:7273| Token category | What to capture |74|----------------|----------------|75| **Typography** | Font family names, weights used, size scale (px or rem), line-height values, letter-spacing |76| **Colors** | Background palette (surface/elevated hierarchy), text hierarchy (primary/secondary/muted), accent/action color, semantic colors (error/warning/success), border colors |77| **Spacing** | Base unit (4px? 8px?), common padding/margin values, gap between grid items |78| **Radius** | Button radius, card radius, input radius, badge radius |79| **Shadows** | Elevation levels used, exact `box-shadow` values |80| **Animation** | Transition durations, easing functions, keyframe patterns |8182### Step 3 — Identify component patterns8384For each major component type found:85- **Buttons**: background, border, text color, radius, hover delta, focus ring, disabled state86- **Cards**: background, border, shadow, padding, radius, hover lift or highlight87- **Tables**: header background, row hover, border style (full grid vs horizontal-only), cell padding88- **Badges/Tags**: background, text, radius, variants (success/warning/error)89- **Forms/Inputs**: border, focus ring, placeholder color, error state90- **Empty states**: illustration vs text-only, CTA placement91- **Loading states**: skeleton vs spinner vs shimmer pattern92- **Modals/Dialogs**: backdrop, surface, padding, header treatment9394### Step 4 — Capture micro-interactions (ultra mode only)9596Document:97- Hover: background delta, transform (lift? scale?), transition duration98- Focus: ring color, ring offset, outline vs box-shadow approach99- Active/pressed: scale-down, brightness change100- Disabled: opacity level, cursor101- Loading: spinner position, text swap, skeleton pattern102103### Step 5 — Write the spec104105Save to `.claude/design-references/<slug>.md` (create dir if needed).106Slug = kebab-case site name, e.g. `linear-app.md`, `stripe-dashboard.md`.107108---109110## Output format111112The spec file this skill produces:113114```markdown115# <Site Name> Design Reference116117Source: <url>118Captured: <YYYY-MM-DD>119Mode: WebFetch | Playwright ultra120121## Typography122- Display: <font, weight, size>123- Body: <font, size, line-height>124- Mono/Code: <font>125- Scale: <list of sizes used>126127## Color palette128129| Token | Value | Usage |130|-------------|---------|---------------------------|131| bg-app | #... | Page background |132| bg-surface | #... | Card/panel backgrounds |133| bg-elevated | #... | Hover states |134| text-primary| #... | Main content |135| text-muted | #... | Labels, timestamps |136| accent | #... | CTAs, active states |137| border | #... | Standard borders |138139## Spacing140141Base unit: 4px / 8px.142Common values: 4, 8, 12, 16, 24, 32, 48, 64 (in px).143Grid columns: N, gap: Xpx.144145## Radius146147| Element | Value |148|---------|-------|149| Button | ... |150| Card | ... |151| Input | ... |152| Badge | ... |153154## Components155156### Button157- Default: background `#...`, text `#...`, radius `...`158- Hover: background delta `...`, transition `...ms ease`159- Focus: ring `...`160- Disabled: opacity `...`161- (Copy any exposed CSS verbatim here)162163### Card164...165166### Table167...168169### Badge / Tag170...171172## Micro-interactions (Playwright ultra only)173174| Interaction | Element | Duration | Easing | Effect |175|-------------|---------|----------|--------|--------|176| hover | .btn | 150ms | ease | bg lighten 10% |177| ... | ... | ... | ... | ... |178179## What makes this design work180181(2-4 sentences: the design philosophy, what creates the cohesion, what's distinctive)182183## How to apply this reference184185(Which views or components this reference informs, and what specific patterns to borrow)186- Data table → ...187- Info modal → ...188- Form inputs → ...189```190191---192193## Practical tips194195- **Prioritize CSS custom properties** — sites that use them expose the entire token system in one `getComputedStyle` dump196- **Capture dark mode separately** — `prefers-color-scheme: dark` may reveal a different palette; toggle via `mcp__chrome-devtools__evaluate_script`: `document.documentElement.setAttribute('data-theme', 'dark')`197- **Font stack gotchas** — `getComputedStyle` returns the resolved font, not the CSS declaration. Check `<link rel=stylesheet>` for Google Fonts or `@font-face` declarations198- **Spacing rhythm** — look at the inspector's computed margin/padding on a few sibling elements; if they're multiples of 4 or 8 it confirms the base unit199- **Don't copy brand colors** — extract the *palette structure* (how many neutrals, how the accent is used) rather than the exact hex values200201---202203## Cross-reference204205- `/design-showcase` — turn a reference into variant mockups for side-by-side comparison206- `/frontend-design` — your project's design system tokens; map extracted tokens to your equivalents207- `/webapp-testing` — Playwright infrastructure for ultra-mode capture208- `reference-sites.md` (this directory) — curated list of high-quality design references by domain