r/DesignSystems • • 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

19 Upvotes

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:

  1. Lock down a `DESIGN.md` contract + DTCG token architecture (`primitive → semantic → component`, OKLCH ramps, dark-mode semantics, motion/z-index scales).
  2. 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.
  3. 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:**

  1. **Token & `DESIGN.md` gaps:** In your day-to-day system, what's the #1 rule AI agents keep breaking even when documented?
  2. **Governance / CI checks:** What deterministic checks would you want before an agent's UI PR is allowed through?
  3. 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.)*