Skip to main content
reopt Handbook
reopt Handbook
Design Systems for the AI Era

Foundation

Token ArchitectureComponent SpecBuilt-in Accessibility

AI Workflow

Prompt InterfaceDESIGN.md InterfaceAgentic Design Quality ControlWorkflow StrategiesAI-Based Design System EvolutionContext Injection

User Experience

Consistency PatternsInteraction DesignForms and Data Input

Next Interfaces

Agent UI ProtocolsGenerative UISpatial and Multimodal Interfaces

Practice

Execution PlaybookMigration StrategyGovernance and CollaborationCase Studies

Operations

Verification ChecklistUpdate Log
Handbook›Design Systems for the AI Era›Token Architecture
한국어English

Token Architecture

Design tokens that AI agents can reason about and compose correctly.

Key takeaways

  • Layer tokens into raw, semantic, component, and state tiers so agents reason about intent rather than hard-coded values.
  • Name tokens by purpose (color.action.primary.bg) instead of appearance to reduce generated-UI drift.
  • Attach metadata like description, allowedComponents, contrastPair, and deprecated so agents pick the right token.
  • Enforce agent rules: no raw values, prefer semantic over component tokens, and fail loudly instead of inventing names.
  • Verify with schema validation, semantic-to-raw resolution checks, contrast pairs, CSS-variable snapshots, and a CI deprecation report.

Design tokens are the atomic unit of a design system. For AI agents, tokens are also a reasoning interface. If names, layers, and constraints are unclear, generated UI will drift.

Token Layers

LayerPurposeExample
RawPlatform-neutral valuescolor.blue.500, space.4
SemanticProduct meaningcolor.action.primary.bg
ComponentComponent-specific mappingbutton.primary.bg
StateInteraction statebutton.primary.hover.bg

AI-Friendly Naming

Use names that explain intent, not only appearance.

export const tokens = {
  color: {
    action: {
      primary: {
        bg: '{color.brand.600}',
        fg: '{color.white}',
        hoverBg: '{color.brand.700}',
      },
    },
    feedback: {
      danger: {
        bg: '{color.red.50}',
        fg: '{color.red.700}',
      },
    },
  },
}

Token Metadata

Tokens should carry metadata that helps agents choose correctly.

MetadataWhy it matters
descriptionExplains when the token should be used.
categorySeparates layout, color, type, motion, and elevation.
allowedComponentsPrevents accidental use outside intended components.
contrastPairHelps accessibility automation.
deprecatedAllows migration without silent regressions.

Rules for Agents

  1. Never use raw color or spacing values in generated UI.
  2. Prefer semantic tokens over component tokens unless implementing a component itself.
  3. Do not invent token names; fail loudly and request a token addition.
  4. Map every state to an approved token set.
  5. Generate token usage examples alongside token definitions.

Verification

  • Run token schema validation.
  • Check semantic tokens resolve to valid raw tokens.
  • Check contrast pairs for text and interactive states.
  • Snapshot generated CSS variables.
  • Keep a deprecation report in CI.

Related docs

Execution Playbook

The minimum path for launching an AI-first design system quickly.

Governance and Collaboration

Ownership, change management, and quality gates for AI-ready design systems.

Cmd. /raw

Codex Command Master · Toggle raw scrollback mode for easier terminal selection and copying.

Cmd. /color

Claude Code Command Master · Set the current session prompt-bar color.

Cmd. /usage

Codex Command Master · View Codex account token usage and apply available rate-limit resets.

Design Systems for the AI Era

A guide to building design systems that AI agents can understand, verify, and use.

Component Spec

Component schemas that AI can interpret and generate accurately.

On this page

Token LayersAI-Friendly NamingToken MetadataRules for AgentsVerification