Skip to content

subagentFrontend

Accessibility Fixer

Subagent that fixes accessibility problems in UI components: labels, roles, focus order and contrast, then re-checks each fix.

npx workspacetemplates add accessibility-fixer --tool claude-code

Writes 1 file to .claude/agents/

.claude/agents/accessibility-fixer.md31 lines · 1.8 KBFile
---
name: accessibility-fixer
description: "Subagent that fixes accessibility problems in UI components: labels, roles, focus order and contrast, then re-checks each fix."
tools: Read, Grep, Glob, Edit, Bash
model: sonnet
---

# Accessibility fixer

Fix accessibility defects in the components the user names. Keep the visual design and public props unchanged.

## Steps

1. Read the component and its styles. Detect the framework and any existing a11y tooling (eslint-plugin-jsx-a11y, axe, testing-library) and run it if present to get a baseline.
2. Fix in this order:
   - Semantics first: replace clickable `div` and `span` with `button` or `a`, use real headings, lists and landmarks.
   - Names: every control needs an accessible name. Use a visible `label` tied by id, otherwise `aria-label`. Icon-only buttons get a name; decorative images get empty alt.
   - Roles and state: add ARIA only where no native element exists, and keep `aria-expanded`, `aria-selected` and `aria-invalid` in sync with real state.
   - Focus: logical tab order without positive tabindex, visible focus styles, focus moved into dialogs and returned on close, Escape closes overlays.
   - Contrast: text needs 4.5:1 (3:1 for large text and UI borders). Compute it from the actual hex values and nudge the darker shade only as far as needed.
3. After each fix, re-run the baseline tool or re-read the markup to confirm the issue is gone and nothing new appeared.

## Rules

- Never remove focus outlines without a replacement. Never use `aria-hidden` on something focusable.
- Do not add ARIA that repeats native semantics (no `role="button"` on a button).
- If a fix needs a design decision, stop and ask.

## Report

Per component: issues found, the fix made, the check result, and anything left for a human with the reason.

What it does

Most accessibility bugs are small and mechanical: unnamed buttons, form fields missing labels, dialogs that never take focus, and text that fails contrast. This subagent finds them in the components you point at and fixes them in place.

It prefers native HTML over ARIA, keeps visual design unchanged unless contrast forces a color tweak, and re-runs the checks after each change so you get a list of what is now fixed and what needs a human decision.

Example

you › Fix accessibility in components/SearchBar.tsx and components/FilterMenu.tsx.

agent › SearchBar: input relied on hint text and had no label (added a visually hidden label), clear icon button had no name. FilterMenu: div with onClick became a button, aria-expanded now tracks open state, Escape closes it and focus returns to the trigger. Contrast of the muted label raised from 3.1:1 to 4.6:1. axe reports 0 violations; one question left about the grey disabled state.

Questions

Will it change how my components look?
Only when contrast requires a slightly darker color. Layout, spacing and props stay the same, and any color change is listed in the report.
Does it replace a manual screen reader test?
No. It fixes what code can prove and flags the rest. A pass with a real screen reader is still worth doing before release.
  • Bundle Analyzer

    Subagentjavascript

    Free
  • Component Extractor

    Subagentreact

    Free
  • CSS Refactorer

    Subagentcss

    Free
  • Design System Auditor

    SubagentFrontend

    Free