$npx -y skills add bitjaru/styleseed --skill ss-a11yAudit a component or page for accessibility issues and fix them
| 1 | # Accessibility Audit |
| 2 | |
| 3 | ## When NOT to use |
| 4 | |
| 5 | - For general design system compliance review → use `/ss-review` |
| 6 | - For Nielsen UX heuristics → use `/ss-audit` |
| 7 | - For non-StyleSeed code (no `data-slot`, no semantic tokens) — assumes StyleSeed conventions |
| 8 | - For runtime testing — this is a static code audit, not a screen-reader simulation |
| 9 | |
| 10 | Target: **$ARGUMENTS** |
| 11 | |
| 12 | ## Audit Criteria |
| 13 | |
| 14 | ### WCAG 2.2 AA Compliance |
| 15 | |
| 16 | #### 1. Perceivable |
| 17 | - **Color contrast**: Text must meet 4.5:1 (normal) or 3:1 (large/bold text) |
| 18 | - Check `text-muted-foreground` (#717182) on `bg-background` (#FFFFFF) = 4.6:1 (passes) |
| 19 | - Check `text-brand` on white (verify contrast with your skin's brand color) |
| 20 | - Flag any custom colors that don't meet ratio |
| 21 | - **Non-text contrast**: UI controls/graphics must meet 3:1 |
| 22 | - **Text alternatives**: All `<img>` need `alt`, icons need `aria-label` when meaningful |
| 23 | - **Color independence**: Don't convey info by color alone (add icons/text) |
| 24 | |
| 25 | #### 2. Operable |
| 26 | - **Touch targets**: Minimum 44x44px (`min-h-11 min-w-11`) |
| 27 | - Common violation: `h-9` (36px) buttons — should be `h-11` |
| 28 | - Icon buttons need explicit size: `w-11 h-11` |
| 29 | - **Keyboard navigation**: All interactive elements must be keyboard-accessible |
| 30 | - Tab order should be logical |
| 31 | - `focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2` |
| 32 | - **Motion**: Animations must respect `prefers-reduced-motion` |
| 33 | ```css |
| 34 | @media (prefers-reduced-motion: reduce) { |
| 35 | *, *::before, *::after { |
| 36 | animation-duration: 0.01ms !important; |
| 37 | transition-duration: 0.01ms !important; |
| 38 | } |
| 39 | } |
| 40 | ``` |
| 41 | |
| 42 | #### 3. Understandable |
| 43 | - **Labels**: Form inputs must have visible labels or `aria-label` |
| 44 | - **Error messages**: Form errors must be programmatically associated (`aria-describedby`) |
| 45 | - **Language**: `<html lang="en">` (or appropriate language code for your project) |
| 46 | |
| 47 | #### 4. Robust |
| 48 | - **Semantic HTML**: Use appropriate elements (`<button>`, `<nav>`, `<main>`, `<header>`) |
| 49 | - **ARIA**: Use Radix UI components (they handle ARIA automatically) |
| 50 | - **Roles**: Custom interactive elements need proper `role` attributes |
| 51 | |
| 52 | ## Design System Token Reference |
| 53 | |
| 54 | | Token | Minimum Contrast | Note | |
| 55 | |-------|-----------------|------| |
| 56 | | `--foreground` | 7:1+ | Body text — verify with your skin | |
| 57 | | `--muted-foreground` | 4.5:1+ | Secondary text — verify with your skin | |
| 58 | | `--brand` | 4.5:1+ | Accent — verify with your skin's brand color | |
| 59 | | `--destructive` | 4.5:1+ | Error — verify with your skin | |
| 60 | | `--success` | 3:1+ | Large text/icons only — verify with your skin | |
| 61 | | `--warning` | 4.5:1+ | Warning text — some skins need a darker variant | |
| 62 | |
| 63 | ## Output |
| 64 | |
| 65 | 1. **Issues found**: List with severity (Critical/Major/Minor) |
| 66 | 2. **Auto-fixes**: Apply fixes directly where possible |
| 67 | 3. **Manual review needed**: Flag items that need human judgment |