design-drift-detector
Skill4 starsChanged 3 months agoMITView on GitHub
Scans a codebase for design token violations — components bypassing the design system with hardcoded colors, magic number spacings, literal font sizes, and other CSS anti-patterns. Produces a severity-sorted drift report with auto-fix recipes. Use when: audit:drift, hardcoded CSS, token drift, design drift, hardcoded colors, magic numbers, CSS violations, design system enforcement.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- atezer/FMCPtheir own version, first seen Oct 15, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- atezer/FMCP★ 10same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository46 other files it gives its agents.
- accessibility-reviewSkill
- accessibility-runtime-auditSkill
- adaptive-component-behaviorSkill
- ai-feature-ux-patternsSkill
- behavioral-pricing-psychologySkill
- business-model-readingSkill
- business-model-thinkingSkill
- cognitive-load-heatmap-predictionSkill
- component-style-guideSkill
- cross-functional-reviewSkill
- dark-mode-theming-systemSkill
- dashboard-layout-patternsSkill
- dashboard-scaffolding-contractSkill
- design-system-builderSkill
- design-to-code-handoffSkill
- design-tokensSkill
- error-boundary-resilience-designSkill
- flow-based-functional-testingSkill
- growth-impact-reviewSkill
- i18n-localization-strategySkill
- information-architectureSkill
- interactive-element-auditSkill
- kinematic-motion-choreographySkill
- micro-interaction-motion-designSkill
- module-registry-syncSkill
- mvp-scopingSkill
- perceived-performance-loadingSkill
- prd-traceability-matrixSkill
- product-discoverySkill
- product-strategySkill
- project-health-diagnosticsSkill
- qa-feedback-loop-orchestratorSkill
- responsive-breakpoint-strategySkill
- responsive-qa-auditSkill
- route-integrity-checkerSkill
- security-privacy-reviewSkill
- stakeholder-requirement-mappingSkill
- touch-gesture-interactionSkill
- typography-systemSkill
- usability-heuristics-checkSkill
- user-flow-mappingSkill
- user-research-synthesisSkill
- ux-chaos-monkeySkill
- visual-hierarchy-reviewSkill
- visual-responsive-regression-testingSkill
- visual-style-extractorSkill
The file
Files
🔍 Skill: Design Drift Detector
Purpose
AI coding agents are precision-correct but context-blind. They generate #3B82F6 when they should generate var(--color-primary). They write margin: 16px when the token is var(--space-4). Over time, this silent drift disconnects the codebase from the design system — making future AI assistance increasingly inaccurate.
This skill detects that drift with surgical precision across 7 violation categories and 50+ pattern signatures.
Trigger Phrases
| Phrase | Activation |
| "audit:drift" / "agentway audit:drift" | ✅ |
| "check hardcoded CSS" / "find hardcoded values" | ✅ |
| "token drift" / "design drift" | ✅ |
| "hardcoded colors" / "magic numbers" | ✅ |
| "CSS violations" / "token enforcement" | ✅ |
| "design system compliance" / "token coverage" | ✅ |
| "find non-token values" | ✅ |
Protocol: 3-Pass Drift Audit
PASS 1 — Critical Violations (Colors & Typography)
Scan for the highest-severity drift patterns that directly break visual consistency:
Color Violations:
- Hardcoded hex:
#[0-9a-fA-F]{3,6} - Hardcoded RGB:
rgb([0-9]+,\s*[0-9]+,\s*[0-9]+) - Hardcoded RGBA:
rgba([0-9]+,\s*[0-9]+,\s*[0-9]+,\s*[0-9.]+) - Hardcoded HSL:
hsl([0-9]+,\s*[0-9]+%,\s*[0-9]+%) - Named colors:
color: red,background: blue,border-color: black
Typography Violations:
- Literal font-size:
font-size:\s*[0-9]+(px|rem|em)(not using token) - Literal font-weight:
font-weight:\s*(100|200|300|400|500|600|700|800|900)(not using token) - Literal line-height:
line-height:\s*[0-9]+(px|em)(literal, not unitless token)
PASS 2 — High Violations (Spacing & Layout)
Spacing Violations:
- Literal margin:
margin(-top|-right|-bottom|-left)?:\s*[0-9]+(px|rem) - Literal padding:
padding(-top|-right|-bottom|-left)?:\s*[0-9]+(px|rem) - Literal gap:
gap:\s*[0-9]+(px|rem) - Literal grid columns:
grid-template-columns:\s*repeat\([0-9]+,\s*[0-9]+(px|fr)
Dimension Violations:
- Hardcoded width/height with non-semantic values:
(width|height):\s*[0-9]+(px)(not 100%, auto, or a known breakpoint)
PASS 3 — Medium/Low Violations (Radius, Shadow, Z-Index, Duration)
Border Radius:
border-radius:\s*[0-9]+(px|rem|%)(not usingvar(--radius-*))
Box Shadow:
box-shadow:\s*[0-9]+(px)(hardcoded shadow, not usingvar(--shadow-*))
Z-Index:
z-index:\s*[0-9]+(not using namedvar(--z-*)token)- Anti-pattern:
z-index:\s*(9999|99999|999)
Transition/Duration:
transition(-duration)?:\s*[0-9]+(ms|s)(not usingvar(--duration-*))animation-duration:\s*[0-9]+(ms|s)
Specificity Anti-Patterns:
!importantusage (overrides token cascade)style=inline styles in component templates
Severity Classification
| Level | Score Impact | Action Required |
| 🔴 Critical | −20 pts per violation | Fix before next AI session |
| 🟠 High | −10 pts per violation | Fix in current sprint |
| 🟡 Medium | −5 pts per violation | Fix in next sprint |
| 🟢 Low | −2 pts per violation | Fix in backlog cleanup |
Severity Matrix by Category
| Category | Severity | Why |
| Hardcoded colors | 🔴 Critical | Breaks brand consistency, blocks dark mode |
| Hardcoded typography | 🟠 High | Breaks type scale, disables responsive text |
| Hardcoded spacing | 🟠 High | Breaks rhythm, causes layout inconsistency |
| Hardcoded radius | 🟡 Medium | Visual inconsistency but non-breaking |
| Hardcoded shadow | 🟡 Medium | Elevation inconsistency |
| Hardcoded z-index | 🟡 Medium | Stacking context bugs |
| Hardcoded duration | 🟢 Low | Motion inconsistency |
!important flags | 🟡 Medium | Blocks token cascade override |
Inline style= | 🟠 High | Unauditable, not token-resolved |
Drift Report Output Format
drift-report.md
# 🔍 Design Drift Report — [project-name]
Scanned: [timestamp] | Files: [N] | Total Violations: [N]
## Summary
| Severity | Count | Files Affected |
| Critical | 12 | 8 |
| High | 34 | 15 |
| Medium | 47 | 22 |
| Low | 18 | 9 |
## Critical Violations
### 🔴 Hardcoded Colors (12 violations)
| File | Line | Code | Fix |
| components/Button.css | 14 | `color: #3B82F6` | `color: var(--color-primary)` |drift-report.json
{
"version": "1.6.0",
"scannedAt": "ISO8601",
"summary": {
"totalFiles": 47,
"totalViolations": 111,
"driftRate": "23.4%",
"byCategory": {
"hardcodedColors": { "count": 12, "severity": "critical" },
"hardcodedSpacing": { "count": 34, "severity": "high" },
"hardcodedTypography": { "count": 22, "severity": "high" }
}
},
"violations": [
{
"file": "components/Button.css",
"line": 14,
"category": "hardcodedColor",
"severity": "critical",
"found": "color: #3B82F6",
"fix": "color: var(--color-primary)"
}
]
}Integration with project-health-diagnostics
The drift rate from this skill directly feeds Signal E in the TAI calculation:
drift_rate = (total_violations / (total_declarations × 100))
TAI_adjustment:
drift_rate < 5% → no penalty
drift_rate 5–15% → -5 from TAI
drift_rate 15–30% → -15 from TAI
drift_rate > 30% → -25 from TAICompanion Skills
| Skill | Relationship |
project-health-diagnostics | Parent skill — runs drift-detector as Signal E |
design-tokens | Provides the token system that violations should reference |
dark-mode-theming-system | Color hardcoding blocks dark mode token switching |
ux-chaos-monkey | Chaos injector validates fixes hold under stress |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

