AI coding assistants generate better code when they know and understand a project’s design tokens. The difference between an AI generating color: #2563EB and one writing color: var(--color-action-primary) lies in the token documentation. Prompt-ready tokens are prepared so this difference arises systematically.
What AI Tools Expect from Tokens
AI coding assistants process text. They can parse JSON, read TypeScript interfaces, and understand Markdown. What they cannot do: open Figma files, read binary formats, or derive implicit knowledge.
This means tokens must exist as text – ideally in a format readable by both humans and machines. The DTCG format meets this requirement: JSON with clear keys ($value, $type, $description), hierarchical structure, and aliasing references.
Naming Conventions for Machine Readability
Token names are the most important factor for AI usability. Good names describe function, not value. When an AI reads color.action.primary, it immediately understands the context. With color.blue.500, the semantic information is missing.
Rules for prompt-ready token names: functional naming (color.border.subtle not color.gray.200), consistent hierarchy, no abbreviations (background not bg), and clear separators (dots in JSON, hyphens in CSS).
The $description as AI Prompt
The often-neglected $description field in the DTCG format is the key to prompt-readiness. The description becomes an implicit prompt for the AI:
{
"color": {
"action": {
"primary": {
"$value": "{color.green.600}",
"$type": "color",
"$description": "Primary action color. Use for primary buttons, important links, and CTAs. Do not use for decorative elements."
}
}
}
} When an AI has this token file in context, it automatically generates code using var(--color-action-primary) for buttons and knows the hover variant. The description is the interface between design decision and AI-generated code.
Context Files and CLAUDE.md Integration
The token JSON file alone often isn’t enough. A supplementary context file summarizes the key rules: which framework is used, available tokens, naming conventions, available components, and forbidden patterns.
Key Takeaways
- Prompt-ready tokens are named and documented so AI tools can parse and correctly apply them.
- The
$descriptionfield in the DTCG format is the key – it becomes an implicit prompt for the AI. - Functional token names (
color.action.primary) are more machine-readable than value-based ones (color.blue.500). - A CLAUDE.md / .cursorrules file in the repository provides AI tools with necessary project context.
- Token documentation should be generated from the DTCG JSON file – for humans and machines alike.
- Prompt-readiness isn’t AI dependency – the same measures improve developer experience for human developers too.





