Accessibility Audit Command
Run a comprehensive WCAG accessibility audit on your web application components. Checks for color contrast, keyboard navigation, ARIA attributes, semantic HTML, screen reader compatibility, and focus management issues.
Command
/accessibility-audit
Description
Performs a thorough WCAG 2.1 (Level AA) compliance check on specified components or pages. Identifies accessibility barriers and provides specific remediation steps with code examples.
Behavior
- Scan the specified files or directory for UI components
- Analyze each component against WCAG 2.1 AA criteria:
- Perceivable: Text alternatives, captions, color contrast (4.5:1 minimum), content reflow
- Operable: Keyboard access, focus indicators, no keyboard traps, sufficient time
- Understandable: Error identification, labels, predictable navigation
- Robust: Valid HTML, ARIA attributes, name/role/value
- Report findings organized by severity and WCAG criterion
- Suggest specific code fixes for each issue
Checklist
Images & Media
- All
<img>tags have meaningfulaltattributes - Decorative images use
alt=""orrole="presentation" - Videos have captions/transcripts
- No information conveyed through color alone
Interactive Elements
- All interactive elements are keyboard accessible
- Focus order follows logical reading order
- Focus indicators are visible (no
outline: nonewithout replacement) - Custom components have correct ARIA roles and states
- Buttons use
<button>, not<div onClick> - Form inputs have associated
<label>elements
Structure
- Heading hierarchy is logical (h1 > h2 > h3, no skips)
- Landmark regions used (
<main>,<nav>,<aside>) - Lists use
<ul>/<ol>, not styled<div>s - Tables have
<th>headers andscopeattributes
Dynamic Content
- Loading states announced to screen readers (
aria-live) - Modals trap focus and return focus on close
- Error messages linked to inputs via
aria-describedby - Toast notifications use
role="alert"
Output Format
## Accessibility Audit: [Component/Page] ### Critical (Must Fix) | Issue | File:Line | WCAG | Fix | |-------|-----------|------|-----| | Missing alt text | Card.tsx:23 | 1.1.1 | Add descriptive alt | | No keyboard access | Dropdown.tsx:45 | 2.1.1 | Add keyDown handler | ### Serious (Should Fix) | Issue | File:Line | WCAG | Fix | |-------|-----------|------|-----| | Low contrast: 3.2:1 | Button.tsx:12 | 1.4.3 | Darken text to #333 | ### Minor (Consider) | Issue | File:Line | WCAG | Fix | |-------|-----------|------|-----| | Missing lang attr | Layout.tsx:1 | 3.1.1 | Add lang="en" to html | Score: 72/100 (Level AA)
Examples
# Audit a specific component /accessibility-audit src/components/LoginForm.tsx # Audit an entire page /accessibility-audit src/pages/checkout/ # Audit with specific WCAG level /accessibility-audit src/components/ --level AAA
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.