What is a DESIGN.md file?
It is a description of your visual identity written for a coding agent. Google Labs first designed it for its Stitch design tool, then published the specification as open source under the Apache 2.0 licence, in the google-labs-code/design.md GitHub repository, created on 10 April 2026.
The file has two layers. At the top, a YAML block lists the design tokens (colours, typography, corner radii, spacing, components): these are the values that count. Below it, Markdown sections explain why those values exist and how to use them. The specification says it plainly: tokens are normative, prose provides context.
Its status matters. The project README states that the specification, the token schema and the command-line tool are under active development, and that changes should be expected. The @google/design.md package is at version 0.4.0 on npm at the time of writing.
Why a DESIGN.md rather than a link to your documentation?
Because an agent remembers nothing between sessions. Without a file, every prompt has to repeat that it should use the brand colours, keep the layout spacious or reuse existing components. DESIGN.md makes that context persistent: reference it once in the agent’s instructions (AGENTS.md, CLAUDE.md…) and it is read at the start of every session.
It also solves a format problem. Design system documentation is written for people who browse, click and skim. An agent needs exact values and short decision rules. DESIGN.md is that condensed version.
What goes in a DESIGN.md? The ten sections
The specification sets ten sections, all as level-2 headings. You can leave some out, but the ones present must follow this order, and the linter flags a different order.
| No. | Section (exact heading) | What you write | Related tokens |
|---|---|---|---|
| 1 | Overview (or Brand & Style) | The brand personality, the audience, the impression the interface should leave | none |
| 2 | Colors | The role of each palette | colors |
| 3 | Typography | Text levels and how they are used | typography |
| 4 | Layout (or Layout & Spacing) | The grid, margins, rhythm | spacing |
| 5 | Elevation & Depth | How hierarchy is shown: shadows, contrast, rules | none |
| 6 | Shapes | Corners and radii | rounded |
| 7 | Motion & Micro-interaction | What moves, how fast, respect for reduced motion | motion |
| 8 | Voice & Content Strategy | Tone, casing, vocabulary, button and message labels | none |
| 9 | Components | Components, their variants and states | components |
| 10 | Do’s and Don’ts | Rules to follow and mistakes to avoid | none |
Be careful with articles that mention eight sections. That was true until 17 November 2026: on that day, two changes to the repository added Motion & Micro-interaction and Voice & Content Strategy. The zeroheight article published on 26 November still describes the eight-section version.
Keep the headings in English even if you write the rest in another language: the linter and tools recognise sections by name. An unknown section, such as Iconography, is kept without error.
How are DESIGN.md tokens written?
Tokens go either in a YAML front matter at the start of the file, or in YAML code blocks inside each section, or both. One rule: each top-level key (colors, typography…) is defined only once in the whole file, otherwise the file is rejected.
The schema accepts six families:
colors: any CSS colour (hex,rgb(),oklch()…), with at least aprimarycolour;typography: objects withfontFamily,fontSize,fontWeight,lineHeight,letterSpacing;roundedandspacing: dimensions inpx,emorrem;motion: a duration, a delay and an easing curve per purpose (state-change,surface-enter…);components: for each component, properties such asbackgroundColor,textColor,roundedorpadding.
A token can reference another in curly braces: {colors.primary}. States are declared as neighbouring components, for example button-primary and button-primary-hover. Tokens can be grouped, such as light and dark for themes, or sm to xl for breakpoints.
The syntax is inspired by the W3C design tokens format (version 2025.10), without copying it: family names differ (colors versus color) and values are simpler. That is why a small conversion script is enough. The design tokens guide covers the W3C format in detail, and our article what is a design system recaps the basics.
Does DESIGN.md replace design system documentation?
No. DESIGN.md is a map, not a copy. Your documentation remains the full reference; the file gives agents the short version, and can point to the rest with references such as @components/button.html.
Atlassian measured the difference. In an article published on 15 June 2026, its design system team compared four ways of giving an agent context to build a login screen. With DESIGN.md as the only source, the agent used about 92% more model tokens than with their MCP server, took longer, and tended to rebuild components instead of importing the library’s. To fit in one file, their DESIGN.md already weighs 80 KB, about 19,800 model tokens, after removing much of the component usage guidance.
Atlassian notes that these tests are not a research paper. But the conclusion is useful: DESIGN.md mostly helps where the real system is not plugged in. Their article lists four cases: overall art direction, quick prototyping in a new tool, design tools that customise generic components, and theming an interface generated for a customer.
TipIf your agents already have access to your component library or an MCP server, keep DESIGN.md short: direction, decision rules and links. Implementation details are better served by the code and the documentation.
How do you generate a DESIGN.md from your tokens?
By separating what can be computed from what has to be written. Values come from your token files through a script; rules live in a text file you write. The script puts the two together at every design system release.
It is the safest way to avoid the main flaw of a hand-maintained DESIGN.md: it goes wrong as soon as a token changes. An agent that reads a token name renamed three months ago follows it without hesitation, because nothing tells it the file is out of date.
Here is a Node script of about fifty lines, with no dependencies. It reads a tokens.json file in W3C format, follows aliases, flattens groups and writes the YAML front matter; it then appends the text of design-prose.md.
// Writes DESIGN.md: the YAML front matter is generated from tokens.json (W3C format),
// the prose comes from design-prose.md, written by hand.
import { readFileSync, writeFileSync } from 'node:fs';
const tokens = JSON.parse(readFileSync('tokens.json', 'utf8'));
const prose = readFileSync('design-prose.md', 'utf8');
// Finds a token by its path, for example "color.blue.600".
const get = (path) => path.split('.').reduce((node, key) => node[key], tokens);
// Converts a W3C value into a DESIGN.md value, following "{…}" aliases.
function value(v) {
if (typeof v === 'string' && v.startsWith('{')) return value(get(v.slice(1, -1)).$value);
if (v?.hex) return v.hex; // colour
if (v && 'unit' in v) return `${v.value}${v.unit}`; // dimension
if (v?.fontFamily) return { // typography
fontFamily: [].concat(v.fontFamily)[0],
fontSize: value(v.fontSize),
fontWeight: v.fontWeight,
lineHeight: v.lineHeight,
letterSpacing: value(v.letterSpacing),
};
return v;
}
// Flattens a group: { blue: { 600: … } } gives { "blue-600": … }.
function flat(group, prefix = '') {
const out = {};
for (const [key, node] of Object.entries(group)) {
if (key.startsWith('$')) continue;
const name = prefix ? `${prefix}-${key}` : key;
Object.assign(out, '$value' in node ? { [name]: value(node.$value) } : flat(node, name));
}
return out;
}
// Writes an object as simple YAML (two spaces per level).
const yaml = (obj, indent = '') => Object.entries(obj).map(([k, v]) =>
typeof v === 'object'
? `${indent}${k}:\n${yaml(v, indent + ' ')}`
: `${indent}${k}: ${typeof v === 'string' ? JSON.stringify(v) : v}`).join('\n');
const front = {
version: 'alpha',
name: 'My design system',
colors: flat(tokens.color),
typography: flat(tokens.typography),
rounded: flat(tokens.radius),
spacing: flat(tokens.space),
};
writeFileSync('DESIGN.md', `---\n${yaml(front)}\n---\n\n${prose}`);Adapt the four front lines to your group names (color, radius, space are examples). The script assumes two things: your colours carry the hex field (optional in the W3C format, but exported by most tools), and the colour group contains semantic tokens at its top level, including primary, which the linter requires. If your tokens live in Figma, first export the variables in W3C format, or start from the file your build tool already reads, such as Style Dictionary.
Two deliberate choices. The script exports primitive and semantic tokens, but not component tokens: you write those in the Components section, by hand, referencing semantic tokens, because they carry the decisions. And it never touches the prose, which stays entirely under your control.
The annotated DESIGN.md template
Here is the content of design-prose.md, the written part. The headings are those of the specification; the <!-- --> comments say what to write, delete them once filled in.
## Overview
<!-- Two or three sentences. A precise reference beats a list of adjectives:
"a printed architecture review" rather than "modern, clean, premium". -->
## Colors
<!-- One line per role, with the exact token name and the decision it carries. -->
- {colors.primary}: the main action, only one per screen.
- {colors.text}: all body text. Never a lighter grey for text.
## Typography
<!-- Which level for which use, and what you don't do (no bold in body text,
for example). -->
## Layout
<!-- The grid, the maximum width, the spacing scale and when to use it. -->
## Elevation & Depth
<!-- Shadows or no shadows; if none, how hierarchy is shown. -->
## Shapes
<!-- The logic of corners: what is square, what is rounded. -->
## Motion & Micro-interaction
<!-- Durations per purpose, curves, and respect for prefers-reduced-motion. -->
## Voice & Content Strategy
<!-- Formal or informal address, heading case, required and banned words,
the shape of button labels, local typography rules. -->
## Components
<!-- For each component: when to use it, when not to, and where its code lives.
Component tokens are declared here. -->
```yaml
components:
button-primary:
backgroundColor: "{colors.primary}"
textColor: "{colors.on-primary}"
rounded: "{rounded.none}"
padding: "{spacing.md}"
```
- Buttons: `@components/button.html`. Only one primary button per screen.
## Do's and Don'ts
<!-- Observable rules: you should be able to tell whether a mock-up follows them. -->
- Don't create a card just to group a heading and a paragraph.
- Don't use {colors.primary} as a decorative fill on a large surface.Write rules as decisions, not descriptions. “Our primary colour is blue” teaches an agent nothing; “{colors.primary} is used only for the main action” lets it decide. And name tokens by their exact name in the prose, otherwise the agent may invent a value from a description such as “dark grey”.
What goes in DESIGN.md, and what stays in the documentation?
The sorting rule is one question: does this information change a decision the agent will make? If yes, it goes in the file. If not, it stays in the documentation, and the file points to it.
| In DESIGN.md | In the documentation |
|---|---|
| Primitive and semantic token values | The history and detailed reasons for each choice |
| One decision rule per colour role and text level | Full contrast charts and tests |
| When to use each component, and where its code is | Every property, code examples, edge cases |
| Observable don’ts | General principles and the system’s vision |
| Tone and interface writing rules | The full editorial guide |
On length, zeroheight recommends aiming for decision density rather than completeness; the author of their article, Nick Babich, says he gets his best results with a file of about 1,000 lines. Treat that figure as a ceiling, valid when the agent has no other access to the system: with an MCP server or the library at hand, much shorter is enough. Every extra line costs model tokens at every generation and dilutes the rules that matter.
How do you version DESIGN.md with design system releases?
Treat it as a release deliverable, like the component package. In practice, four steps in your continuous integration:
- The generation script runs at every release, from that release’s tokens.
npx @google/design.md lint DESIGN.mdchecks the file: broken references, missing primary colour, component contrast below 4.5:1, sections out of order. The exit code is 1 on error, which blocks the release.npx @google/design.md diffcompares the old and new versions, token by token. It also exits with an error if the new file has more errors or warnings than the old one.- The file carries the design system version number in its
nameordescriptionfield, and the changelog mentions rule changes, not only token changes.
The export command goes the other way: it produces a Tailwind 3 or 4 theme, or a W3C format file, from a DESIGN.md. It is handy for a prototype, but don’t use it as your source: your source is your tokens.
Who approves the rules and who updates the file deserves an explicit decision; that is the subject of our article on DESIGN.md governance. For where the file fits in a wider roadmap, see from UX to AX.
Which tools for writing a DESIGN.md?
Three are enough:
- the official
@google/design.mdtool, with thelint,diff,exportandspeccommands (the last one prints the specification, useful for giving it to an agent); - the DESIGN.md extension for VS Code published by Christian Oliff on 26 November 2026: free, it runs the official linter as you type, completes
{colors.primary}references, shows colour swatches and a preview of the system, and offers its commands in six languages. It is also on Open VSX for Cursor and VSCodium; - Stitch, Google’s tool, which generates a DESIGN.md from a project.
To test safely, pick a small scope: colours, typography and a single component, such as the button. Compare what an agent produces with and without the file, on the same prompt, before going further.
Do’s and don’ts
0 of 8
Frequently asked questions
Google Labs, first for its Stitch design tool. The specification is open source, under the Apache 2.0 licence, and still in alpha.
Ten since 17 November 2026: Overview, Colors, Typography, Layout, Elevation & Depth, Shapes, Motion & Micro-interaction, Voice & Content Strategy, Components, Do’s and Don’ts. All are optional.
AGENTS.md and CLAUDE.md give agents the project’s instructions (commands, code conventions). DESIGN.md describes only the visual language and interface rules. The three work together.
Yes for the prose. Keep section headings and YAML keys in English, because tools recognise them by name.
Sources
- Google Labs, DESIGN.md specification (alpha): https://github.com/google-labs-code/design.md/blob/main/docs/spec.md
- Google Labs, README and command-line tool: https://github.com/google-labs-code/design.md
- Google Labs, PHILOSOPHY.md: https://github.com/google-labs-code/design.md/blob/main/PHILOSOPHY.md
- zeroheight, “DESIGN.md: The missing layer between your design system and AI”, Nick Babich, 26 November 2026: https://zeroheight.com/blog/design-md-the-missing-layer-between-your-design-system-and-ai/
- Atlassian, “Atlassian’s DESIGN.md is here”, 15 June 2026: https://www.atlassian.com/blog/how-we-build/atlassians-design-md-is-here-what-we-learned-testing-portable-design-context-in-practice
- Christian Oliff, “DESIGN.md VS Code Extension”, 26 November 2026: https://christianoliff.com/blog/design-md-vs-code-extension/
- W3C Design Tokens Community Group, format 2025.10: https://www.designtokens.org/tr/2025.10/format/