Site Tuner Install

Blog

Keep your design tokens intact when you build with an AI agent

You set up colour variables, a type scale and a radius scale. Three weeks of prompting later, half the components carry hex values and pixel sizes typed in directly. Nobody decided to abandon the system. It wore away one "make this darker" at a time.

How tokens get lost

When you ask for a visual change in words, the agent has to produce a value. "A bit darker" becomes #1f2937, because that is a reasonable dark colour, and nothing in your message said to choose from the variables you already have. The result looks right today and stops following the theme tomorrow.

The same happens with size. "Slightly bigger" becomes font-size: 19px, a value that appears nowhere in your scale.

Check where a style comes from

The first step is seeing the problem. Select an element and look at what sets its colour. If the answer is a variable, such as --color-accent, the element is on the system. If the answer is a raw value, it has drifted.

Site Tuner shows this in the panel. A colour that comes from a variable is shown by the variable's name, and the hand-off records the rule and file that set it. You can see the state of the system by clicking around the page for a minute.

Pick from what the site already has

The better fix is to never produce an off-system value. In Site Tuner, the four-dot button beside a colour opens the site's own colour variables, read live from its CSS and grouped by name. The same button on Typography, Appearance and Effects opens the site's text styles, radius values and shadows.

When you pick one, the change is recorded as var(--color-ink), not as a hex value. The instructions your agent receives name the token, so the code it writes uses the token.

Brief the agent on the rules

Whatever tool you use, three lines in the brief protect the system:

  • Change a style where it is defined today. Do not add inline styles or !important.
  • If the project uses a utility framework such as Tailwind, change the utility classes and prefer values on the existing scale.
  • If a value comes from a token and the change is for one element, do not edit the token. Override it on that element.

Site Tuner appends rules like these to every hand-off, so you do not have to remember them.

When the token itself is wrong

Sometimes the fix is the token: the accent colour is too light everywhere. That is a system change and it deserves its own message to the agent, reviewed on every page it touches. Keep it apart from one-off tweaks, so a single hand-off never mixes "change this button" with "change every button".