Back to skills
SKILL.md
Ui Design Debt Auditor
ASecurityAudits frontend codebases for styling duplication, conflicting token overrides, arbitrary hardcoded values (magic numbers), obsolete CSS utilities, and dead design system rules. Generates quantified design debt scorecards and structured refactoring plans to restore styling consistency and reduce bundle size.
- 7 stars
- 0 votes
- 0 copies
- 2 views
- Added November 9, 2026
Security analysis
100/100npx -y skills add Harmitx7/tribunal-kit --skill ui-design-debt-auditor --agent claude-codeAre you the author of Ui Design Debt Auditor?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/harmitx7-ui-design-debt-auditor)---
name: ui-design-debt-auditor
description: 'Audits frontend codebases for styling duplication, conflicting token overrides, arbitrary hardcoded values (magic numbers), obsolete CSS utilities, and dead design system rules. Generates quantified design debt scorecards and structured refactoring plans to restore styling consistency and reduce bundle size.'
version: 1.0.0
last-updated: 2026-10-30
skills:
- audit-and-fix
- clean-code
- better-ui
tools: Read, Grep, Glob, Bash, Edit, Write
scripts-binding:
- .agent/scripts/lint_runner.js
- .agent/scripts/verify_all.js
inputs:
sourceDirectories: 'array'
designSystemManifest: 'object'
severityThreshold: 'string'
outputs:
designDebtReport: 'object'
debtScore: 'number'
cleanupPlan: 'object'
trigger:
- 'design-debt-auditor'
- 'style-duplication'
- 'token-audit'
- 'css-debt-cleanup'
---
# UI Design Debt Auditor — Styling Duplication & Arbitrary Value Detection
## Mandatory Pre-Flight Context Inspection
Before issuing design debt audits or refactoring recommendations, inspect these 5 critical parameters:
1. **Magic Number Hunting**: Flag all arbitrary pixel dimensions (e.g. `p-[19px]`, `w-[342px]`, `rounded-[11px]`) that do not conform to the design system's 8pt grid or token scale.
2. **Raw Color Hex Infiltration**: Detect raw color literals (`#3b82f6`, `rgb(30, 41, 59)`) bypassing the semantic token layer.
3. **Utility Class Bloat**: Identify duplicate utility chains repeated across multiple components instead of being abstracted into reusable primitives.
4. **Z-Index Anarchy**: Audit `z-index` values to ensure they adhere to defined layering scales (`z-dropdown`, `z-modal`, `z-tooltip`) rather than competing arbitrary values (`z-[9999]`).
5. **Dead CSS & Unused Variants**: Scan stylesheets and theme definitions for unreferenced token variables or component classes.
## Activation Boundaries
- **Activate when:** Auditing codebase design health, preparing for design system rollouts, reducing CSS bundle size, or standardizing inconsistent component styles.
- **DO NOT activate when:** Designing brand-new initial mockups or writing backend database queries.
## 🔁 Multi-Pass Design Debt Protocol
| Pass | Phase | Core Action | Observable Target |
| :--------- | :-------------------------------- | :---------------------------------------------------------------------------------- | :------------------------ |
| **Pass 1** | **Static Token Scan** | Grep codebase for raw hex codes, arbitrary pixel brackets, and loose CSS variables. | Token Violation Log |
| **Pass 2** | **Spatial & Grid Audit** | Audit padding, margin, and gap usages against the 8pt spatial grid. | Magic Number Log |
| **Pass 3** | **Z-Index & Stacking Audit** | Extract all stacking contexts and flag arbitrary `z-[...]` values. | Stacking Hierarchy Report |
| **Pass 4** | **Component Variant Duplication** | Identify duplicated button/card styling variants across different modules. | Duplication Catalog |
| **Pass 5** | **Debt Score & Remediation Plan** | Calculate Design Debt Index (0–100) and assemble prioritized refactoring backlog. | Design Debt Report |
---
## 🛠️ Technical Architecture & Debt Audit Recipes
### 1. Codebase Grep Recipes for Design Debt
```bash
# Detect raw hex values in JSX/TSX components
grep -rnE "#[0-9a-fA-F]{3,8}" src/components/
# Detect arbitrary pixel classes in Tailwind
grep -rnE "(p|m|gap|rounded|w|h)-\[[0-9]+px\]" src/components/
# Detect arbitrary z-index escalations
grep -rnE "z-\[[0-9]+\]" src/components/
```
### 2. Design Debt Scorecard Matrix
| Debt Category | Measured Metric | Healthy Benchmark | Refactoring Remediation |
| :----------------- | :------------------------------ | :---------------: | :---------------------------------------------------- |
| Token Compliance | % of colors using CSS variables | $\ge 98\%$ | Replace raw hex with semantic tokens |
| Spatial Discipline | % of spacing on 8pt grid | $\ge 95\%$ | Round arbitrary brackets to nearest 4/8px token |
| Z-Index Order | Total distinct z-index layers | $\le 5$ | Constrain to `--z-elevated`, `--z-modal`, `--z-toast` |
| Component Variance | Unique button implementations | $\le 3$ | Consolidate to shared `<Button />` primitive |
---
## 🏛️ Tribunal Verification & Guardrails
### 🛑 Verification-Before-Completion (VBC) Protocol
1. Confirm debt report quantifies total raw hex occurrences and arbitrary pixel brackets.
2. Ensure refactoring proposals provide drop-in replacement semantic token classes.
3. Verify that zero critical z-index layering conflicts remain unflagged.
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.