Skip to content
Agent loop · Browser & QA

Accessibility Audit Until Clean

Drive a real browser through your key pages, run an automated accessibility audit, fix each violation in the source, and re-audit until every page passes.

Up to 10 iterationsStop rules and safety limits
The prompt

Copy the Accessibility Audit Until Clean loop

Stops when the automated audit reports zero serious or critical violations on every listed page, or after 10 iterations. Edit the settings block, then paste the whole prompt into your agent.

a11y-audit-until-clean.prompt.md
You are running the "Accessibility Audit Until Clean" loop.

Settings (edit before running):
- Base URL: http://localhost:3000 (local or staging only)
- Pages and states: /, /pricing, /sign-in, /sign-in with validation errors showing, the main navigation menu open
- Audit: axe-core with WCAG 2.2 AA rules, injected through the browser automation tools
- Viewports: 1280x800 and 390x844
- Max iterations: 10

Goal: zero serious or critical violations on every page, state, and viewport above.

Each iteration:
1. Open each page and state at each viewport, wait for it to finish loading, and run the audit.
2. Collect violations: rule ID, impact, number of elements, and one example selector each.
3. Group violations by the component that renders them. Fix the most widespread component first, in the source code, not with page-specific patches.
4. Typical fixes: label form inputs, give icon-only buttons accessible names, fix color contrast with design tokens, restore visible focus styles, use real buttons and links, correct heading order, add alt text that describes purpose.
5. Tab through every changed component to check focus order, visible focus, and that dialogs trap and return focus.
6. Log: iteration, violations by impact before and after.

Stop when:
- No serious or critical violations remain anywhere. Success. List moderate and minor ones separately.
- You reach the max iteration count.

Rules:
- Only audit the base URL above. Do not submit real forms, sign in with real accounts, or make purchases.
- Do not hide content from assistive technology (aria-hidden, role="presentation") just to silence a rule.
- Do not add ARIA where a native HTML element would do the job.
- Remind the reader in the final report that automated audits catch only part of WCAG; manual and screen reader testing still matter.

Final report: violations before and after by page, components changed, and remaining manual checks.
When to use it

When this loop fits

  • You are preparing for a WCAG review or an accessibility statement.
  • A redesign shipped and you want to catch missing labels, contrast, and focus problems quickly.
  • You want accessibility checks to become a routine part of finishing a feature.
How it works

What happens on each pass

The agent repeats these steps until the stop condition holds or it runs out of iterations.

  1. List the pages. Choose the pages and states to audit, including menus, modals, and forms with errors showing.
  2. Audit in a browser. Load each page with a browser automation server and run axe-core or a Lighthouse accessibility audit.
  3. Fix in the source. Fix each violation in the component that renders it, so every page using it benefits.
  4. Check by keyboard. Tab through changed components to confirm focus order and visible focus.
  5. Re-audit. Re-run the audit on every page and continue until all pass.
Recommended servers

MCP servers for this loop

The 6 strongest of 822 matching servers, ranked by how closely they fit and then by trust score.

More in Browser automation
  • Trust score 72 of 100, Good

    moontide

    by konni-arcadia · JavaScript

    Early: Claude steers live music by writing Strudel code played in a browser page

    Registry
    LicenseQualityMaintenanceLicense: C. AGPL-3.0 is a strong copyleft license: derived works must use the same license.Quality: Not graded. No README or tool list has been captured yet.Maintenance: A. Last commit or release 21 days ago.
    4 stars682/wk weekly downloads— tools
  • Trust score 70 of 100, Good

    Create, preview, inspect, verify, and compile deterministic PDF documents with Fullbleed.

    Registry
    LicenseQualityMaintenanceLicense: A. MIT is a permissive open source license.Quality: A. 91/100 for listing completeness. Lost points: short summary.Maintenance: A. Last commit or release today.
    168 stars25/wk weekly downloads3 tools
  • Trust score 70 of 100, Good

    mcp

    by webdriverio · TypeScript

    MCP server with WebdriverIO for browser and mobile app automation (iOS/Android via Appium)

    Registry
    LicenseQualityMaintenanceLicense: A. MIT is a permissive open source license.Quality: Not graded. No README or tool list has been captured yet.Maintenance: A. Last commit or release 11 days ago.
    43 stars—/wk weekly downloads— tools
  • Trust score 70 of 100, Good

    Let your coding agent use the Firefox, Zen, or LibreWolf browser you already have open.

    Registry
    LicenseQualityMaintenanceLicense: A. MIT is a permissive open source license.Quality: Not graded. No README or tool list has been captured yet.Maintenance: A. Last commit or release 4 days ago.
    30 stars—/wk weekly downloads— tools
  • Trust score 69 of 100, Good

    AI browser tools with Chrome CDP. Navigate, screenshot, interact. Multi-provider failover.

    Registry
    LicenseQualityMaintenanceLicense: A. MIT is a permissive open source license.Quality: Not graded. No README or tool list has been captured yet.Maintenance: A. Last commit or release 22 days ago.
    18 stars—/wk weekly downloads— tools
  • Trust score 69 of 100, Good

    PlayGuard

    by zenyadar · TypeScript

    Proxy MCP for Playwright, Figma, DevTools, Shopify Dev, Context7 — fewer tokens, caching

    Registry
    LicenseQualityMaintenanceLicense: A. MIT is a permissive open source license.Quality: Not graded. No README or tool list has been captured yet.Maintenance: A. Last commit or release 8 days ago.
    15 stars—/wk weekly downloads— tools
Run it

How to run this loop

  1. Connect the tools. Install a server the loop can use, for example moontide, or rely on your agent's built-in terminal and file access.
  2. Edit the settings block. Replace the example commands, targets, and limits with your project's own. Keep the iteration cap low on the first run.
  3. Paste it into an agent session. Start a fresh session in Claude Code, Cursor, or VS Code agent mode, in the repository root, and paste the prompt.
  4. Review before you merge. Read the final report and the diff. The loop leaves its work for you to review rather than shipping it.
FAQ

Accessibility Audit Until Clean questions

When does the Accessibility Audit Until Clean loop stop?

It stops as soon as the automated audit reports zero serious or critical violations on every listed page. It also stops after 10 iterations by default, or earlier when the prompt's own stop rules say it is stuck, and then reports what changed and what is left. Change the cap in the settings block at the top of the prompt.

Does passing an automated audit mean my site is accessible?

No. Automated tools reliably catch issues such as missing labels, contrast, and invalid ARIA, but many WCAG criteria need human judgment, such as whether alt text is meaningful or whether a flow makes sense with a screen reader. Use this loop to clear the mechanical issues, then test manually.

Which MCP server do I need for an accessibility loop?

A browser automation server based on Playwright or Chrome DevTools, which can load pages, run scripts such as axe-core in the page, and read the accessibility tree. Some servers expose accessibility snapshots directly, which also helps the agent check its fixes.

Keep exploring
All loops