r/DesignSystems • u/Longjumping_War_8480 • 20h ago
I need your help: trying to make AI coding agents actually follow a Design System (DESIGN.md + DTCG tokens) instead of inventing random values
Anyone who has tried letting Claude Code or Cursor build UI against a design system knows the pain: even when you give it tokens, the agent still hallucinates arbitrary hex colors, invents random spacing/radii, or mixes conflicting rules when the prompt gets too long.
I've been working on an open-source skill router on GitHub (MIT, 100% free) to fix this by forcing a strict order of operations before the agent writes components:
- Lock down a `DESIGN.md` contract + DTCG token architecture (`primitive → semantic → component`, OKLCH ramps, dark-mode semantics, motion/z-index scales).
- Route the agent to only the 3–5 relevant design-system/accessibility skills per stage (from 30 curated collections) instead of dumping a massive style guide into context.
- Run a deterministic review gate at the end (checking WCAG contrast, focus visibility, `prefers-reduced-motion`, and token compliance).
**Where I genuinely need help from people who maintain real Design Systems:**
- **Token & `DESIGN.md` gaps:** In your day-to-day system, what's the #1 rule AI agents keep breaking even when documented?
- **Governance / CI checks:** What deterministic checks would you want before an agent's UI PR is allowed through?
- If anyone wants to inspect the `DESIGN.md` protocol, token-scale skills, or the 324-check `validate.mjs` script in the repo and tell me what's naive or missing, I'd really appreciate the feedback.
*(Repo link in the first comment so the post doesn't get eaten by Reddit's link filter.)*