Aller au contenu principal

What is DESIGN.md?

DESIGN.md est une spécification de format ouvert de Google Labs (google-labs-code/design.md) qui décrit un design system visuel dans un seul fichier texte brut. Il combine des design tokens structurés en YAML — couleurs, typographie, espacements, rayons et règles de composants — avec de la prose Markdown expliquant la hiérarchie, la tonalité et les règles visuelles (Do's and Don'ts), afin que les agents de code IA produisent une interface cohérente au lieu de deviner les styles à chaque prompt.

Why DESIGN.md exists

When you ask an AI coding agent to build a page or add a component, it has no persistent memory of your visual system. Without a shared spec, every prompt drifts into default blues, mismatched radii, and generic spacing. Committing a DESIGN.md file gives both humans and agents one plain-text source of truth that diffs cleanly in git.

YAML design tokens

Machine-readable values in the frontmatter or fenced YAML blocks so agents and exporters use exact numbers rather than approximations.

  • Color roles and hex values (primary, surface, ink, borders, semantic states)
  • Typography families, sizes, weights, and line heights
  • Spacing scale, border radii, elevation shadows, and component props

Markdown guidelines

Structured prose sections that explain when to apply each token and what to avoid—judgment that a flat JSON file cannot carry.

  • Visual hierarchy, grid structure, and responsive density rules
  • Component anatomy, interactive states, and motion pacing
  • Explicit Do's and Don'ts that prevent common AI UI mistakes

Anatomy of a DESIGN.md file

YAML frontmatter (tokens)
---
version: alpha
name: Heritage
colors:
  primary: "#1A1C1E"
  surface: "#FAF9F7"
  tertiary: "#B8422E"
typography:
  display:
    fontFamily: "Newsreader, Georgia, serif"
    fontSize: 40
  body:
    fontFamily: "Inter, sans-serif"
    fontSize: 16
---
Markdown body (rules & rationale)
## Colors

- **Primary (#1A1C1E):** Deep ink for headlines and core body text.
- **Surface (#FAF9F7):** Warm off-white page canvas.
- **Tertiary (#B8422E):** Accent reserved for primary actions and focus rings.

## Do's and Don'ts

- Keep primary buttons to one per viewport section.
- Do not introduce pure #000000 backgrounds or neon gradients.

Standard sections

  1. 1.Overview
  2. 2.Colors
  3. 3.Typography
  4. 4.Layout
  5. 5.Elevation & Depth
  6. 6.Shapes
  7. 7.Motion & Micro-interaction
  8. 8.Voice & Content Strategy
  9. 9.Components
  10. 10.Do's and Don'ts

How DESIGN.md compares to other files

FormatPrimary roleWhat it containsUse when
DESIGN.mdVisual system for AI agents & teamsYAML tokens + Markdown layout, component, and do/don't rulesAgents generate or restyle UI in a repository
AGENTS.md / CLAUDE.mdRepository engineering rulesBuild commands, test conventions, architecture constraintsDirecting agent workflows; point it to DESIGN.md for UI work
DTCG tokens.json / Figma VariablesTool-to-tool token interchangeStructured JSON key-value maps without prose rationaleSyncing Figma with code compilers; pair with DESIGN.md for AI
tailwind.config / globals.cssFramework styling implementationCompiled CSS custom properties and utility configurationShipping styles in production; generate it from DESIGN.md
Read DESIGN.md vs AGENTS.md vs CLAUDE.md

How to start using DESIGN.md

  1. 1

    Pick or extract a DESIGN.md

    Download a hand-reviewed DESIGN.md from the DesignMD Pro directory—free sites require no account—or extract one from a live URL.

  2. 2

    Add it to your repo and validate

    Save the file as DESIGN.md at the repository root and check its YAML syntax, section order, and token references with the validator or CLI.

  3. 3

    Wire it into your AI agent or export code

    Reference DESIGN.md from CLAUDE.md, AGENTS.md, or .cursor/rules, connect the DesignMD Pro MCP server, or convert tokens directly to Tailwind v4, CSS variables, or shadcn/ui.

Compatible AI coding agents

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • OpenAI Codex
  • Kiro
  • Vercel v0
  • Google Stitch
  • Bolt
  • Google Antigravity

Specification & tools

Common questions about DESIGN.md

View all FAQs
Who created the DESIGN.md specification?

Google Labs published the open DESIGN.md specification under the Apache-2.0 license in the google-labs-code/design.md repository, alongside documentation in Google Stitch.

Should the file be named DESIGN.md or design.md?

Use uppercase DESIGN.md at the repository root—the same convention as README.md, AGENTS.md, and CLAUDE.md. People also search for design.md, design-md, or designmd, which all refer to the same specification.

Do Claude Code and Cursor read DESIGN.md automatically?

Not by default. Add a one-line pointer in CLAUDE.md, AGENTS.md, or .cursor/rules telling the agent to read DESIGN.md before creating or editing UI, or run npx designmdpro init to wire those rule files automatically.

Does DESIGN.md replace Figma or Tailwind CSS?

No. DESIGN.md sits between design tools and application code as the agent-readable contract. Keep Figma for visual exploration and export DESIGN.md tokens into CSS variables, Tailwind v4 @theme blocks, or shadcn/ui themes.

How can I check if my DESIGN.md file is valid?

Paste your file into the free DesignMD Pro validator at /validator or run npx designmdpro lint in CI. Both check YAML frontmatter syntax, token references, contrast ratios, and section coverage.