/design-engine:design-tokens-and-namingfrom design-engine
Defines, names, maps, and exports primitive, semantic, and component design tokens for color, type, space, radius, elevation, motion, themes, and brands. Use when formalizing a design system, adding themes, or reviewing drifted token sets.
Ships in design-engine. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com.
--blue-2 used as a semantic role.02-color-brand-and-visual-identity/color-system-and-palette (it produces the perceptual ramp
and the WCAG-gated pairs that become this skill's primitive colour tokens).09-…/dark-mode-and-theming; this skill only defines the role names and tiers
it plugs into.09-…/component-library-architecture, which consumes the component-tier tokens defined here.type-scale-and-spacing.md).| Artefact or context | Source | Required? | Why |
|---|---|---|---|
| Approved colour, type, space, radius, elevation, and motion decisions | Upstream design skills | yes | Tokens encode rather than invent decisions |
| Theme, brand, density, and platform axes | Product architecture | yes | Determines semantic remapping boundaries |
| Consumer inventory and export targets | Repositories and platform owners | yes | Prevents unusable or colliding contracts |
mdk for Maduuka) to avoid collisions.Separate the three tiers before naming anything. A token system that conflates them is the structural cause of drift.
color.blue.500, space.4, font.size.300. Components must NEVER reference these directly.color.text.default, color.surface.raised, color.action.primary.bg,
space.inset.md. This is the only tier a theme (dark, brand) re-points. It is the contract.button.primary.bg, card.padding, input.border.focus. They exist so a single
component can be retuned without touching the shared semantic layer.
Each tier references only the tier above it: component → semantic → primitive → literal value.
Never let a component reach past semantic to a primitive — that is the single most common
failure and it silently breaks theming. See references/token-tiers-and-naming.md.Set one naming convention and hold it. Use a consistent, hierarchical
namespace.category.concept.property.variant.state shape (drop segments that don't apply),
lower-kebab or dot-delimited, no abbreviations that aren't in a stated glossary. Decide
plural-vs-singular, and decide your scale unit names (100–900 numeric, or xs…3xl t-shirt)
once. A name must say its tier: a reader should tell a primitive from a semantic token by
the name alone. Banned names: anything that bakes a literal value into a role
(color.text.blue), positional cruft (color.box-2), or a primitive masquerading as a role.
Make semantic tokens the theming seam — never the primitives. Light/dark, each brand, and
each density mode are expressed by re-pointing the semantic layer at different primitives.
Components and their tokens stay byte-identical across themes; only the alias targets change.
This is what lets one component set serve N brands and both modes. For the dark remap, do NOT
invert lightness — dark surfaces want lower chroma and a near-dark grey carrying the brand hue,
accents usually lighten and slightly desaturate; re-run the contrast gate for the dark roles
independently (doctrine colour rule; 02-…/color-system-and-palette workflow). See
examples/semantic-mapping.md.
Encode colour primitives in OKLCH, not hex. Author the ramps in OKLCH (oklch(L C H)):
lightness is perceptual so ramp steps are actually even, hue stays put while you adjust
chroma, and generating a dark variant or a sibling brand is a controlled L/C move rather than
eyeballed hex-twiddling. Carry the hex fallback for legacy, email and Compose targets in the colour object's hex property. This
is the perceptual-uniformity rule from the colour system, carried into the token layer.
Hold every themed semantic pair to the WCAG gate as a token-level invariant. A token set is
a promise that any sanctioned foreground/surface pairing passes: body/small text ≥ 4.5:1,
large text (≥24px or ≥18.66px bold) and meaningful UI/icons/focus ≥ 3:1
(doctrine/references/wcag-2.2-criteria.md, WCAG 1.4.3/1.4.11). Verify the pairs in each
theme — light passing does not imply dark passing. Record the results next to the tokens; a
token that can produce a failing pair is a bug, not a style choice.
Tokenise type, space, radius, elevation, and motion too — not just colour. Type sizes off
a real ratio (≥1.25; doctrine type-scale-and-spacing.md), space as multiples of one unit
(4 or 8px), a small radius set, an elevation set (shadow tokens that also remap for dark,
where elevation reads as lighter surface + lower-chroma shadow), and motion duration/easing
tokens. One rhythm, named once, is what separates "designed" from "assembled."
Choose the export topology, then generate. Single source of truth = the tier'd token file
(JSON in the Design Tokens Community Group's Design Tokens Format Module 2025.10 $value/$type format, a Final Community Group Report rather than a W3C Standard; literal values use that edition's object shapes, listed in references/token-export-formats.md). Transform out to:
CSS custom properties (semantic tokens become :root / [data-theme="dark"] / [data-brand]
vars), a JSON consumed by app code, a Tailwind theme, and native platforms — via Style
Dictionary so all targets derive from one source and cannot drift. See
references/token-export-formats.md and examples/tokens.json.
Document references, not values. The handoff is the semantic role map and the alias graph,
so engineering wires components to roles. A spec that lists hexes per component instead of role
names has already lost the plot. Hand the wired tokens to
09-…/component-library-architecture and 09-…/design-handoff-and-dev-spec.
Treat Apple materials as platform aliases, not primitives. Liquid Glass, vibrancy, system backgrounds, SF Symbols rendering modes, and app icon variants should be named as semantic platform roles with fallbacks. Do not hardcode a fake glass color or shadow token and call it Liquid Glass; the platform material remains owned by the OS.
When seeding semantic colour and type tokens, pull approved values rather than typing them:
python -X utf8 scripts/design_query.py search "<surface> tokens" --domain color and
... --domain typography. For a whole brief, design_query.py design-system --brief <json>
returns one decision per domain, with abstentions listed rather than filled by guesswork.
The query contract (idea adapted from UI UX Pro Max, MIT, commit 09170ee; paraphrased):
Keep one dominant intent per query and 2-5 meaningful terms; if the engine abstains, retry
once with a synonym, then proceed from the references above and say the catalogue abstained.
Never persist an unverified decision: design_query.py persist refuses abstained domains
unless --accept-abstention "<who>: <reason>" is recorded.
| Condition | Action | Wrong-choice failure |
|---|---|---|
| One product and one theme | Keep three tiers but avoid speculative brand/platform aliases | Premature abstraction makes tokens harder to use |
| Dark mode or multiple brands are confirmed | Remap semantic roles; do not fork primitive/component contracts | Theme copies drift and components bypass intent |
| Existing code uses raw values | Inventory usage, define aliases, and migrate incrementally | A big-bang rename breaks consumers and destroys traceability |
| Platform-owned material has no portable equivalent | Use a semantic platform alias with documented fallback | A fake literal token impersonates native behaviour |
Read and search are required across current design files, token sources, and consuming code. Editing
is allowed only when token implementation is requested. Run python -X utf8 scripts/validate_token_example.py <tokens.json> --profile generic on a real pack: it checks aliases, tiers, cycles, the 2025.10 value shapes and every stated contrast ratio. Execution is preferred for schema,
contrast, export, and consumer tests; publishing packages requires separate authority.
Without consumer-code access, produce a proposed contract and migration risks rather than claiming compatibility. Without export or contrast tooling, return source tokens plus the exact unverified checks and block release of generated platform packages.
--blue-500 used as the
button colour), so there is nothing to remap for a theme. The flat palette dumped from a tool,
renamed, and called a token system.color.text.blue, color.box-2,
spacing-thing-3) instead of the role/intent. A role named after a colour can't be re-themed.#000 surfaces, and shadows that
don't remap — instead of a deliberate semantic re-point with re-checked contrast.| Artefact | Consumer | Evidence and acceptance condition |
|---|---|---|
| Three-tier token source and naming contract | Component and theme skills | Primitive, semantic, and component boundaries are machine-readable and documented |
| Theme/brand maps and platform exports | Product repositories | Contrast and schema checks pass for each supported transform or are marked unverified |
| Migration map | Engineering owners | Existing values and aliases have a staged compatibility path |
examples/tokens.json — a complete worked token set for a sample brand: OKLCH primitive ramps,
semantic roles with a light + dark remap, and component tokens, in W3C $value/$type form.examples/semantic-mapping.md — the same system as a readable role-mapping table showing how
one semantic layer re-points across light, dark, and a second brand, with the contrast results.doctrine/design-doctrine.md — Mission §0 (authored over convergent; one strong system beats
five hedged ones) and Anti-Slop Charter §2 (state the choice first; the sourcing-authority
asymmetry rule — token values trace to human colour science, never to an AI tool's defaults).doctrine/references/type-scale-and-spacing.md — the ratio, line-height, weight, and spacing-
unit rules the type/space/radius tokens encode.doctrine/references/wcag-2.2-criteria.md — the 4.5:1 / 3:1 contrast floors enforced as a
per-theme token invariant.references/token-tiers-and-naming.md — the three-tier model and the full naming scheme.references/token-export-formats.md — CSS custom properties, W3C JSON, and Style Dictionary.02-color-brand-and-visual-identity/color-system-and-palette (produces the ramps and
WCAG-gated pairs) and 09-…/dark-mode-and-theming (the dark palette remap craft).$value/$type; Final Community Group Report, not a W3C Standard); OKLCH (CSS Color 4); Amazon Style Dictionary.Use the design-system operating model for source-of-truth, token tiers, transformations, and adoption evidence.
Use ../component-library-architecture/references/design-system-operating-model.md §1 and §7 for the requirements-to-decision trace, semantic-role discipline, and product-first adoption notes from the supplied books.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
design-tokens, theming, design-systems, token-naming, style-dictionary
Other plugins' skills for the same job
npx claudepluginhub peterbamuhigire/chwezi-design-engine --plugin design-engine110 skills in this plugin
/accessibility-wcag-2-2-complianceUse when designing or auditing an interactive UI for WCAG 2.2 AA, keyboard and focus behaviour, accessible names, screen readers, target size, reflow, authentication, or reduced motion. Use inclusive-and-assistive-design for needs beyond the compliance floor./accessible-color-and-contrastUse when verifying or fixing text, UI, focus, border, status, or data colours for contrast and colour-vision accessibility. Unlike color-system-and-palette, this is the focused WCAG/APCA and non-colour-cue gate, not palette creation./advertising-creative-art-directionUse when art-directing advertising or campaign creative - copy and image relationships, poster and cover tests, triplet or cousin campaign systems, big-idea tests across channels, a 7-point effectiveness screen, critique and ad layout specs handed back to the marketing engine. Use art-direction-routes for brand or website directions./ai-agent-uxUse when an AI agent or copilot interface needs status, plans, approvals, uncertainty, interruption, or trust controls across web or mobile. Do not use for formatting a single AI answer; route output structure and citations to ai-output-design./ai-image-generation-art-directionUse when turning an art-direction brief into generated imagery, prompts, negative constraints, reject gates, provenance notes, and post-processing instructions. Use photography-art-direction for sourced photos and visual-product-slop-audit for product-wide review./ai-output-designUse when an AI answer surface needs structure, citations, grounding, editable refinement, or a chat-versus-canvas decision. Do not use for agent autonomy, approvals, or execution status; route those interaction controls to ai-agent-ux.