—
name: accessibility-testing-superpower
description: |
Performs WCAG compliance audits and accessibility remediation for web applications.
Use when: 1) Auditing UI for WCAG 2.1/2.2 compliance 2) Fixing screen reader or keyboard navigation issues 3) Implementing ARIA patterns correctly 4) Reviewing color contrast and visual accessibility 5) Creating accessible forms or interactive components
—
# Accessibility Testing Workflow
## Configuration
– **WCAG Level**: ${wcag_level:AA}
– **Component Under Test**: ${component_name:Page}
– **Compliance Standard**: ${compliance_standard:WCAG 2.1}
– **Minimum Lighthouse Score**: ${lighthouse_score:90}
– **Primary Screen Reader**: ${screen_reader:NVDA}
– **Test Framework**: ${test_framework:jest-axe}
## Audit Decision Tree
“`
Accessibility request received
|
+– New component/page?
| +– Run automated scan first (axe-core, Lighthouse)
| +– Keyboard navigation test
| +– Screen reader announcement check
| +– Color contrast verification
|
+– Existing violation to fix?
| +– Identify WCAG success criterion
| +– Check if semantic HTML solves it
| +– Apply ARIA only when HTML insufficient
| +– Verify fix with assistive technology
|
+– Compliance audit?
+– Automated scan (catches ~30% of issues)
+– Manual testing checklist
+– Document violations by severity
+– Create remediation roadmap
“`
## WCAG Quick Reference
### Severity Classification
| Severity | Impact | Examples | Fix Timeline |
|———-|——–|———-|————–|
| Critical | Blocks access entirely | No keyboard focus, empty buttons, missing alt on functional images | Immediate |
| Serious | Major barriers | Poor contrast, missing form labels, no skip links | Within sprint |
| Moderate | Difficult but usable | Inconsistent navigation, unclear error messages | Next release |
| Minor | Inconvenience | Redundant alt text, minor heading order issues | Backlog |
### Common Violations and Fixes
**Missing accessible name**
“`html
“`
**Form label association**
“`html
“`
**Color contrast failure**
“`
Minimum ratios (WCAG ${wcag_level:AA}):
– Normal text (<${large_text_size:18}px or <${bold_text_size:14}px bold): ${contrast_ratio_normal:4.5}:1
- Large text (>=${large_text_size:18}px or >=${bold_text_size:14}px bold): ${contrast_ratio_large:3}:1
– UI components and graphics: 3:1
Tools: WebAIM Contrast Checker, browser DevTools
“`
**Focus visibility**
“`css
/* Never do this without alternative */
:focus { outline: none; }
/* Proper custom focus */
:focus-visible {
outline: ${focus_outline_width:2}px solid ${focus_outline_color:#005fcc};
outline-offset: ${focus_outline_offset:2}px;
}
“`
## ARIA Decision Framework
“`
Need to convey information to assistive technology?
|
+– Can semantic HTML do it?
| +– YES: Use HTML (
Leave a Reply