AI site builders like Lovable, Cursor and v0 read your design system and then often ignore parts of it. The result often looks "almost right", and nobody checks the code.
I wanted a quick way to see how far the code drifted from the DESIGN.md. So I wrote a Claude skill plus a small Python script that does it.
What it does
You give it a DESIGN.md and a code folder. It lists every:
- color (hex,
rgb(), Tailwind arbitrary values) that is not in your palette, with the nearest token - font family that is not in your DESIGN.md
- border radius, padding, margin or gap that is off your scale
Each finding has the file, the line, the value found and the replacement.
$ python3 scripts/audit.py --design DESIGN.md --src ./site
Consistency score: 84/100
Color: 6 issues
- live-portada-obra-clara.css:38 #53574d -> #3c3f38 (dark gray text, distance 39)
- live-portada-obra-clara.css:44 #d8dbd0 -> #e8e9e3 (line, distance 29)
Radius: 4 issues
- live-portada-obra-clara.css:5 20px -> 18px
What I tested it on, and what that does and does not prove
- Two small demo sites I had generated straight from their own DESIGN.md scored 96/100 and 97/100. Most of what it flagged was spacing values like 14px and 22px.
- The stylesheet of my own site scored 84/100. Caveat: I wrote that DESIGN.md myself from the CSS color variables, so this checks consistency with my own tokens, not with an official design.
That is three runs on files I control, so treat the scores as a demo of the output, not a benchmark. I have not tested it on a large Tailwind project or on exported Lovable code yet.
Limits
- It reads code, not pixels. It cannot tell you a page looks bad, only that it disagrees with your DESIGN.md.
- It only checks what your DESIGN.md defines. No spacing scale in the file, no spacing check.
- Colors inside images or third-party embeds are out of scope.
Try it
There is a free lite version: paste a DESIGN.md and some code into Claude and it checks colors and fonts. It is a single SKILL.md.
- Lite (free, MIT): https://github.com/enercoruna-gif/design-md-auditor-lite
- Full version with the script, radii, spacing, Tailwind classes and the score: https://ia.cuadrantia.store/auditor
If you run it on your own project and it flags something wrong, tell me in the comments. False positives are what I most want to fix next.
Disclosure: I used AI to help write this post and the tool.
Top comments (1)
Nice work — and the honest caveats section is the strongest part of the post. Two things from building a similar deterministic auditor (mine scores websites 0–100 against a fixed checklist): first, pin the score to a fixed denominator — rules checked, not issues found — or a file with 5 rules can score 96 while a file with 40 rules scores 84 for the same amount of drift. Second, the false-positive question has a falsifiable answer: take a clean file, plant 20 known violations — 10 real drift, 10 intentional one-offs that look like drift (a state color at distance 39 from the token, a one-off 20px radius) — and report recall and false-positive rate separately instead of one blended score. That tells you whether the checker is strict or just noisy. One more labelling note: since it reads code, not pixels, I'd call it a consistency score everywhere, never a quality score — a token-correct page can still look wrong, and the score shouldn't imply otherwise.