Get started

How to generate a DESIGN.md (and what it is)

A DESIGN.md tells a coding agent how your product should look and why. Generate one from a real kit and the written rules stay tied to the exact tokens in your code.

Updated August 4, 2026

What a DESIGN.md is

A DESIGN.md sits beside the code and describes the intended design in terms an agent can act on. Coding agents implement UI well, but without art direction they tend to fall back to a neutral house style. The name has since become a small ecosystem: Google Labs open-sourced a DESIGN.md format specification (from the Stitch team, Apache 2.0, still versioned alpha), and it drew tens of thousands of GitHub stars within months. Their spec pairs machine-readable tokens in YAML front matter with human-readable rationale in prose, and ships a CLI that validates files and exports to Tailwind and the W3C design-token format.

That structure, exact values plus written intent in one file, is the same conclusion this guide argues for, and it is worth being precise about what the spec does and does not give you. A format tells you where the tokens and the prose go. It does not produce the design system itself: the tokens still have to come from somewhere, and the motifs, don'ts, and page-structure rules still have to be decided by someone. Catalog sites collect finished DESIGN.md files; the generation approaches below produce one from an actual system, which is the difference between a file that validates and a file that changes what an agent builds.

A DESIGN.md needs more than a color list. Agents also need direction on layout, spacing, component treatment, and the details that distinguish one design from another. A useful brief spends most of its words on those decisions.

What belongs in a DESIGN.md

A complete brief covers the whole system, not just tokens. The DESIGN.md that Identity Forge generates is organized into these sections:

  • Overview: what the design is, who it's for, and the intended feeling in a sentence or two.
  • Colors: the semantic tokens as CSS variables ready to paste into globals.css, in light and dark. Semantic color tokens explained.
  • Typography: the type pairing, scale, tracking and weights, plus a ready Next.js font setup.
  • Layout: spacing base, container width, and composition rules.
  • Elevation & Depth: the shadow system (or a deliberate lack of one).
  • Shapes: corner radii per element (buttons, cards, inputs, badges) and border treatment.
  • Components: how core components should be treated, with a sample.
  • Page Structure & Layout: how to compose whole pages; this is where generic AI output is prevented.
  • Personality & References: the voice and touchstones behind the design.
  • Distinctive Motifs: the signature devices to reproduce; "they define the design as much as the tokens do."
  • Do's & Don'ts: the rules that keep generated UI inside the design's world.
  • Agent Rules: explicit instructions for the coding agent itself.

The motifs and don'ts are the point

Anyone can list five hex codes. What separates a real design system from a recolored template is the written intent: the motifs to reproduce and the mistakes to avoid. Those sections are why a DESIGN.md changes an agent's output where a palette doesn't.

What most DESIGN.md files actually contain

The list above is what a complete brief covers. It is worth knowing how far the published ones fall short of it, because the gap is consistent and it tells you exactly which sections to prioritise if you are writing one by hand.

We sampled 299 DESIGN.md files published across public repositories and directories: real files, written to give agents design guidance. 72 were specifically visual-design files.

Share of files
Colours as raw hex, no semantic role86%
No do's & don'ts of any kind76%
No dark mode definition69%
No distinctive motifs57%
At least one vague adjective doing the work54%
No concrete size value anywhere44%
Mention typography at all83%
What is missing from published DESIGN.md files (n=299).

Set the last two rows against each other and the pattern is unmistakable. Typography is mentioned in 83% of files, and 44% of files never state a single size. These are documents talking about type without saying how big anything is.

The adjective figure explains the rest. "Clean" appears in 39% of these files and "modern" in 36%. Both are words a model satisfies by producing the centre of its training distribution, which is precisely the generic output the file was written to prevent.

A model asked for "clean and modern" produces the average of everything it has seen. So does everyone else's, asked the same thing.

Descriptive versus executable

The single distinction that separates a brief that changes output from one that does not: can a sentence be checked against a rendered screen? If not, it is decoration.

Descriptive: has no effectExecutable: changes output
Spacing"Generous, breathable spacing""Section gap 64px. Card padding 24px. Control padding 8 to 12px."
Type"Clear typographic hierarchy""Weights 400 and 600 only. Hierarchy comes from size and colour, never weight above 600."
Elevation"Subtle, refined depth""Elevation is a surface step plus a 1px border. Never a box-shadow."
Colour"A restrained palette with one accent""The accent appears on primary buttons and active nav state only. Never on text, borders, backgrounds or gradients."
The same intent, written two ways.

Every entry in the right column can be verified by looking at a screen or grepping the code. Every entry in the left column can be satisfied by almost anything, which means it constrains nothing.

Note how much of the right column is a prohibition. Three quarters of published files contain none, and a rule that only says what is permitted leaves everything else permitted, which is most of an interface. If you write one section by hand, write the don'ts.

Writing a don't that holds

Three properties separate a prohibition that lands from one that gets ignored.

WeakStrongWhy
Specific"Avoid overly decorative styling""No gradients, no drop shadows, no decorative borders"A model cannot evaluate "overly"
Checkable"Keep typography restrained""Never use font-weight above 600"One can be grepped; the other cannot
Offers a replacement"Do not use box-shadow""No box-shadow: elevation is a surface step plus a 1px border"Forbidding without replacing leaves the model to invent a substitute
Weak and strong prohibitions.

The third row is the one most often missed. A prohibition with no alternative opens a gap the model fills from the same training distribution you were trying to escape. Every "never X" wants an "instead, Y".

A minimal template

If you are writing one by hand rather than generating it, this is a defensible starting shape. It is short on purpose. A brief nobody can hold in their head competes with the actual task for the model's attention. Roughly 400 lines is a workable ceiling; this skeleton is well under it.

# DESIGN.md

## Overview

A dense internal tool for operations staff who work in it for hours.
Quiet, information-first. Nothing here has to convince anyone of anything.

## Don'ts

- No gradients
- No drop shadows — elevation is a surface step plus a 1px border
- No font-weight above 600
- No colour value outside the tokens in globals.css
- No border-radius above 12px
- No decorative use of the state colours

## Colours

Defined as semantic roles in globals.css, light and dark.
Do not restate values here — read them from that file.

- `--primary` — primary buttons and active nav state ONLY.
  Never on text, borders, backgrounds or gradients.
- `--muted-foreground` — secondary and supporting text only.
- `--border` — structural edges and dividers.
- `--destructive` / `--success` / `--warning` — reserved for state.

## Typography

Family: Inter (variable). Weights 400 and 600 only.
Scale: 12 / 14 / 16 / 20 / 24 / 32 / 48.
Tracking: -0.02em at 32px and above, 0 below, +0.02em on 12px caps.
Hierarchy comes from size and colour, never from weight above 600.

## Spacing & density

Scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64. No other values.
Controls: 8–12px padding. Table rows: 32px. Section gap: 32px.

## Elevation

A surface step plus a 1px `--border`. Never a box-shadow.

## Shapes

Controls 6px. Cards and panels 12px. Nothing above 12px.

## Composition

One primary action per section.
Related controls share a group; unrelated ones are separated by a full step.
Tables are never nested inside cards.

## Motifs

Section headings carry a 2px `--primary` rule on the left edge.
Numeric columns are always tabular-nums and right-aligned.
Empty states are a single line of `--muted-foreground` text, never an illustration.

## Agent rules

Read this file before writing or editing any UI.
Match the nearest existing component in this repo rather than inventing a
new pattern. If no similar component exists, say so before writing one.
A hand-written DESIGN.md skeleton: adapt the values, keep the shape

Two things about that file are worth copying even if you change everything else. The don'ts come second, before anything they might modify, so a model reading top to bottom hits the constraints before the permissions. And the colour section points at globals.css rather than restating values: once a hex exists in two places, one will be updated and the other will not, and the model will confidently use the stale copy.

The last line of the agent rules does more work than its length suggests. "Match the nearest existing component, and if none exists, say so before writing one" converts the agent's most common failure, silently inventing a new pattern, into a question you can answer.

See it backed by a real system

A DESIGN.md is only as good as the system behind it. Below is the free ambient-sage kit: the tokens, fonts, and treatments its DESIGN.md describes, rendered live:

Ambient Sage

Live render

Rendered from the kit's actual tokens, fonts, and treatments

Ambient SageOverview
Search anything⌘K
AS

Analytics

Revenue overview

See revenue and retention trends alongside account health.

Jan 1 to Jan 30, 2026
Overview
Analytics
Reports
Notifications

Active users

15.1k

2,491 new

+5%

MRR

$49.1k

Net of churn

+3%

Retention

89%

28-day window

+2%

NPS

69

1,204 replies

+3

Revenue

Last 12 months

$49.1k +18.2%

12m30d7d
JanFebMarAprMayJunJulAugSepOctNovDec

Acquisition

Goal completion

On track
78%of goal
Organic48%
Direct31%
Referral21%

Recent transactions

Latest activity across your workspace

View all
CustomerStatusDateAmount
AR

Alex Rivera

Founder & CEO

Paid2 min ago$1,999.00
MO

Mira Okonkwo

Head of Product

Pending1 hour ago$39.00
JF

Jonas Feld

Design Lead

Processing3 hours ago$299.00

Typography

Plus Jakarta Sans

Color system

28 semantic roles, light + dark

Agent outputs

DESIGN.md, CSS, Tailwind, shadcn

Ambient Sage. Its DESIGN.md turns exactly this system into instructions your agent follows.

Generate one (three ways)

  1. 1

    CLI: write DESIGN.md + tokens into your repo

    The fastest path. Pick a kit slug from the gallery and apply it; you get a committed DESIGN.md plus a matching tokens file.

    identityforge apply ambient-sage
  2. 2

    MCP: let the agent fetch it

    With the MCP server installed, the agent calls get_design_md(slug) to read the full brief and apply_theme to write it. Install for your tool:

    npx --yes identityforge@latest install --client claude-code
  3. 3

    shadcn: install the tokens the DESIGN.md references

    If you only want the values, the registry item installs the kit's CSS variables directly.

    npx shadcn add https://identityforge.io/r/ambient-sage.json

Identity Forge generates the DESIGN.md and tokens from the same kit, so the prose describes the values in the stylesheet. For how this differs from adapting a DESIGN.md catalog entry by hand, see Identity Forge vs getdesign.md.

Checking that it works

Writing the file and assuming it landed is how teams find the problem three weeks later. Four checks, cheapest first.

  1. 1

    Grep for literal colour values

    If the agent is following semantic roles, there should be no hex outside the token file. This is the fastest possible signal.

    grep -rn --include='*.tsx' --include='*.css' -E '#[0-9a-fA-F]{3,8}\b' src \
      | grep -v 'tokens\|globals.css'
  2. 2

    Grep for the weights you forbade

    Weight is where hierarchy quietly reverts to the default, and it is the earliest sign that a don't is not landing.

    grep -rn --include='*.tsx' -E 'font-(bold|extrabold|black)' src | head -30
  3. 3

    Ask for the same screen twice, in separate sessions

    Cross-session consistency is the real test. If two runs differ meaningfully on spacing, radius or hierarchy, the diff tells you exactly which section of the brief is missing.

  4. 4

    Build one screen in dark mode first

    If dark mode was derived rather than defined, this is where it surfaces: dead shadows, muddy mid-greys, a glaring accent. Far cheaper to find on screen one than on screen twenty.

The first two belong in CI. A check that fails a pull request containing a raw hex value does more for long-term consistency than any amount of prose, which is the same conclusion Salesforce reached with the SLDS linter.

FAQ

What is a DESIGN.md?

A DESIGN.md is a Markdown file in your repo that tells an AI coding agent how the product should look: its intent, color and type systems, layout and spacing rules, component treatments, distinctive motifs, and do's & don'ts. The agent reads it before building UI so its output stays on-brand and consistent.

How do I generate a DESIGN.md?

Apply an Identity Forge kit: identityforge apply <slug> writes a complete DESIGN.md plus the matching tokens into your project. With the MCP server installed, the agent can also fetch it itself via the get_design_md tool.

Is a DESIGN.md just a list of colors?

No. Colors are the easy part. A useful DESIGN.md spends most of its words on layout, spacing, component treatment, distinctive motifs, and do's & don'ts: the places where AI-built UI actually goes generic.

Is there an official DESIGN.md spec?

Google Labs publishes an alpha DESIGN.md specification and validator. Identity Forge generates its brief and tokens from the same design kit, which keeps the written rules tied to the exported values.