← Wiki

DESIGN.md — Design System as Agent Context

Google Labs’ DESIGN.md is a file format for describing a visual identity in a way that coding agents can actually act on. It’s the same pattern as CLAUDE.md and AGENTS.md, but for the design layer: a single file at the root of your repo that the agent reads before generating UI.

The format layers two things on top of each other. YAML front matter holds normative design tokens — colors, typography, spacing, rounded corners, component mappings. Markdown prose explains why those values exist: the mood, the hierarchy, the contrast story, the do’s-and-don’ts. Tokens without rationale leave the agent guessing; rationale without tokens leaves it hallucinating values. DESIGN.md says: put both in the same place, delimited by --- fences, and let the agent choose which layer it needs at each moment.

The two-layer file

---
name: Heritage
colors:
  primary: "#1A1C1E"     # deep ink
  secondary: "#6C7278"   # slate borders/captions
  tertiary: "#B8422E"    # "Boston Clay" — sole interaction color
typography:
  h1: { fontFamily: Public Sans, fontSize: 3rem }
  body-md: { fontFamily: Public Sans, fontSize: 1rem }
components:
  button-primary:
    backgroundColor: "{colors.tertiary}"
    textColor: "{colors.on-tertiary}"
    rounded: "{rounded.sm}"
---

## Colors
The palette is rooted in high-contrast neutrals and a single accent.
- **Tertiary (#B8422E)** — "Boston Clay" — the sole driver for interaction.

Tokens are referenced via {path.to.token}. Sections are optional but must appear in a fixed canonical order (Overview → Colors → Typography → Layout → Elevation → Shapes → Components → Do’s/Don’ts). The version field is currently alpha.

The CLI is the interesting part

What makes DESIGN.md a spec and not just a convention is the tooling that turns it into a structured signal for agents:

This is the same idea as ruff for Python or eslint for JS but applied to a design file that agents author and read. The linter isn’t for humans — it’s the deterministic gate that catches the kinds of mistakes agents systematically make (unresolvable references, bad contrast, out-of-order sections). It’s the harness layer for design, in the sense of harness-engineering-summary.

Why this pattern matters beyond design

DESIGN.md is a data point for a broader trend: agent-readable spec files per concern, each with its own linter. CLAUDE.md for project behavior, AGENTS.md for agent roster, DESIGN.md for visual identity. Each file is both context for the agent and an artifact the agent can update. The linter enforces invariants the agent can’t be trusted to keep on its own. That’s the harness loop at the file-format level: a mistake becomes a lint rule, and the rule compounds.

For our stack this fits right next to solo-factory’s stacks/*.yaml templates and SGR’s schemas-first discipline. Both make a specific claim the agent can lint against; prose alone doesn’t. DESIGN.md is the UI-layer version.

When to adopt it

Currently alpha — the spec will shift, and no large ecosystem has adopted it yet. Worth tracking because the pattern (token + rationale + linter, one file) is what’s durable, not the specific schema.

See Also

Related