---
name: extract-design-md
description: >-
  Use when you need to reverse-engineer an existing site's or codebase's visual
  language into a DESIGN.md (colours, type, components, layout) before
  redesigning it or handing it to another designer or AI agent.
---
# Extract DESIGN.md (condensed)

Source: Google Stitch (https://stitch.withgoogle.com) and https://github.com/google-labs-code/stitch-skills (Apache-2.0).

Read stylesheets, components, Tailwind config and token files directly and describe the intent in language another designer could recreate.

## Phase 1: Discovery
- Read `package.json` (framework, CSS tooling).
- Map global CSS, `:root` properties, `tailwind.config.*`, theme files, component styles.
- Priority of truth: token libraries > theme/Tailwind config > CSS custom properties > scattered component styles.

## Phase 2: Extraction
1. **Atmosphere:** background, whitespace, density, colour temperature, in 1–2 sentences.
2. **Colour roles:** group by function (foundation, accent and interactive, text hierarchy, states). Each gets a descriptive name, hex and role. Merge near-duplicates.
3. **Typography:** families and character; H1–H6 and body with size, weight, tracking, line-height and use.
4. **Components:** buttons, cards, navigation, inputs, plus 1–2 domain-specific ones.
5. **Layout:** max width, grid, breakpoints, spacing unit, alignment, touch targets.
6. **Generation notes:** atmosphere language, colour references, example prompts.

## Phase 3: Write DESIGN.md
YAML frontmatter with at least `name` and a `colors` map, then sections: 1 Visual Theme & Atmosphere, 2 Color Palette & Roles, 3 Typography Rules, 4 Component Stylings, 5 Layout Principles, 6 Design System Notes for Generation.

## Quality checklist
- Every colour has a name, hex and role.
- Full type hierarchy.
- Components include shape, colour, states.
- Layout has max width, grid, breakpoints, spacing.
- Captures intent, not just values.

Use the result as the current-state input for a redesign, or as the locked system other design skills read first.
