DESIGN.md Creator
Reverse-engineer a website's visual design system and produce a fully spec-compliant DESIGN.md file following the google-labs-code/design.md format.
What this produces
A DESIGN.md file with two layers:
- YAML frontmatter — machine-readable design tokens: colors, typography, spacing, rounded corners, components
- Markdown body — human-readable rationale for each design decision, in 8 canonical sections
The output is ready for agents to consume immediately — no post-processing needed.
Step 1: Get the URL
If the user provided a URL via $ARGUMENTS, use it. Otherwise ask:
What website should I reverse-engineer? Provide the URL and I'll generate a DESIGN.md from its visual design.
Optionally, also tell me:
- Where to save the file (default:
DESIGN.md in the current directory)
- Whether this is a dark-mode or light-mode site (I'll detect this automatically if you don't know)
- Any specific components you want captured (buttons, cards, inputs, nav, etc.)
Wait for the URL before proceeding.
Step 2: Fetch and analyze the site
Fetch the page and all significant visual signals:
- Fetch the main URL — use whichever method your agent environment supports:
curl (works in any agent with shell access): curl -sL --max-time 15 -A "Mozilla/5.0" "<URL>" — captures raw HTML including <style> blocks and inline CSS
webfetch tool (if your agent provides it natively): use it directly for cleaner content extraction
- If the initial fetch returns no CSS (JS-heavy SPA), also fetch the page's linked
.css files: extract <link rel="stylesheet" href="..."> URLs from the HTML, resolve each href to an absolute URL using the page's final URL after redirects (e.g., /assets/app.css → https://example.com/assets/app.css, //cdn.example.com/app.css → https://cdn.example.com/app.css), de-duplicate, then curl each one
- Identify key sub-pages — if the site has a component library, style guide, or "About" page, fetch those too (up to 2–3 additional pages) to improve coverage
- Look for existing design system artifacts — check for
/design-tokens.json, /tokens.json, tailwind.config.js, or any design system links in the page source
What to extract from the fetched content:
| Signal |
Where to look |
| Brand colors |
CSS variables (--color-*, --primary, etc.), inline styles, og:image colors, logo |
| Typography |
font-family, font-size, font-weight, line-height, letter-spacing in CSS |
| Spacing scale |
--spacing-*, padding/margin patterns, grid gutter values |
| Corner radii |
border-radius values across buttons, cards, inputs |
| Elevation |
box-shadow, backdrop-filter, z-index layering patterns |
| Component styles |
Button, card, input, nav, badge styles from class names or CSS |
| Design personality |
Logo, imagery, copy tone, overall layout density |
Note: You're inferring from observed CSS/HTML. Be honest about what you can directly observe vs. what you're inferring from visual patterns. Dark-mode sites typically have low-luminance surface colors and high-contrast text; light-mode sites are the inverse. When you can't determine an exact hex value, make a design-coherent choice and note it in the prose.
Step 3: Build the DESIGN.md
Read references/design-md-spec.md for the complete token schema and section rules.
Token extraction rules
Colors — Extract the site's full color role set. At minimum:
primary — main brand/action color
secondary — supporting accent or secondary brand color
neutral / surface — background/surface color
on-primary, on-surface — text colors on those surfaces
- Include semantic colors if detectable:
error, warning, success
- Name tokens semantically (
primary, secondary, tertiary, neutral) or use Material Design role names if the site uses a Material-style palette
Typography — Identify the main type scale. Typically 5–12 levels:
- Display/headline levels (large, impactful headings)
- Body levels (body-lg, body-md, body-sm)
- Label levels (captions, tags, small UI text)
- Include all detectable properties:
fontFamily, fontSize, fontWeight, lineHeight, letterSpacing
- Dimensions must include units:
px, em, or rem
Spacing — Extract the spacing scale. Common pattern: a base unit (4px or 8px) with named steps: xs, sm, md, lg, xl. Also include layout-specific values like gutter, margin, container-max.
Rounded — Extract corner radius values. Name them: sm, DEFAULT, md, lg, xl, full (for pill shapes).
Components — Capture 4–8 key components. For each, include as many valid properties as observed: backgroundColor, textColor, typography (token ref), rounded (token ref), padding, height, width. Use token references like {colors.primary} instead of hardcoded hex values wherever possible. Include hover variants as separate entries (e.g., button-primary-hover).
Sections to write
Write all 8 sections in canonical order. Each section combines YAML tokens (defined in frontmatter) with prose rationale. For sections where tokens aren't applicable (Elevation, Shapes, Do's and Don'ts), write prose only.
Overview — Brand personality, target audience, emotional tone, design style (flat, glassmorphism, neumorphism, material, etc.), key design decisions. 2–4 sentences that give a coherent aesthetic picture.
Colors — Describe the role of each color palette entry. What does each color mean in the design? When is it used? Reference the token names.
Typography — Describe the font strategy: which typefaces, why they were chosen, how the scale is organized, any special treatments (tight tracking on headlines, text-shadow on dark backgrounds, etc.).
Layout — Grid system (fluid, fixed, 12-column?), spacing philosophy (8px grid, dense vs. airy), max-width, container strategy.
Elevation & Depth — How visual hierarchy is communicated: shadows, tonal layers, glassmorphism, borders, z-axis layering. If flat design, describe what replaces shadows.
Shapes — Corner radius philosophy: sharp/technical, soft/organic, fully rounded pills, mixed. Which components use which radius.
Components — Walk through the key component tokens and explain the design rationale for each group (action elements, containers, inputs, typography application).
Do's and Don'ts — 3–5 concrete rules for maintaining design consistency. Things like "always use {colors.primary} for CTAs, never {colors.secondary}" or "never use pure black (#000000) for text — use on-surface".
YAML frontmatter structure
---
name: <Site/Brand Name>
description: <optional one-line brand tagline>
colors:
primary: "#XXXXXX"
...
typography:
headline-lg:
fontFamily: <font>
fontSize: <Npx>
fontWeight: <number>
lineHeight: <1.2 or 24px>
letterSpacing: <-0.02em or 1px>
...
rounded:
sm: <Npx or Nrem>
...
spacing:
base: <Npx>
...
components:
button-primary:
backgroundColor: "{colors.primary}"
...
...
---
Step 4: Validate and save
After generating the content:
Self-check these things before writing the file:
- All token references (
{path.to.token}) resolve to a defined token
- Color values start with
# followed by 6 hex digits
- All dimension values have units (
px, em, rem) — no bare numbers except: font weights, unitless line-height multipliers, and spacing values (which may be unitless ratios or column counts per the spec)
- Section order matches the canonical order (Overview → Colors → Typography → Layout → Elevation & Depth → Shapes → Components → Do's and Don'ts)
- Component properties: canonical keys (
backgroundColor, textColor, typography, rounded, padding, size, height, width) pass the linter silently; unknown keys are accepted by the spec but will produce a linter warning — flag them in the confidence notes
Check for an existing file at the target path before writing:
- If
DESIGN.md (or the user-specified path) already exists, warn the user: "A DESIGN.md already exists at this path. Overwrite, save as DESIGN-<site-name>.md, or cancel?" Wait for their choice before writing.
- If no file exists, proceed directly.
Save the file as DESIGN.md in the current working directory (or the path the user specified).
Tell the user what was generated:
DESIGN.md saved.
Design system: [Name]
Style: [e.g., Glassmorphism / Flat / Material / Custom]
Colors: [N tokens] — [brief palette description]
Typography: [N levels] — [font family names]
Components: [list of captured components]
Confidence notes:
- [Any values that were inferred rather than directly observed]
- [Any sections that had limited CSS data and required design judgment]
Want me to refine any section, add more components, or lint the file with npx @google/design.md lint DESIGN.md?
Recovery
| Situation |
How to handle |
webfetch not available |
Fall back to curl -sL --max-time 15 -A "Mozilla/5.0" "<URL>" — available in any agent with shell access |
| Site blocks fetch (403/429) |
Ask user to paste relevant CSS, screenshot, or describe the design manually |
| JS-heavy SPA with no inline CSS |
Fetch the JS bundle URL if visible; also try fetching linked .css files directly; ask user for computed styles or a screenshot as a last resort |
| Can't determine exact hex values |
Make design-coherent color choices; note them as "inferred" in prose and confidence notes |
| Site uses a known design system (Material, Ant, Chakra, Tailwind UI) |
Note this in the Overview — tokens will align with that system's defaults |
| No typography found |
Default to system fonts (Inter, -apple-system) and note it |
| User wants lint |
Run npx @google/design.md lint DESIGN.md and surface any errors/warnings |
Rules
- Never fabricate specific brand hex values with false certainty — if you inferred a color, say so
- All token cross-references must point to defined tokens — no dangling refs
- Dimensions must always have units (exception: unitless
lineHeight multipliers like 1.5 are valid)
- The YAML frontmatter is normative; prose is explanatory context — don't contradict one with the other
- Output goes in the current working directory as
DESIGN.md unless the user specifies otherwise
- If a section has genuinely no applicable content (e.g., a flat design with no elevation), include it briefly and explain: "This design system uses flat tonal layering rather than shadows — see Colors for the tonal surface stack"
1---2name: ai-assist-design-creator3description: Reverse-engineer a website's visual design system from a URL and produce a fully spec-compliant DESIGN.md file (https://github.com/google-labs-code/design.md). The output includes both machine-readable YAML design tokens (colors, typography, spacing, rounded corners, components) and human-readable markdown rationale sections (Overview, Colors, Typography, Layout, Elevation & Depth, Shapes, Components, Do's and Don'ts). Use this skill whenever the user wants to generate a DESIGN.md, create a design system file from a website, capture a site's visual identity, extract design tokens, build a design spec from a URL, clone a site's look and feel, or scaffold a DESIGN.md from scratch. Also triggers on: 'design system from URL', 'generate DESIGN.md', 'extract colors from site', 'what are this site's design tokens', 'capture design from website'.4---5
6# DESIGN.md Creator
7
8Reverse-engineer a website's visual design system and produce a fully spec-compliant `DESIGN.md` file following the [google-labs-code/design.md](https://github.com/google-labs-code/design.md) format.
9
10## What this produces
11
12A `DESIGN.md` file with two layers:
131. **YAML frontmatter** — machine-readable design tokens: colors, typography, spacing, rounded corners, components
142. **Markdown body** — human-readable rationale for each design decision, in 8 canonical sections
15
16The output is ready for agents to consume immediately — no post-processing needed.
17
18## Step 1: Get the URL
19
20If the user provided a URL via `$ARGUMENTS`, use it. Otherwise ask:
21
22> What website should I reverse-engineer? Provide the URL and I'll generate a DESIGN.md from its visual design.
23>
24> Optionally, also tell me:
25> - Where to save the file (default: `DESIGN.md` in the current directory)
26> - Whether this is a dark-mode or light-mode site (I'll detect this automatically if you don't know)
27> - Any specific components you want captured (buttons, cards, inputs, nav, etc.)
28
29Wait for the URL before proceeding.
30
31## Step 2: Fetch and analyze the site
32
33Fetch the page and all significant visual signals:
34
351. **Fetch the main URL** — use whichever method your agent environment supports:
36 - **`curl`** (works in any agent with shell access): `curl -sL --max-time 15 -A "Mozilla/5.0" "<URL>"` — captures raw HTML including `<style>` blocks and inline CSS
37 - **`webfetch` tool** (if your agent provides it natively): use it directly for cleaner content extraction
38 - If the initial fetch returns no CSS (JS-heavy SPA), also fetch the page's linked `.css` files: extract `<link rel="stylesheet" href="...">` URLs from the HTML, resolve each href to an absolute URL using the page's final URL after redirects (e.g., `/assets/app.css` → `https://example.com/assets/app.css`, `//cdn.example.com/app.css` → `https://cdn.example.com/app.css`), de-duplicate, then `curl` each one
392. **Identify key sub-pages** — if the site has a component library, style guide, or "About" page, fetch those too (up to 2–3 additional pages) to improve coverage
403. **Look for existing design system artifacts** — check for `/design-tokens.json`, `/tokens.json`, `tailwind.config.js`, or any design system links in the page source
41
42What to extract from the fetched content:
43
44| Signal | Where to look |
45|--------|--------------|
46| Brand colors | CSS variables (`--color-*`, `--primary`, etc.), inline styles, og:image colors, logo |
47| Typography | `font-family`, `font-size`, `font-weight`, `line-height`, `letter-spacing` in CSS |
48| Spacing scale | `--spacing-*`, padding/margin patterns, grid gutter values |
49| Corner radii | `border-radius` values across buttons, cards, inputs |
50| Elevation | `box-shadow`, `backdrop-filter`, `z-index` layering patterns |
51| Component styles | Button, card, input, nav, badge styles from class names or CSS |
52| Design personality | Logo, imagery, copy tone, overall layout density |
53
54> **Note:** You're inferring from observed CSS/HTML. Be honest about what you can directly observe vs. what you're inferring from visual patterns. Dark-mode sites typically have low-luminance surface colors and high-contrast text; light-mode sites are the inverse. When you can't determine an exact hex value, make a design-coherent choice and note it in the prose.
55
56## Step 3: Build the DESIGN.md
57
58Read `references/design-md-spec.md` for the complete token schema and section rules.
59
60### Token extraction rules
61
62**Colors** — Extract the site's full color role set. At minimum:
63- `primary` — main brand/action color
64- `secondary` — supporting accent or secondary brand color
65- `neutral` / `surface` — background/surface color
66- `on-primary`, `on-surface` — text colors on those surfaces
67- Include semantic colors if detectable: `error`, `warning`, `success`
68- Name tokens semantically (`primary`, `secondary`, `tertiary`, `neutral`) or use Material Design role names if the site uses a Material-style palette
69
70**Typography** — Identify the main type scale. Typically 5–12 levels:
71- Display/headline levels (large, impactful headings)
72- Body levels (body-lg, body-md, body-sm)
73- Label levels (captions, tags, small UI text)
74- Include all detectable properties: `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, `letterSpacing`
75- Dimensions must include units: `px`, `em`, or `rem`
76
77**Spacing** — Extract the spacing scale. Common pattern: a base unit (4px or 8px) with named steps: `xs`, `sm`, `md`, `lg`, `xl`. Also include layout-specific values like `gutter`, `margin`, `container-max`.
78
79**Rounded** — Extract corner radius values. Name them: `sm`, `DEFAULT`, `md`, `lg`, `xl`, `full` (for pill shapes).
80
81**Components** — Capture 4–8 key components. For each, include as many valid properties as observed: `backgroundColor`, `textColor`, `typography` (token ref), `rounded` (token ref), `padding`, `height`, `width`. Use token references like `{colors.primary}` instead of hardcoded hex values wherever possible. Include hover variants as separate entries (e.g., `button-primary-hover`).
82
83### Sections to write
84
85Write all 8 sections in canonical order. Each section combines YAML tokens (defined in frontmatter) with prose rationale. For sections where tokens aren't applicable (Elevation, Shapes, Do's and Don'ts), write prose only.
86
871. **Overview** — Brand personality, target audience, emotional tone, design style (flat, glassmorphism, neumorphism, material, etc.), key design decisions. 2–4 sentences that give a coherent aesthetic picture.
88
892. **Colors** — Describe the role of each color palette entry. What does each color *mean* in the design? When is it used? Reference the token names.
90
913. **Typography** — Describe the font strategy: which typefaces, why they were chosen, how the scale is organized, any special treatments (tight tracking on headlines, text-shadow on dark backgrounds, etc.).
92
934. **Layout** — Grid system (fluid, fixed, 12-column?), spacing philosophy (8px grid, dense vs. airy), max-width, container strategy.
94
955. **Elevation & Depth** — How visual hierarchy is communicated: shadows, tonal layers, glassmorphism, borders, z-axis layering. If flat design, describe what replaces shadows.
96
976. **Shapes** — Corner radius philosophy: sharp/technical, soft/organic, fully rounded pills, mixed. Which components use which radius.
98
997. **Components** — Walk through the key component tokens and explain the design rationale for each group (action elements, containers, inputs, typography application).
100
1018. **Do's and Don'ts** — 3–5 concrete rules for maintaining design consistency. Things like "always use `{colors.primary}` for CTAs, never `{colors.secondary}`" or "never use pure black (#000000) for text — use `on-surface`".
102
103### YAML frontmatter structure
104
105```yaml
106---
107name: <Site/Brand Name>
108description: <optional one-line brand tagline>
109colors:
110 primary: "#XXXXXX"
111 ...
112typography:
113 headline-lg:
114 fontFamily: <font>
115 fontSize: <Npx>
116 fontWeight: <number>
117 lineHeight: <1.2 or 24px>
118 letterSpacing: <-0.02em or 1px>
119 ...
120rounded:
121 sm: <Npx or Nrem>
122 ...
123spacing:
124 base: <Npx>
125 ...
126components:
127 button-primary:
128 backgroundColor: "{colors.primary}"
129 ...
130 ...
131---
132```
133
134## Step 4: Validate and save
135
136After generating the content:
137
1381. **Self-check** these things before writing the file:
139 - All token references (`{path.to.token}`) resolve to a defined token
140 - Color values start with `#` followed by 6 hex digits
141 - All dimension values have units (`px`, `em`, `rem`) — no bare numbers except: font weights, unitless line-height multipliers, and `spacing` values (which may be unitless ratios or column counts per the spec)
142 - Section order matches the canonical order (Overview → Colors → Typography → Layout → Elevation & Depth → Shapes → Components → Do's and Don'ts)
143 - Component properties: canonical keys (`backgroundColor`, `textColor`, `typography`, `rounded`, `padding`, `size`, `height`, `width`) pass the linter silently; unknown keys are accepted by the spec but will produce a linter warning — flag them in the confidence notes
144
1452. **Check for an existing file** at the target path before writing:
146 - If `DESIGN.md` (or the user-specified path) already exists, warn the user: "A `DESIGN.md` already exists at this path. Overwrite, save as `DESIGN-<site-name>.md`, or cancel?" Wait for their choice before writing.
147 - If no file exists, proceed directly.
148
1493. **Save the file** as `DESIGN.md` in the current working directory (or the path the user specified).
150
1514. **Tell the user** what was generated:
152
153> `DESIGN.md` saved.
154>
155> **Design system:** [Name]
156> **Style:** [e.g., Glassmorphism / Flat / Material / Custom]
157> **Colors:** [N tokens] — [brief palette description]
158> **Typography:** [N levels] — [font family names]
159> **Components:** [list of captured components]
160>
161> **Confidence notes:**
162> - [Any values that were inferred rather than directly observed]
163> - [Any sections that had limited CSS data and required design judgment]
164>
165> Want me to refine any section, add more components, or lint the file with `npx @google/design.md lint DESIGN.md`?
166
167## Recovery
168
169| Situation | How to handle |
170|-----------|--------------|
171| `webfetch` not available | Fall back to `curl -sL --max-time 15 -A "Mozilla/5.0" "<URL>"` — available in any agent with shell access |
172| Site blocks fetch (403/429) | Ask user to paste relevant CSS, screenshot, or describe the design manually |
173| JS-heavy SPA with no inline CSS | Fetch the JS bundle URL if visible; also try fetching linked `.css` files directly; ask user for computed styles or a screenshot as a last resort |
174| Can't determine exact hex values | Make design-coherent color choices; note them as "inferred" in prose and confidence notes |
175| Site uses a known design system (Material, Ant, Chakra, Tailwind UI) | Note this in the Overview — tokens will align with that system's defaults |
176| No typography found | Default to system fonts (Inter, -apple-system) and note it |
177| User wants lint | Run `npx @google/design.md lint DESIGN.md` and surface any errors/warnings |
178
179## Rules
180
181- Never fabricate specific brand hex values with false certainty — if you inferred a color, say so
182- All token cross-references must point to defined tokens — no dangling refs
183- Dimensions must always have units (exception: unitless `lineHeight` multipliers like `1.5` are valid)
184- The YAML frontmatter is normative; prose is explanatory context — don't contradict one with the other
185- Output goes in the current working directory as `DESIGN.md` unless the user specifies otherwise
186- If a section has genuinely no applicable content (e.g., a flat design with no elevation), include it briefly and explain: "This design system uses flat tonal layering rather than shadows — see Colors for the tonal surface stack"