SKILL.md

  1---
  2name: audit
  3description: Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.
  4version: 2.1.1
  5user-invocable: true
  6argument-hint: "[area (feature, page, component...)]"
  7---
  8
  9## MANDATORY PREPARATION
 10
 11Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first.
 12
 13---
 14
 15Run systematic **technical** quality checks and generate a comprehensive report. Don't fix issues — document them for other commands to address.
 16
 17This is a code-level audit, not a design critique. Check what's measurable and verifiable in the implementation.
 18
 19## Diagnostic Scan
 20
 21Run comprehensive checks across 5 dimensions. Score each dimension 0-4 using the criteria below.
 22
 23### 1. Accessibility (A11y)
 24
 25**Check for**:
 26- **Contrast issues**: Text contrast ratios < 4.5:1 (or 7:1 for AAA)
 27- **Missing ARIA**: Interactive elements without proper roles, labels, or states
 28- **Keyboard navigation**: Missing focus indicators, illogical tab order, keyboard traps
 29- **Semantic HTML**: Improper heading hierarchy, missing landmarks, divs instead of buttons
 30- **Alt text**: Missing or poor image descriptions
 31- **Form issues**: Inputs without labels, poor error messaging, missing required indicators
 32
 33**Score 0-4**: 0=Inaccessible (fails WCAG A), 1=Major gaps (few ARIA labels, no keyboard nav), 2=Partial (some a11y effort, significant gaps), 3=Good (WCAG AA mostly met, minor gaps), 4=Excellent (WCAG AA fully met, approaches AAA)
 34
 35### 2. Performance
 36
 37**Check for**:
 38- **Layout thrashing**: Reading/writing layout properties in loops
 39- **Expensive animations**: Animating layout properties (width, height, top, left) instead of transform/opacity
 40- **Missing optimization**: Images without lazy loading, unoptimized assets, missing will-change
 41- **Bundle size**: Unnecessary imports, unused dependencies
 42- **Render performance**: Unnecessary re-renders, missing memoization
 43
 44**Score 0-4**: 0=Severe issues (layout thrash, unoptimized everything), 1=Major problems (no lazy loading, expensive animations), 2=Partial (some optimization, gaps remain), 3=Good (mostly optimized, minor improvements possible), 4=Excellent (fast, lean, well-optimized)
 45
 46### 3. Theming
 47
 48**Check for**:
 49- **Hard-coded colors**: Colors not using design tokens
 50- **Broken dark mode**: Missing dark mode variants, poor contrast in dark theme
 51- **Inconsistent tokens**: Using wrong tokens, mixing token types
 52- **Theme switching issues**: Values that don't update on theme change
 53
 54**Score 0-4**: 0=No theming (hard-coded everything), 1=Minimal tokens (mostly hard-coded), 2=Partial (tokens exist but inconsistently used), 3=Good (tokens used, minor hard-coded values), 4=Excellent (full token system, dark mode works perfectly)
 55
 56### 4. Responsive Design
 57
 58**Check for**:
 59- **Fixed widths**: Hard-coded widths that break on mobile
 60- **Touch targets**: Interactive elements < 44x44px
 61- **Horizontal scroll**: Content overflow on narrow viewports
 62- **Text scaling**: Layouts that break when text size increases
 63- **Missing breakpoints**: No mobile/tablet variants
 64
 65**Score 0-4**: 0=Desktop-only (breaks on mobile), 1=Major issues (some breakpoints, many failures), 2=Partial (works on mobile, rough edges), 3=Good (responsive, minor touch target or overflow issues), 4=Excellent (fluid, all viewports, proper touch targets)
 66
 67### 5. Anti-Patterns (CRITICAL)
 68
 69Check against ALL the **DON'T** guidelines in the impeccable skill. Look for AI slop tells (AI color palette, gradient text, glassmorphism, hero metrics, card grids, generic fonts) and general design anti-patterns (gray on color, nested cards, bounce easing, redundant copy).
 70
 71**Score 0-4**: 0=AI slop gallery (5+ tells), 1=Heavy AI aesthetic (3-4 tells), 2=Some tells (1-2 noticeable), 3=Mostly clean (subtle issues only), 4=No AI tells (distinctive, intentional design)
 72
 73## Generate Report
 74
 75### Audit Health Score
 76
 77| # | Dimension | Score | Key Finding |
 78|---|-----------|-------|-------------|
 79| 1 | Accessibility | ? | [most critical a11y issue or "--"] |
 80| 2 | Performance | ? | |
 81| 3 | Responsive Design | ? | |
 82| 4 | Theming | ? | |
 83| 5 | Anti-Patterns | ? | |
 84| **Total** | | **??/20** | **[Rating band]** |
 85
 86**Rating bands**: 18-20 Excellent (minor polish), 14-17 Good (address weak dimensions), 10-13 Acceptable (significant work needed), 6-9 Poor (major overhaul), 0-5 Critical (fundamental issues)
 87
 88### Anti-Patterns Verdict
 89**Start here.** Pass/fail: Does this look AI-generated? List specific tells. Be brutally honest.
 90
 91### Executive Summary
 92- Audit Health Score: **??/20** ([rating band])
 93- Total issues found (count by severity: P0/P1/P2/P3)
 94- Top 3-5 critical issues
 95- Recommended next steps
 96
 97### Detailed Findings by Severity
 98
 99Tag every issue with **P0-P3 severity**:
100- **P0 Blocking**: Prevents task completion — fix immediately
101- **P1 Major**: Significant difficulty or WCAG AA violation — fix before release
102- **P2 Minor**: Annoyance, workaround exists — fix in next pass
103- **P3 Polish**: Nice-to-fix, no real user impact — fix if time permits
104
105For each issue, document:
106- **[P?] Issue name**
107- **Location**: Component, file, line
108- **Category**: Accessibility / Performance / Theming / Responsive / Anti-Pattern
109- **Impact**: How it affects users
110- **WCAG/Standard**: Which standard it violates (if applicable)
111- **Recommendation**: How to fix it
112- **Suggested command**: Which command to use (prefer: /animate, /quieter, /shape, /optimize, /adapt, /clarify, /layout, /distill, /delight, /audit, /harden, /polish, /bolder, /typeset, /critique, /colorize, /overdrive)
113
114### Patterns & Systemic Issues
115
116Identify recurring problems that indicate systemic gaps rather than one-off mistakes:
117- "Hard-coded colors appear in 15+ components, should use design tokens"
118- "Touch targets consistently too small (<44px) throughout mobile experience"
119
120### Positive Findings
121
122Note what's working well — good practices to maintain and replicate.
123
124## Recommended Actions
125
126List recommended commands in priority order (P0 first, then P1, then P2):
127
1281. **[P?] `/command-name`** — Brief description (specific context from audit findings)
1292. **[P?] `/command-name`** — Brief description (specific context)
130
131**Rules**: Only recommend commands from: /animate, /quieter, /shape, /optimize, /adapt, /clarify, /layout, /distill, /delight, /audit, /harden, /polish, /bolder, /typeset, /critique, /colorize, /overdrive. Map findings to the most appropriate command. End with `/polish` as the final step if any fixes were recommended.
132
133After presenting the summary, tell the user:
134
135> You can ask me to run these one at a time, all at once, or in any order you prefer.
136>
137> Re-run `/audit` after fixes to see your score improve.
138
139**IMPORTANT**: Be thorough but actionable. Too many P3 issues creates noise. Focus on what actually matters.
140
141**NEVER**:
142- Report issues without explaining impact (why does this matter?)
143- Provide generic recommendations (be specific and actionable)
144- Skip positive findings (celebrate what works)
145- Forget to prioritize (everything can't be P0)
146- Report false positives without verification
147
148Remember: You're a technical quality auditor. Document systematically, prioritize ruthlessly, cite specific code locations, and provide clear paths to improvement.