# Driftguard

> Turn your design spec into tokens and failing tests, so raw hex, text-[13px], emoji icons and extra CTAs never creep back into the UI.

Driftguard is a paid AI agent skill on Agensi by MAJI, in Frontend & Web Apps. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12 (one-time purchase)
- Creator: [MAJI](https://www.agensi.io/creators/maji)
- Category: [Frontend & Web Apps](https://www.agensi.io/skills/frontend-web-apps)
- Version: 1.1
- Last updated: 2026-10-19
- Security: scan passed (2026-10-19); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/driftguard
- Tags: web-design, tailwind-css, design-systems, accessibility, vitest

## About this skill

You locked a design spec, and three weeks later the UI is full of stray hex, `text-[13px]`, emoji used as icons and four buttons fighting for attention. Ask your agent to "lock the tokens and stop the design drift" and Driftguard turns the spec into one token file plus cheap automated guards that fail in CI the moment generated code drifts away from it.

### Why it's different
- **Guards, not guidelines:** a unit test fails on raw hex, colour functions, arbitrary Tailwind values, palette names, emoji and glyph icons, dashes in copy and `transition-all`.
- **Adopts without a big bang:** new code must be clean, legacy code gets a ratchet that can only go down, so the guard never gets switched off.
- **Tests the tokens too:** every text role is checked at 4.5:1 contrast in light and dark, with a minimum type size.
- **Built from real projects:** 14 failures that actually happened, each with its guard.

### What it does
- **Role table:** colours named by job (`canvas`, `ink-2`, `action`, `danger`), each with one meaning and a light and dark value.
- **One token file:** colour, type scale with a floor, radius, spacing and motion; an optional JS mirror kept equal by a test.
- **Guard test:** one rule table in Vitest, with comments stripped first so docs that quote a colour do not fail.
- **Runtime checks:** exactly one primary CTA per screen, 44px touch targets and 16px form fields, asserted in Playwright.
- **Review checklist:** what a regex cannot see, saved next to the tokens.

### How it works
1. **Write the role table** from your spec or brand kit.
2. **Put every value in one token file** (Tailwind v4 `@theme` or plain CSS variables).
3. **Add the guard test and the icon-button lint rule.**
4. **Add the e2e checks** for one primary CTA, touch targets and form-field size.
5. **Ratchet legacy, wire into CI,** and save the review checklist.

### Frameworks & tools
Tailwind CSS v4 or plain CSS variables, Vitest, Playwright and eslint-plugin-jsx-a11y. Works with React and Next.js out of the box; the rules also run as a Node script over HTML and CSS mockups.

### Use cases
- Porting an approved design into code without it drifting.
- A revamp that keeps sliding back to random sizes and colours.
- AI-generated code that keeps adding arbitrary values and emoji icons.
- Gating mockups so a board with a lint error is never shown.

### Known limitations
It enforces decisions; it does not make them. Pick the look first, then lock it. Needs a test runner in CI to block anything.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Driftguard skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Will it break my build on day one?

No. New code must be clean, while existing offenders go into a ratchet or pending list that may only shrink.

### Does it only work with Tailwind?

No. Tailwind v4 is the default, but the token file can be plain CSS variables and the rules run on any source.

### Why not just use a linter plugin?

The rules here are tied to your own tokens and spec, cover copy (dashes, emoji) and runtime checks like one primary CTA per screen.

### What if JS code needs real colour values?

It reads a `tokens.ts` mirror, and a test keeps it equal to the CSS tokens.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
