Six steps, one diagram each. Layer your tokens, name them by intent, author the W3C format, generate from a single source, write docs an agent can actually read, and lock it in CI. The end state: Cursor, Claude Code, and v0 reach for the right token and the right component instead of inventing color="dark-blue-2".
Steps
06
Diagrams
06
Topics
Tokens · Names · Docs
Read time
~12m
Why structure, not tooling
Modern coding agents generate good UI. Where they fall down is integration: they can't reach for var(--color-action-primary) if that token has no machine-readable name, no type, and no description — so they invent a hex value, and your system drifts one generation at a time.
Fixing that is structural work on the design-system side, and it splits into three jobs: tokens an agent can parse, names it can reason about, and docs it can read. The six steps below walk all three in build order, with a diagram for each. Each one is independently shippable — you don't have to do all six this week to get value from the first.
An agent can only pick a good token if the layer it reaches for is named by intent. Split your tokens into three layers and make the semantic layer the one components consume. Primitives hold raw values; semantics hold meaning; component tokens are an optional per-surface override.
Do this
A name is the contract an agent reads before it picks a token. color.blue.500 forces a guess between three blues; color.action.primary states the intent outright. Use a predictable axis — category, concept, role, state — so an agent can compose a name it has never seen and be right.
Do this
The axis, applied
color.action.primary /* category.concept.role */ color.action.primary.hover /* …+ state */ color.feedback.danger /* destructive intent */ space.inset.md /* category.concept.role */ radius.control.sm /* per-role, not per-pixel */
The W3C format ships three fields every modern token tool reads: $value, $type, and $description. The first two are mechanical. The third — $description — is the one that makes a design system AI-ready: it tells the agent when to use this token instead of a look-alike.
Do this
tokens.json (W3C-compliant)
{
"color": {
"action": {
"primary": {
"$value": "{color.blue.600}",
"$type": "color",
"$description": "Primary brand action. Buttons, primary CTAs, key nav."
}
},
"blue": { "600": { "$value": "#2563eb", "$type": "color" } }
}
}Hand-maintained CSS variables and a separate TypeScript export drift apart within a sprint — and an agent can't tell which is authoritative. Keep tokens.json as the single source of truth and generate every consumable artifact from it.
Do this
Agents read files in the repo. They cannot read your Figma, your Storybook screenshots, or your Notion. Put the docs an agent needs as plain text where it will look: an llms.txt entry map, a README in the tokens folder, and MDX component docs with runnable code.
Do this
llms.txt (excerpt)
# Acme Design System > Tokens, components, and patterns for Acme products. ## Tokens - tokens/tokens.json: W3C source of truth (primitive + semantic) - tokens/README.md: layering + category meanings ## Components - components/*/*.mdx: typed usage + runnable code samples ## Rules - Never hardcode hex. Use var(--color-action-*) etc.
Static files get an agent 80% of the way. An MCP server gets the last 20% — the agent queries your live token and component catalog at edit time instead of guessing. Then a CI lint rule makes the structure permanent: no future PR can reintroduce the drift you just removed.
Do this
Block regressions in CI
// stylelint: forbid raw hex in components
"color-no-hex": true
// or grep gate in CI
! grep -rEn "#[0-9a-fA-F]{6}" src/components && echo "clean"Recap
Pin this. If a fresh agent session can satisfy all six, your system is genuinely AI-ready — and you can prove it against the field on the Agent-Ready Index.
Go deeper
This is the map. The pillar pages are the territory — the token shape in full, the MCP server reference implementation, and the component contracts that survive a 50-message refactor. Start with tokens, or generate a W3C-spec set right now.