Skip to content

commandFrontend

A11y Check

Audits a page or component for accessibility problems against WCAG 2.2 and lists fixes ordered by impact on real users.

npx workspacetemplates add a11y-check --tool claude-code

Writes 1 file to .claude/commands/

.claude/commands/a11y-check.md14 lines · 1.4 KBFile
---
description: Audits a page or component for accessibility problems against WCAG 2.2 and lists fixes ordered by impact on real users.
argument-hint: "[route, component or folder]"
---

Check accessibility of: $ARGUMENTS (a page route, component file or folder).

1. Read the markup and styles. Look for: images without meaningful alt, inputs without a label or aria-label, click handlers on div or span, headings that skip levels, missing landmarks (main, nav), links with text like "click here", tables without header cells, and autoplaying media.
2. Check keyboard use: every control reachable by Tab in a logical order, visible focus style (outline not removed), no keyboard trap, Escape closes dialogs and focus returns to the trigger, and focus moves into modals.
3. Check ARIA: roles that duplicate native elements, aria-hidden on focusable items, missing aria-expanded or aria-live for dynamic content, and invalid references to ids.
4. Check color contrast of text and controls against 4.5:1 and 3:1, target size of at least 24 by 24 CSS pixels, and that information is never conveyed by color alone. Respect prefers-reduced-motion.
5. If a dev server is running and axe or Lighthouse is installed, run it and merge the results.

Report issues as Critical, Serious or Minor, each with file and line, the WCAG criterion, and the fix as code. Ask which group to fix first before editing.

What it does

Accessibility bugs hide in markup that looks fine: a button that is really a div, an input with no label, a color pair that fails contrast. This command reads the code for those patterns and checks the keyboard and screen reader path.

Findings are ranked by how much they block people, each with the file, the rule it breaks and a concrete fix. If a dev server and an audit tool are available it runs them too; it never edits files unasked.

Example

you › /a11y-check src/components/CheckoutForm.tsx

agent › Critical: card number input has no label (line 58, WCAG 1.3.1, 3.3.2). Critical: modal does not trap focus (line 120, 2.4.3). Serious: error text color #e57373 on white is 2.9:1 (1.4.3). Minor: 2 headings skip a level. Fix the Critical group first?

Questions

Can code review replace testing with a screen reader?
No. It catches many structural problems, but a manual pass with a keyboard and screen reader is still needed before you claim compliance.
Will it change my components?
Not until you pick which group of fixes to apply.
  • Add Form Validation

    CommandFrontend

    Free
  • Add Loading States

    CommandFrontend

    Free
  • Check Responsive

    CommandFrontend

    Free
  • Convert to TypeScript

    Commandtypescript

    Free