DESIGN.md vs DTCG (tokens.json)
W3C DTCG (tokens.json) is a vendor-neutral JSON interchange format for syncing raw design tokens between design tools and compilers; DESIGN.md is a human- and AI-readable Markdown specification that combines DTCG-inspired YAML tokens with written design rationale. Both use {group.token} references, but DTCG optimizes for tool-to-tool interchange while DESIGN.md optimizes for LLM context windows and end-to-end UI generation.
Side-by-side comparison
| Dimension | DESIGN.md | W3C DTCG (tokens.json) |
|---|---|---|
| Standard / origin | Open specification from Google Labs (google-labs-code/design.md, Apache-2.0) | W3C Design Tokens Community Group Format Module |
| File syntax | YAML frontmatter + up to 10 ordered Markdown prose sections | JSON with $value, $type, $description, and $extensions keys |
| Token aliases | Curly-brace dot paths ("{colors.primary}") | Curly-brace dot paths ("{color.primary}") |
| Token density for LLMs | High — concise YAML keys minimize prompt token consumption | Lower — repeated $type and $value wrappers inflate token counts on large palettes |
| Prose rationale & anti-patterns | First-class Markdown sections (Overview, Layout, Elevation, Do's and Don'ts) | Limited to short per-token $description strings; no page-level layout or anti-pattern sections |
| Component specs | Native components map + ## Components prose | Not standardized in the core token format |
| Tool ecosystem | AI coding agents (Claude Code, Cursor, v0, Stitch), designmdpro CLI/MCP/validator | Figma plugins (Tokens Studio), Style Dictionary v4, Terrazzo, Penpot |
What W3C DTCG (tokens.json) owns
The W3C DTCG format exists to eliminate proprietary token lock-in between design software and multi-platform build tools:
- Strict typed schema: every token carries an explicit
$type(color,dimension,fontFamily,cubicBezier,typography, etc.) and$value, plus optional$extensionsfor tool-specific metadata. - Broad compiler support: Style Dictionary v4, Terrazzo, and Tokens Studio read and write DTCG JSON natively, making it the standard wire format between Figma and multi-platform CI pipelines (Web, iOS Swift, Android XML).
{
"color": {
"$type": "color",
"primary": {
"$value": "#5645d4",
"$description": "Primary brand action color"
},
"surface": {
"$value": "#f6f5f4"
}
},
"radius": {
"$type": "dimension",
"md": {
"$value": "8px"
}
}
}What DESIGN.md owns
DESIGN.md borrows DTCG’s {group.token} alias model and adapts it for AI coding agents and human reviewers reading one file:
- Compact YAML frontmatter: drops repetitive
$type/$valueboilerplate so an entire brand’s colors, typography, spacing, radii, motion, and component recipes fit cleanly in an agent’s context window. - System-level visual judgment: dedicated Markdown sections explain surface hierarchy, elevation strategy, responsive density, and explicit Do’s and Don’ts that cannot be expressed in per-token
$descriptionfields. - Built-in validation and web export:
npx designmdpro lintchecks schema,{token}references, and WCAG contrast, while DesignMD Pro exports Tailwind v4, CSS variables, and shadcn/ui directly.
---
version: alpha
name: Product UI
colors:
primary: "#5645d4"
surface: "#f6f5f4"
background: "#ffffff"
text: "#18181b"
rounded:
md: 8px
---
## Do's and Don'ts
- **Do** use `#5645d4` only for primary actions and active indicators.
- **Don't** apply heavy drop shadows to cards; use `#f6f5f4` surfaces with 1px borders.How they work together
If your organization already maintains tokens.json in W3C DTCG format (for example synced from Figma via Tokens Studio):
- Keep
tokens.jsonas the interchange file between Figma and your multi-platform build tools. - Map the semantic token subset (
colors,typography,rounded,spacing,motion) intoDESIGN.mdYAML frontmatter, and maintain the##prose sections (layout hierarchy, component patterns, Do’s and Don’ts) inDESIGN.mdfor AI coding agents. - Validate
DESIGN.mdwithnpx designmdpro lintand diff releases withnpx designmdpro diff.
When to use which
- Use DTCG
tokens.jsonwhen you need strict tool-to-tool interchange across Figma plugins, Style Dictionary, Terrazzo, and native mobile platforms (iOS/Android). - Use
DESIGN.mdwhen you need a single, readable design specification that AI coding agents (Claude Code, Cursor, v0, Stitch) can follow accurately and that compiles directly to web CSS/Tailwind. - Use both in mature multi-platform design systems: DTCG handles machine interchange across design/build tools, while
DESIGN.mdserves as the concise, rationale-rich contract for AI coding agents.
Common mistakes
- Feeding a 2,000-line
tokens.jsondirectly into an AI coding prompt: raw DTCG dumps burn thousands of context tokens on primitive ramps (gray-50throughgray-950) without stating which roles belong on pages or cards. - Expecting
$descriptionstrings to replace system guidelines: per-token descriptions cannot cleanly communicate multi-token relationships (like surface layering, border vs shadow rules, or page rhythm). - Treating
DESIGN.mdas a replacement for native mobile token pipelines:DESIGN.mdis tailored for web and AI-assisted UI generation; if you ship Swift/Kotlin token packages, pair it with DTCG and Style Dictionary.
Frequently Asked Questions
Is DESIGN.md compatible with W3C DTCG?
DESIGN.md is inspired by W3C DTCG’s {group.token} alias syntax, but it is a separate format (YAML frontmatter + Markdown) rather than a strict DTCG JSON file. You can map semantic DTCG tokens directly into DESIGN.md frontmatter while adding the prose sections DTCG does not cover.
Why does DESIGN.md use YAML instead of DTCG JSON?
YAML removes quotes, braces, and repeated $type/$value keys, cutting prompt token usage significantly for AI coding agents while remaining easy for humans to read and diff in git pull requests.
Can DTCG $description fields replace DESIGN.md prose sections?
Not effectively. $description annotates one token at a time, whereas DESIGN.md provides structured sections for overall aesthetic direction, surface elevation, responsive layout, component composition, and explicit Do’s and Don’ts.
Should I convert my existing tokens.json to DESIGN.md?
Keep tokens.json if Figma plugins or Style Dictionary depend on it, and generate or maintain a companion DESIGN.md containing your semantic tokens plus visual guidelines for AI coding agents.
Where can I check the exact DESIGN.md token syntax?
See the Design Tokens Format reference and the DESIGN.md Glossary entry for DTCG.
Next steps
- Design Tokens Format — full reference for
DESIGN.mdYAML token groups and{token}aliases. - DESIGN.md vs Style Dictionary — how
DESIGN.mdcompares with token build pipelines. - DESIGN.md vs Figma Tokens — bridging Figma Variables, Tokens Studio, and
DESIGN.md. - DESIGN.md Glossary — definitions of DTCG, primitive tokens, semantic color roles, and symbol tables.