#What it does
The /a11y skill audits your frontend components against WCAG 2.1 guidelines. It checks for missing ARIA attributes, broken keyboard navigation, insufficient color contrast, missing alt text, incorrect heading hierarchy, and focus management issues. Each finding includes the WCAG criterion it violates and the exact code change to fix it.
#How to use
/a11y/a11y src/components/Modal.tsx/a11y --fix src/components/With --fix, the skill applies safe fixes automatically (adding missing aria-label, alt attributes, role attributes). Fixes that require design decisions are flagged for manual review.
#What it checks
- Images -- Missing or empty
alttext, decorative images withoutalt="" - Forms -- Inputs without associated labels, missing error announcements, no
autocompleteattributes - Keyboard -- Interactive elements not reachable via Tab, missing focus styles, focus traps without escape
- ARIA -- Incorrect or redundant ARIA roles, missing
aria-livefor dynamic content, brokenaria-labelledbyreferences - Color -- Contrast ratios below 4.5:1 for normal text and 3:1 for large text (checks Tailwind classes against theme colors)
- Headings -- Skipped heading levels, multiple
h1elements, headings used for styling instead of semantics - Motion -- Animations without
prefers-reduced-motionmedia query support - Semantics -- Div-based buttons without
role="button", clickable elements without keyboard handlers
#Example
> /a11y src/components/ProductCard.tsx
## Accessibility Audit: 4 issues found
### [CRITICAL] Line 12: Image missing alt text
<img src={product.image} className="rounded-lg" />
Fix: <img src={product.image} alt={product.name} className="rounded-lg" />
WCAG: 1.1.1 Non-text Content (Level A)
### [HIGH] Line 24: Click handler on div without keyboard support
<div onClick={handleSelect}>Select</div>
Fix: <button onClick={handleSelect}>Select</button>
WCAG: 2.1.1 Keyboard (Level A)
### [MEDIUM] Line 31: Color contrast ratio 3.2:1
text-gray-400 on bg-white fails WCAG AA for normal text.
Fix: Use text-gray-600 (contrast ratio 5.7:1)
WCAG: 1.4.3 Contrast (Level AA)
### [LOW] Line 8: Missing lang attribute on price display
Price formatted with locale but no lang attribute for screen readers.
Fix: Add lang="en" to the price <span>
WCAG: 3.1.2 Language of Parts (Level AA)