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.
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.
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.
- 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.
Preserve the command or calculation output in the evidence packet. Sampled contrast checks are not evidence for untested token pairs.
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-23description: 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### Extension gate2728Classify every proposed primitive as `inherited`, `derived`, or `new`.2930- Reuse inherited product primitives before adding colors, radii, shadows, typefaces, or motion.31- A derived token must name its source primitive and transformation.32- A new primitive needs a semantic gap that existing tokens cannot fill, a named consumer, interaction-state coverage, and measured accessibility evidence.33- 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.3435## Contrast gate3637Calculate contrast from the exact rendered foreground and background values. Do not claim a pair passes from visual intuition.3839- Normal text under 18pt, or under 14pt bold, requires at least 4.5:1.40- Large text requires at least 3:1.41- Focus indicators and meaningful non-text UI boundaries require at least 3:1 against adjacent colors.42- Report the tested pair, role, ratio, threshold, and result. If a pair fails, select a verified existing token or leave the design state unresolved.4344Preserve the command or calculation output in the evidence packet. Sampled contrast checks are not evidence for untested token pairs.4546## Component contract4748For each material component record:4950```yaml51purpose: user job52anatomy: named parts53variants: meaningful choices54states: default, hover, focus, active, disabled, loading, error, empty55content: limits, truncation, localization56behavior: pointer, keyboard, touch, motion57tokens: semantic references58accessibility: role, name, state, focus, contrast, target size59responsive: changes by available space60do_not: misuse patterns61```6263## Quality rules6465- Minimize arbitrary one-off values.66- Use typography and space for hierarchy before boxes and decoration.67- Do not erase an existing product’s character to impose a generic system.68- Do not use gradients, glassmorphism, excessive cards, or neon dark styling as defaults.69- Treat documentation examples and implementation mappings as part of the system.70- Produce one canonical artifact. Keep the final response to its path, decisions, verified checks, and open exceptions rather than duplicating the artifact body.7172## Evidence packet7374Return context inspected, principles, token source, component contracts, implementation mapping, representative validation, accessibility results, known exceptions, and migration steps.