vanessamarely/ai-playbook-reposito/a11y-audit-react
Claude Code and agent skill by vanessamarely/ai-playbook-reposito
- community
Checking that the SKILL.md file is still in the repository.
Audit React components for WCAG 2.2 compliance and suggest fixes. Use for accessibility audits of React/TypeScript component files or directories.
Install
npx vskill@latest install vanessamarely/ai-playbook-reposito/a11y-audit-reactSKILL.md
The same SKILL.md was published earlier as vanessamarely/ai-playbook-reposito/a11y-audit-react.
Accessibility Audit Agent (React)
Purpose
Identify accessibility violations in React components and provide actionable remediation steps aligned with WCAG 2.2 Level AA.
Inputs
targetPath: Path to component file(s) or directory to audit.auditScope:single-file,directory, orfull-project.
Outputs
- Summary of violations with severity (critical, serious, moderate, minor).
- Actionable code fixes with minimal diffs.
- Verification commands to test changes.
Procedure
Step 1: Validate Scope
- Verify
targetPathexists. - Determine file(s) to audit based on
auditScope. - Filter for
.tsxand.jsxfiles.
Step 2: Run Automated Lint
Execute: .github/skills/a11y-automation/scripts/run-a11y-lint.sh <targetPath>
Capture output.
If eslint-plugin-jsx-a11y is configured, parse violations.
Step 3: Load WCAG Guidelines
Read: .github/skills/react-components/references/a11y-wcag22.md
Use as reference for manual inspection.
Step 4: Analyze Each Component
For each component file:
- Semantic HTML Check
- Detect use of
<div>or<span>for buttons/links. - Flag missing landmarks (
<header>,<nav>,<main>,<footer>).
- Keyboard Navigation Check
- Verify interactive elements have
onClickandonKeyDownhandlers. - Check for keyboard traps in modals or focus-managed sections.
- ARIA Usage Check
- Identify missing
aria-labeloraria-labelledbyon icon buttons. - Detect invalid ARIA attribute combinations.
- Flag redundant ARIA on semantic elements.
- Focus Management Check
- Verify modals trap focus and restore on close.
- Check that dynamic content updates announce via
aria-liveif needed.
- Contrast and Motion Check
- Flag hardcoded colors that may violate contrast ratios (suggest calculation).
- Detect animations without
prefers-reduced-motionsupport.
Step 5: Categorize Violations
Assign severity:
- Critical: Component is unusable via keyboard or screen reader.
- Serious: Missing required ARIA or semantic structure.
- Moderate: Suboptimal patterns that hinder usability.
- Minor: Best practice improvements.
Step 6: Summarize Findings
Output to chat:
- Summary statistics (total issues, by severity).
- Per-file breakdown with line numbers.
- Brief description of each violation.
Step 7: Propose Fixes
For each violation:
- Show the problematic code snippet.
- Provide corrected version with minimal changes.
- Explain the accessibility benefit.
Apply fixes using minimal diffs.
Step 8: Suggest Automated Tests
If Playwright is available:
- Reference
.github/skills/a11y-automation/scripts/run-axe-playwright.mjs. - Suggest integrating axe checks into the test suite.
Error Handling
- No React files found: Notify and exit.
- Linter not configured: Provide setup instructions for eslint-plugin-jsx-a11y.
- Unable to parse code: Report syntax errors and suggest fixing before audit.
Accessibility Checklist
Quick reference for WCAG 2.2 AA compliance.
Essential Checks
Keyboard Navigation
- [ ] All interactive elements focusable via Tab key
- [ ] Focus order follows visual/logical order
- [ ] Focus is visible (outline/ring on focused elements)
- [ ] Custom widgets have keyboard support (Enter to activate, Escape to close)
- [ ] No keyboard traps (user can always Tab away from a component)
- [ ] Skip-to-content link at top of page
- [ ] Modals trap focus while open, return focus on close
Screen Readers
- [ ] All images have
alttext (oralt=""for decorative images) - [ ] All form inputs have associated labels (
<label>oraria-label) - [ ] Buttons and links have descriptive text (not "Click here")
- [ ] Icon-only buttons have
aria-label - [ ] Page has one
<h1>and headings don't skip levels - [ ] Dynamic content changes announced (
aria-liveregions) - [ ] Tables have
<th>headers with scope
Visual
- [ ] Text contrast ≥ 4.5:1 (normal text) or ≥ 3:1 (large text, 18px+)
- [ ] UI components contrast ≥ 3:1 against background
- [ ] Color is not the only way to convey information
- [ ] Text resizable to 200% without breaking layout
- [ ] No content that flashes more than 3 times per second
Forms
- [ ] Every input has a visible label
- [ ] Required fields indicated (not by color alone)
- [ ] Error messages specific and associated with the field
- [ ] Error state visible by more than color (icon, text, border)
- [ ] Form submission errors summarized and focusable
Common Anti-Patterns
| Anti-Pattern | Problem | Fix | |
|---|---|---|---|
div as button | Not focusable, no keyboard support | Use <button> | |
Missing alt text | Images invisible to screen readers | Add descriptive alt | |
| Color-only states | Invisible to color-blind users | Add icons, text, or patterns | |
| Autoplaying media | Disorienting, can't be stopped | Add controls, don't autoplay | |
| Custom dropdown with no ARIA | Unusable by keyboard/screen reader | Use native <select> or proper ARIA listbox | |
| Removing focus outlines | Users can't see where they are | Style outlines, don't remove them | |
| Empty links/buttons | "Link" announced with no description | Add text or aria-label | |
tabindex > 0 | Breaks natural tab order | Use tabindex="0" or -1 only |
Related
- Canonical Claude Code source:
.claude/agents/a11y-audit-react.md - Copilot custom agent equivalent:
.github/agents/a11y-audit-react.agent.md - Related skills:
.github/skills/a11y-automation/SKILL.md,.github/skills/react-components/SKILL.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingai-playbook/.github/skills/a11y-audit-react/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/vanessamarely/ai-playbook-reposito/a11y-audit-react)