Build a design system for agent-generated UIs: W3C DTCG token pipeline (primitives, semantics, component tier), component specs with accessibility baked in, and docs that keep builds consistent. Use when setting up shared styling, tokenizing a codebase, or making generated UIs look coherent.
./install.sh design-systemname: "design_system" description: "Build a design system for agent-generated UIs: W3C DTCG token pipeline (primitives, semantics, component tier), component specs with accessibility baked in, and docs that keep builds consistent. Use when setting up shared styling, tokenizing a codebase, or making generated UIs look coherent." metadata: { "includeInPrompt": true }
Turn one-off generated UIs into a coherent product surface. The system is a machine contract, not a brand book: a token file agents read and write, component specs with exact states and keyboard behavior, and an accessibility floor that gets checked, not wished for. Built for the case where the author is an agent generating screens all day.
tokens/tokens.json in W3C DTCG format before any component work. Three tiers:color.blue.500, space.4): raw values. Components never touch these.color.bg.accent, text.body, space.section-gap): meaning, referencing primitives with {color.blue.500}. Components consume these almost exclusively. Retheme by swapping references, never grepping code.--button-primary-background-hover. Scale/state segment always last: --input-border-color-focus, never --input-focus-border-color.$value and $type. Dimensions are strings with units ("12px"), fontWeight is numeric (600). See references/token-format.md. Starter file in assets/tokens.starter.json.:root gets everything; [data-theme="dark"] overrides only the semantics that change.theme.extend values point at CSS vars (var(--color-bg-accent)), never baked hexes, so dark mode works for free.tokens/ change and fails (git diff --exit-code) if built outputs are stale. Figma variables, if they exist, are the source of truth; code consumes generated artifacts. Nobody hand-transcribes hex.components/<name>.md per component covering: states (default, hover, active, focus, disabled, loading, error), which semantic tokens it binds, keyboard behavior, and ARIA roles. The template in assets/component-spec.template.md forces this. A component without its spec is not part of the system.references/accessibility.md)::focus-visible with a 3px solid outline + 2px offset, 3:1 against adjacent colors. Never :focus { outline: none } without a replacement.DESIGN.md with token front matter plus prose rationale. Then lint it: run bin/lint-tokens.py tokens/tokens.json to verify every {alias} resolves to a real token and every named semantic contrast pair passes AA. Wire that check into CI alongside the Style Dictionary rebuild. When tokens change, diff the before/after token files and review what the change recolors before merging.A completed design system ships:
tokens/tokens.json (W3C DTCG, primitives + semantics, lint-clean)build/css/tokens.css (light + dark), Tailwind theme or TS declarations as the project needscomponents/.md: one spec per component, states + tokens + keyboard + ARIA + contrast pairsDESIGN.md: front matter tokens + prose rationale, linted--color-action-primary, not --color-blue-500. You can change blue to purple without renaming the codebase.publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e
No ratings yet — be the first to rate it.