# How do I keep AI coding agents on my design system tokens?

> Put tokens in code, write agent rules, and lint hex. That keeps AI coding agents on your design system instead of invented colours, spacing, and components.

- canonical: https://silt.app/guides/keep-ai-agents-on-your-design-system
- last updated: 2026-12-01

[What Silt is](https://silt.app/). [Silt vs Figma](https://silt.app/compare/silt-vs-figma). [Silt vs Overlay Studio](https://silt.app/compare/silt-vs-overlay-studio). [Stop Figma and code drift](https://silt.app/guides/stop-design-drift). [Silt pricing](https://silt.app/pricing).

Put the design system in the code the agent actually edits, then make invented values fail. Tokens in CSS variables or a theme file beat hex in a prompt. Write the rule in CLAUDE.md, AGENTS.md, or a Cursor rules file: use those tokens, do not invent colours, spacing, or components. Add a lint rule that rejects raw hex and off-system spacing. Review the running UI, not only the diff. That is how you keep AI coding agents on your design system tokens instead of hex colours, and how you stop them inventing random colors, spacing, and components.

This is tool-neutral. It works with Claude Code, Codex, Cursor, or any other coding agent that reads the repo. Silt can help you see whether the agent followed the system, because the canvas is the running Next.js or Vite React app. It does not replace tokens, rules, or lint.

## How do I put tokens where the agent can see them?

Agents invent hex when the only colour they can see is in a screenshot or a prompt. Put colour, type, spacing, and radius in the repo as named tokens. A CSS variable, a Tailwind theme key, or a theme object the linter can read is a contract. Hex in a chat message is a suggestion.

- Keep colour, spacing, type, and radius in one token file or CSS layer the whole app imports.
- Name tokens by intent (surface, text, border, radius), not by the hex they currently hold.
- Export real components from one folder so the agent has an inventory to reuse, not a blank canvas to invent from.
- Delete or deprecate stray hex in product UI so the agent cannot copy a bad example.

## How do I write agent rules that actually stick?

A prompt is forgotten on the next turn. A rules file in the repo is read on every run. Put the design system contract next to the code: CLAUDE.md, AGENTS.md, .cursor/rules, or the equivalent for your agent.

- State the token files by path, and say to use those names instead of hex, rgb, or arbitrary spacing.
- List the component folder and say to extend an existing component before creating a new one.
- Ban one-off values: no raw hex, no magic numbers for padding, no new heading styles.
- Keep the file short. A page of rules is followed. A novel of rules is skipped.

## How do I lint invented colours, spacing, and components?

Rules tell the agent what you want. Lint tells the agent what will fail. Pair them. If hex still compiles, the agent will keep using it.

- Fail raw hex in product CSS and in inline styles. Allow it only in the token source file.
- Fail arbitrary Tailwind values and off-system spacing, radius, and type.
- Fail new one-off UI primitives when a shared component already covers the job.
- Run lint in the pull request. A local-only rule is a preference, not a gate.

## How do I catch a design system miss before merge?

A green diff can still look wrong. Open the running app on the branch and look at colour, spacing, and components next to a known-good screen. If you only read the patch, you will miss a heading that is 17px, or a button that is a new rectangle instead of the shared one.

Chromatic, Playwright screenshots, or a careful visual pass all work. The point is to review the rendered UI, not a mock of it.

## Where does Silt fit?

Silt is a Mac app for design engineers. It opens your existing Next.js or Vite React repo as live, running components on a canvas. You bring your own Claude Code, Codex, or Cursor login. Those agents edit the real code, several in parallel, each in a git worktree. You can add Mobbin references next to the live UI. When a direction is right, Silt opens a GitHub pull request with before and after screenshots.

That helps because you are looking at the running product while the agent works, so a stray hex or a made-up component is visible. Silt does not invent a design system for you, and it does not lint hex on its own. You still need tokens in code, a rules file, and a lint gate. GitHub only. Next.js and Vite only. Mac only.

## What else should I know about design system tokens and agents?

### How do I keep AI coding agents on my design system tokens instead of hex colours?

Put tokens in the repo the agent edits, name them by intent, and point CLAUDE.md, AGENTS.md, or Cursor rules at those files. Add a lint rule that fails raw hex. Review the running UI before merge. Prompts alone are not enough.

### How do I keep AI from ignoring my design system and inventing random colors, spacing, and components?

Give the agent a real inventory: tokens, a component folder, and a short rules file. Make invented values fail in lint. Review the rendered UI, not only the diff. Silt can show that UI on a canvas of your Next.js or Vite app, but the contract still lives in the code.

### Do I need Silt to keep agents on my design system?

No. Tokens, agent rules, and lint work in any repo. Silt is useful when you want to watch the running Next.js or Vite UI while Claude Code, Codex, or Cursor edits the real files, then open a GitHub pull request with before and after screenshots.

### Does Silt lint hex colours for me?

No. Silt does not replace your linter. You still write the token files and the rules that fail off-system values. Silt shows the running app those agents are editing.

### How much does Silt cost?

Free plan with 10 Silt messages a day and a 7-day Pro trial. Pro is 30 euros a month billed yearly or 39 euros monthly, plus VAT.

---

from Silt, https://silt.app
