DESIGN.md
A format specification and CLI tool for describing visual identity design systems to AI coding agents using YAML tokens and Markdown prose.
At a Glance
About DESIGN.md
DESIGN.md is an open-source format specification that gives AI coding agents a persistent, structured understanding of a design system. It combines machine-readable YAML front matter (design tokens) with human-readable Markdown prose (design rationale), enabling agents to produce consistent UIs with exact color, typography, spacing, and component values. The project ships a CLI (@google/design.md) for linting, diffing, exporting, and inspecting DESIGN.md files, as well as a programmatic TypeScript API. It is published under the Apache License 2.0 by Google Labs.
- YAML + Markdown format — Define design tokens (colors, typography, spacing, rounded, components) in YAML front matter and explain their intent in Markdown sections.
lintcommand — Validate a DESIGN.md file for structural correctness, broken token references, WCAG contrast ratios, and orphaned tokens; outputs structured JSON findings.diffcommand — Compare two DESIGN.md versions to detect token-level changes and prose regressions, with a regression flag for CI pipelines.exportcommand — Convert DESIGN.md tokens to Tailwind theme config or W3C DTCGtokens.jsonformat for interoperability with other toolchains.speccommand — Output the full format specification as Markdown or JSON, useful for injecting spec context directly into agent prompts.- Programmatic API — Import the
lintfunction from@google/design.md/linterin TypeScript/JavaScript projects to integrate validation into custom workflows. - Token references — Use
{path.to.token}syntax to reference tokens within component definitions, keeping the design system DRY and consistent. - Component tokens — Map named components (e.g.,
button-primary) to sub-token properties likebackgroundColor,textColor,rounded, andpadding, including hover/active variants. - WCAG contrast checking — The linter automatically checks
backgroundColor/textColorpairs in components against the WCAG AA minimum contrast ratio of 4.5:1. - W3C Design Token interoperability — Token schema is inspired by the W3C Design Token Format Module, with direct export support for DTCG-compliant
tokens.json.
Community Discussions
Be the first to start a conversation about DESIGN.md
Share your experience with DESIGN.md, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free and open-source under the Apache License 2.0. Use, modify, and distribute freely.
- Full CLI (lint, diff, export, spec commands)
- Programmatic TypeScript/JavaScript API
- YAML + Markdown design system format
- WCAG contrast ratio checking
- Tailwind and DTCG export
Capabilities
Key Features
- YAML front matter design tokens
- Markdown prose design rationale
- CLI lint command with WCAG contrast checking
- CLI diff command for token-level regression detection
- CLI export to Tailwind and DTCG formats
- CLI spec command for agent prompt injection
- Programmatic TypeScript/JavaScript API
- Token reference syntax ({path.to.token})
- Component token definitions with variants
- Seven built-in linting rules
- Structured JSON output for all commands
- Apache License 2.0 open-source
