A11y Audit Until Clean
FeaturedOn demandAbout A11y Audit Until Clean
This loop cleans up accessibility problems in changed UI. Each round runs the accessibility audit, then edits code based on the report, for at most 8 rounds.
Key features
- 01Manual trigger, so the user decides when it starts
- 02Judges success by the exit code of npm run test:a11y
- 03Capped at 8 rounds to avoid endless retries
- 04Currently supports Cursor
Use cases
- 01Before submitting a PR with UI changes
- 02After adding a new form or dialog component
- 03Working through serious violations in an audit report
- Goal
- Changed UI has zero serious accessibility violations, as confirmed by the audit command.
- Exit when
- Stop when npm run test:a11y exits 0, or after 8 rounds if it still fails.
- Between iterations run
- npm run test:a11y
Launch prompt
Paste into Cursor. The agent repeats the steps below until the exit condition is met.
Start the "A11y Audit Until Clean" loop. Goal: Changed UI has zero serious accessibility violations, as confirmed by the audit command. Max iterations: 8. Step 1: Run the a11y audit — Execute npm run test:a11y and read the reported violations. If the command exits 0, the check has passed and the loop ends. `npm run test:a11y` Step 2: Locate serious violations — Pick out the serious issues that relate to the changed UI and trace them to the affected components and elements. Step 3: Edit the code — Make a minimal fix for each issue, such as adding a label, adjusting contrast or correcting semantic structure, then move on to the next round and audit again. Between iterations run: `npm run test:a11y` Exit when: Stop when npm run test:a11y exits 0, or after 8 rounds if it still fails.
Steps
Each round runs in order; if the exit condition isn’t met, another round starts, up to 8.
Execute npm run test:a11y and read the reported violations. If the command exits 0, the check has passed and the loop ends.
npm run test:a11yPick out the serious issues that relate to the changed UI and trace them to the affected components and elements.
Make a minimal fix for each issue, such as adding a label, adjusting contrast or correcting semantic structure, then move on to the next round and audit again.
Supported agents
Coding agents that can run this loop directly.