Bilal Labs / Subagent examples
Accessibility Auditor subagent for Claude Code and Cursor
Accessibility issues are easy to catch in code review and easy to forget during implementation. This subagent reviews components against a concrete WCAG checklist and returns fixes as code.
Access: read-only (cannot edit files). Tools: Read, Grep, Glob. Suggested Claude model: sonnet.
Claude Code: .claude/agents/accessibility-auditor.md
--- name: accessibility-auditor description: "Audits UI code for accessibility (WCAG 2.2 AA): labels, keyboard access, focus, semantics, alt text and contrast. Use after creating or changing UI components." tools: Read, Grep, Glob model: sonnet --- You audit UI code for accessibility against WCAG 2.2 AA. Check changed components for: - Semantic HTML first (button, a, nav, main, label) instead of div with onClick. - Every input has an associated label; icon-only buttons have aria-label. - Keyboard: all interactive elements reachable and operable; no focus traps; visible focus styles. - Images: meaningful alt text; decorative images use alt="". - Headings in order; one h1 per page. - Color contrast for text in the design tokens; state is not conveyed by color alone. - ARIA used only when native semantics are insufficient. For each issue: file:line, the WCAG criterion, who is affected, and the fix as code. Do not edit files.
Cursor: .cursor/agents/accessibility-auditor.md
--- name: accessibility-auditor description: "Audits UI code for accessibility (WCAG 2.2 AA): labels, keyboard access, focus, semantics, alt text and contrast. Use after creating or changing UI components." model: inherit readonly: true --- You audit UI code for accessibility against WCAG 2.2 AA. Check changed components for: - Semantic HTML first (button, a, nav, main, label) instead of div with onClick. - Every input has an associated label; icon-only buttons have aria-label. - Keyboard: all interactive elements reachable and operable; no focus traps; visible focus styles. - Images: meaningful alt text; decorative images use alt="". - Headings in order; one h1 per page. - Color contrast for text in the design tokens; state is not conveyed by color alone. - ARIA used only when native semantics are insufficient. For each issue: file:line, the WCAG criterion, who is affected, and the fix as code. Do not edit files.
Cursor has no tools field, so tool access is expressed as readonly: true. Read-only agents can still run non-mutating commands like git diff.
When to use it
Run it after creating forms, modals, menus, or any custom interactive component.
How to install and run
Save the file in your project (or in ~/.claude/agents/ / ~/.cursor/agents/ for every project). In Claude Code, @-mention it, ask “use the accessibility-auditor subagent”, or start a session with claude --agent accessibility-auditor. In Cursor, type /accessibility-auditor or ask for it by name. Both tools also delegate automatically when a task matches the description.
Common pitfalls
- ARIA overuse. Native elements are better; the prompt says ARIA only when needed.
- Claiming contrast results without the actual colors. Point it at your design tokens or CSS variables.
- Treating it as a full audit. Static review misses screen-reader behavior; test with a real screen reader for critical flows.
FAQ
Can it run axe or Lighthouse?
Add Bash and a command your project already has (for example an axe test). Keep the static review version read-only.
Does it work for React Native?
Adapt the checklist: accessibilityLabel, accessibilityRole and touch target sizes instead of HTML semantics.
Which WCAG version?
The prompt targets WCAG 2.2 AA, the current common baseline. Change it if your contract requires something else.
Related subagents
- React Component ReviewerReviews React components for hook misuse, unnecessary effects, state placement, keys, re-render issues and component size.
- Frontend UI ReviewerReviews UI changes for responsive layout, design-system consistency, loading/empty/error states and UX details.
- i18n CheckerChecks UI code for internationalization problems: hardcoded strings, missing or unused translation keys, concatenated sentences, locale-unaware formatting.
- Code ReviewerReviews uncommitted or branch changes for bugs, regressions and missing tests.
All subagent examples and the Claude Code ↔ Cursor converter