Challenge
- As sites and pages multiply, colors and type sizes get written as slightly different values (one of the author's sites had 27 colors and 24 font sizes)
- Judging by eye whether a color is right misses values that look the same but are not
- Reviewing machine-checkable numbers together with matters of judgement, such as mood and tone, makes both less accurate
Approach
- Keep the root brand's numeric rules in one tokens.json in W3C DTCG format; an audit script collects the values a page actually uses and compares them
- Measure color closeness as CIE Lab color difference (delta E) and sort findings into three levels: close but not exact, outside the system, and correct value written as a literal
- While the tokens are still a skeleton, it switches automatically to inventory mode and lists the values in use, as material for deciding the palette
Outcome
- In any project, one command lists the places to fix first, each with a clickable file:line
- The script reports only facts; pass or fail is decided by a review agent working from the brand charter, or by a person
- Code is never fixed automatically; changes are made one at a time, with a person's consent
To keep several sites and apps looking alike, the brand's rules are split in two. Things fixed by numbers (color values, font sizes, spacing, radii, font families) live in design tokens; things that need judgement (positioning, layout mood, tone of copy) live in a brand charter.
This workflow covers the first half. An audit script matches the numbers and reports facts; Claude sorts them into the three to five places to fix first and the ones that may be reasonable exceptions, and hands the judgement to the reviewer.
Key points
Separate facts from rulings. What can be decided by numbers goes to the script; what needs judgement goes to an agent or a person. A model reading numbers misses things, and a script judging mood raises false alarms.
Fix close-but-wrong first. Values with a small delta E are mostly copy-paste or typing slips. Fixing them carries almost no risk, and each fix removes one value that looks right but is not.
One source of truth. The audit reads only tokens.json; tokens exported from Figma or Claude Design are imported elsewhere and applied only after a person picks from the mapping. It never makes do with some other set of tokens.