Design drift

From ariadoss/superskills · View interactive version

Design drift is an AI agent skill from the GitHub repository ariadoss/superskills. Detect and fix design drift — the ad-hoc colors, spacing, type sizes, shadows, and duplicate component variants that accumulate outside the design system and harden into debt. Use when the user mentions "design drift", "inconsistent UI", "one-off styles", "magic numbers in CSS", "consolidate styles"

How to use this skill

Skill file

Design Drift

I find where the UI has quietly diverged from its own design system and pull it back — consolidating one-off values into tokens, collapsing duplicate component variants, and promoting recurring exceptions into the system before they calcify into debt.

This is not a taste audit. design-audit asks "does this look good?" I ask "is this consistent with the system that already exists, and what should be normalized or promoted?" Drift is a refactor problem, not an aesthetics problem.

Core Principle

Every visual value in the codebase is one of three things:

  1. On-system — references a token (var(--space-4), theme.colors.primary). Leave it.
  2. Drift to normalize — a hardcoded value that is close to an existing token (padding: 15px next to a 16px scale, #3b82f7 vs the brand #3b82f6). Snap it back to the token.
  3. Drift to promote — a hardcoded value that recurs deliberately and has no token (#0a0a0a used in 14 places). It's a real system value that was never named. Add it to the system, then reference it.

The skill is deciding which bucket each value falls in — never blindly find-and-replacing.

Evidence First — No Guessing

I report only drift I can point to. Every finding cites file:line and a count. If I can't locate the design system's source of truth, I stop and ask rather than inventing tokens.

  1. Locate the system. Find the token source: tailwind.config.*, theme.ts, :root custom properties, tokens.json, a DESIGN_SYSTEM.md, Style Dictionary, etc. This is ground truth. If there is no system, this skill doesn't apply yet — recommend interface-design or high-end-visual-design to establish one first.
  2. Scan for raw values. Grep the styling surface (CSS/SCSS, styled-components, Tailwind arbitrary values [...], inline style=, RN StyleSheet) for:
  1. Cluster by proximity. Group near-identical values (#fafafa, #fbfbfb, #f9f9f9 → one cluster). The cluster size is the signal: how many shades of gray actually ship?
  2. Find duplicate components. Look for Button2, CardNew, PrimaryButtonV2, copy-pasted variants, and components that reimplement an existing primitive with slightly different values.

Classification

For each cluster, decide and justify:

| Bucket | Test | Action |

|--------|------|--------|

| Normalize | Within rounding distance of an existing token, or a clear typo/near-dupe | Replace with the token |

| Promote | Recurs ≥3× intentionally, no token exists, semantically distinct | Add a named token, then reference it |

| Leave | Genuinely one-off and intentional (e.g. a marketing hero) | Document why; don't touch |

State the count and the decision for every cluster. "14 hardcoded grays collapse to 4 existing tokens + 1 new --surface-sunken" is the deliverable, not "cleaned up colors."

Deliverable

Present a drift report before changing anything:

  1. Token source of truth — what the system is and where it lives.
  2. Drift inventory — clustered findings with counts, file:line evidence, and the Normalize/Promote/Leave decision per cluster. Order by blast radius (most occurrences first).
  3. Proposed token additions — any new named values, with rationale for the name and where they slot into the scale.
  4. Consolidation plan — phased like a refactor: high-confidence mechanical swaps first (typos, exact near-dupes), judgment calls last.

Wait for approval. The user reorders, cuts, or rejects promotions. Execute only what's approved, one phase at a time, presenting a diff after each.

Guardrails

Scope Boundaries

I touch: hardcoded visual values, duplicate component variants, token definitions, references to tokens.

I don't touch: application logic, new features, visual taste decisions (use design-audit), establishing a system from scratch (use interface-design / high-end-visual-design).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.