/design-engineering tokens
Raw markdown On GitHubreferences/commands/cmd-tokens.md
Taught in
title: cmd-tokens summary: "/design-engineering tokens [target]" — find the project's design contract (.design or DESIGN.md), resolve precedence, and thread its tokens through the UI; offer to bootstrap one when none exists. tags: [command, design-md, design-file, tokens, build]
Aliases: contract, apply-design-md. Posture: build.
Steps
- Find the contract, nearest first. Walk up from the edited file for a
.design/*.designand resolveextends. Then look forDESIGN.mdat the root, indocs/or indesign/. If both exist, the.designis the contract and DESIGN.md is rationale. In a video project the order isframe.md→design.md→DESIGN.md. - Read using-design-file (or using-design-md) and pov.
- For a
.design, read the normative core before generating anything:agent.instructions→intent→constraints→policy/decisions→tokens→voice→components. - Map the tokens onto the target (CSS variables, a Tailwind theme, or design-system props) and apply them. If
integrations.shadcn.enabledis set, writecss_varsinto the declared CSS file; tokens outrank stale literals. - Precedence when sources disagree: the user's prompt → the contract → this skill → model defaults. Tokens and structured rules are normative; rationale and prose are context.
No contract
Say so, scan the code for the system it already uses, and offer to bootstrap one: the starter in the repo's templates/design-engineering.design, or a DESIGN.md scaffolded per using-design-md. Never invent an untracked system silently.
Output
The token map (token → where it lands), the edits, and any literal you left in place along with the reason.
You may delegate to the design-md-consumer subagent where the host has it.