Design Language
Build a visual grammar that explains repeated decisions. Do not confuse a palette with a system.
Workflow
- Inspect existing tokens, components, styles, typography, assets, screen patterns, brand materials, and platform conventions.
- Inventory inconsistencies and preserve intentional product signatures.
- If no visual target exists for greenfield work, stop and route to
prototype-interface for exactly three image-based directions and user selection.
- Define principles tied to audience, content, density, interaction, and brand character.
- Create primitive and semantic tokens for color, typography, space, size, radius, border, elevation, motion, and breakpoints as applicable.
- Define component anatomy, variants, states, content constraints, keyboard behavior, accessibility, and responsive adaptation.
- Map tokens and components to the target stack. Avoid parallel sources of truth.
- Validate representative screens, edge states, contrast, focus, zoom, localization, and theme behavior.
Token policy
Use the stable Design Tokens Community Group JSON format for new portable token sources when compatible with the toolchain. Prefer semantic names such as color.text.muted over presentation names such as gray.500 in component contracts. References must resolve without cycles.
DTCG conformance gate
Target the stable DTCG 2025.10 format and declare "$schema": "https://www.designtokens.org/schemas/2025.10/format.json" when producing token JSON.
- Every token must have a resolved
$type; do not infer type from its value.
- A
color value is a structured object with colorSpace and components, not a bare hex string.
- A
dimension value is { "value": number, "unit": "px" | "rem" }.
- A
duration value is { "value": number, "unit": "ms" | "s" }, not a number or CSS string.
- Put project metadata under a reverse-domain key inside
$extensions, not as ad hoc token properties.
- Run a schema validator when available. Otherwise run and preserve a deterministic structural checker for the types used, clearly label its coverage as partial, and do not claim full schema conformance.
Extension gate
Classify every proposed primitive as inherited, derived, or new.
- Reuse inherited product primitives before adding colors, radii, shadows, typefaces, or motion.
- A derived token must name its source primitive and transformation.
- A new primitive needs a semantic gap that existing tokens cannot fill, a named consumer, interaction-state coverage, and measured accessibility evidence.
- Do not invent hover, active, success, or warning values merely to make the table look complete. If a needed value is unverified, mark it unresolved instead of presenting it as system truth.
- Separate frozen product truth from proposals. When the source context does not specify a spacing scale, type ramp, control height, breakpoint, or motion value, mark the token
proposed or unresolved in metadata instead of calling it canonical.
Contrast gate
Calculate contrast from the exact rendered foreground and background values. Do not claim a pair passes from visual intuition.
- Normal text under 18pt, or under 14pt bold, requires at least 4.5:1.
- Large text requires at least 3:1.
- Keep units explicit: 14pt bold is about 18.66 CSS px at 96 dpi. Bold text at 14 CSS px is normal text and requires 4.5:1.
- Focus indicators and meaningful non-text UI boundaries require at least 3:1 against adjacent colors.
- Report the tested pair, role, ratio, threshold, and result. If a pair fails, select a verified existing token or leave the design state unresolved.
Run an existing contrast tool or a small deterministic checker. Preserve the exact command and captured stdout or machine-readable result in the evidence packet. The acceptance check must cover every selected semantic foreground/background assignment and exit successfully. Record deliberately tested failing inherited pairs in a separate diagnostic section; do not let them masquerade as accepted assignments or make the acceptance command fail. A hand-written ratio table without executable proof is a proposal, not verified contrast evidence. Sampled checks are not evidence for untested token pairs.
Interaction safety
Keyboard access must not create accidental high-impact actions. Reuse established product shortcuts when they exist. Otherwise prefer an explicit modifier or command surface, suppress shortcuts in editable contexts, and require confirmation for destructive actions. Do not promise undo, reversibility, or permission behavior that the product context does not establish; mark it proposed or unresolved. Document focus movement, concurrent-update recovery, and what happens when the action is not permitted.
Model error states at each material asynchronous boundary. Do not collapse a timeline load failure into an empty timeline, or a metrics request failure into stale data, when recovery and user meaning differ.
Visual comparison pin
For every planned baseline/candidate comparison, pin viewport dimensions, browser and version, OS, device pixel ratio, zoom, loaded fonts, theme, locale, reduced-motion setting, deterministic data fixture, clock, and animation state. If the implementation or product reference is unavailable, record the missing values as unresolved inputs to the future capture harness instead of implying that screenshots are already reproducible.
Component contract
For each material component record:
purpose: user job
anatomy: named parts
variants: meaningful choices
states: default, hover, focus, active, disabled, loading, error, empty
content: limits, truncation, localization
behavior: pointer, keyboard, touch, motion
tokens: semantic references
accessibility: role, name, state, focus, contrast, target size
responsive: changes by available space
do_not: misuse patterns
Quality rules
- Minimize arbitrary one-off values.
- Use typography and space for hierarchy before boxes and decoration.
- Do not erase an existing product’s character to impose a generic system.
- Do not use gradients, glassmorphism, excessive cards, or neon dark styling as defaults.
- Treat documentation examples and implementation mappings as part of the system.
- Produce one canonical artifact. Keep the final response to its path, decisions, verified checks, and open exceptions rather than duplicating the artifact body.
Evidence packet
Return context inspected, principles, token source, component contracts, implementation mapping, representative validation, accessibility results, known exceptions, and migration steps.
1---2name: design-language-33description: Derive or extend a product design system from real context, producing semantic design tokens, component contracts, states, accessibility rules, and implementation mappings. Use for design-system creation or substantial UI work. Do not use to generate an arbitrary trendy palette.4license: Apache-2.05---67# Design Language89Build a visual grammar that explains repeated decisions. Do not confuse a palette with a system.1011## Workflow12131. Inspect existing tokens, components, styles, typography, assets, screen patterns, brand materials, and platform conventions.142. Inventory inconsistencies and preserve intentional product signatures.153. If no visual target exists for greenfield work, stop and route to `prototype-interface` for exactly three image-based directions and user selection.164. Define principles tied to audience, content, density, interaction, and brand character.175. Create primitive and semantic tokens for color, typography, space, size, radius, border, elevation, motion, and breakpoints as applicable.186. Define component anatomy, variants, states, content constraints, keyboard behavior, accessibility, and responsive adaptation.197. Map tokens and components to the target stack. Avoid parallel sources of truth.208. Validate representative screens, edge states, contrast, focus, zoom, localization, and theme behavior.2122## Token policy2324Use the stable Design Tokens Community Group JSON format for new portable token sources when compatible with the toolchain. Prefer semantic names such as `color.text.muted` over presentation names such as `gray.500` in component contracts. References must resolve without cycles.2526### DTCG conformance gate2728Target the stable [DTCG 2025.10 format](https://www.designtokens.org/TR/2025.10/format/) and declare `"$schema": "https://www.designtokens.org/schemas/2025.10/format.json"` when producing token JSON.2930- Every token must have a resolved `$type`; do not infer type from its value.31- A `color` value is a structured object with `colorSpace` and `components`, not a bare hex string.32- A `dimension` value is `{ "value": number, "unit": "px" | "rem" }`.33- A `duration` value is `{ "value": number, "unit": "ms" | "s" }`, not a number or CSS string.34- Put project metadata under a reverse-domain key inside `$extensions`, not as ad hoc token properties.35- Run a schema validator when available. Otherwise run and preserve a deterministic structural checker for the types used, clearly label its coverage as partial, and do not claim full schema conformance.3637### Extension gate3839Classify every proposed primitive as `inherited`, `derived`, or `new`.4041- Reuse inherited product primitives before adding colors, radii, shadows, typefaces, or motion.42- A derived token must name its source primitive and transformation.43- A new primitive needs a semantic gap that existing tokens cannot fill, a named consumer, interaction-state coverage, and measured accessibility evidence.44- Do not invent hover, active, success, or warning values merely to make the table look complete. If a needed value is unverified, mark it unresolved instead of presenting it as system truth.45- Separate frozen product truth from proposals. When the source context does not specify a spacing scale, type ramp, control height, breakpoint, or motion value, mark the token `proposed` or `unresolved` in metadata instead of calling it canonical.4647## Contrast gate4849Calculate contrast from the exact rendered foreground and background values. Do not claim a pair passes from visual intuition.5051- Normal text under 18pt, or under 14pt bold, requires at least 4.5:1.52- Large text requires at least 3:1.53- Keep units explicit: 14pt bold is about 18.66 CSS px at 96 dpi. Bold text at 14 CSS px is normal text and requires 4.5:1.54- Focus indicators and meaningful non-text UI boundaries require at least 3:1 against adjacent colors.55- Report the tested pair, role, ratio, threshold, and result. If a pair fails, select a verified existing token or leave the design state unresolved.5657Run an existing contrast tool or a small deterministic checker. Preserve the exact command and captured stdout or machine-readable result in the evidence packet. The acceptance check must cover every selected semantic foreground/background assignment and exit successfully. Record deliberately tested failing inherited pairs in a separate diagnostic section; do not let them masquerade as accepted assignments or make the acceptance command fail. A hand-written ratio table without executable proof is a proposal, not verified contrast evidence. Sampled checks are not evidence for untested token pairs.5859## Interaction safety6061Keyboard access must not create accidental high-impact actions. Reuse established product shortcuts when they exist. Otherwise prefer an explicit modifier or command surface, suppress shortcuts in editable contexts, and require confirmation for destructive actions. Do not promise undo, reversibility, or permission behavior that the product context does not establish; mark it proposed or unresolved. Document focus movement, concurrent-update recovery, and what happens when the action is not permitted.6263Model error states at each material asynchronous boundary. Do not collapse a timeline load failure into an empty timeline, or a metrics request failure into stale data, when recovery and user meaning differ.6465## Visual comparison pin6667For every planned baseline/candidate comparison, pin viewport dimensions, browser and version, OS, device pixel ratio, zoom, loaded fonts, theme, locale, reduced-motion setting, deterministic data fixture, clock, and animation state. If the implementation or product reference is unavailable, record the missing values as unresolved inputs to the future capture harness instead of implying that screenshots are already reproducible.6869## Component contract7071For each material component record:7273```yaml74purpose: user job75anatomy: named parts76variants: meaningful choices77states: default, hover, focus, active, disabled, loading, error, empty78content: limits, truncation, localization79behavior: pointer, keyboard, touch, motion80tokens: semantic references81accessibility: role, name, state, focus, contrast, target size82responsive: changes by available space83do_not: misuse patterns84```8586## Quality rules8788- Minimize arbitrary one-off values.89- Use typography and space for hierarchy before boxes and decoration.90- Do not erase an existing product’s character to impose a generic system.91- Do not use gradients, glassmorphism, excessive cards, or neon dark styling as defaults.92- Treat documentation examples and implementation mappings as part of the system.93- Produce one canonical artifact. Keep the final response to its path, decisions, verified checks, and open exceptions rather than duplicating the artifact body.9495## Evidence packet9697Return context inspected, principles, token source, component contracts, implementation mapping, representative validation, accessibility results, known exceptions, and migration steps.