The agents review your code and enforce accessibility patterns during development. axe-core tests the rendered page in a real browser. Together, they cover both sides: code-time enforcement and runtime verification.
- MCP tool (
run_axe_scan) - Agents trigger axe-core scans programmatically via the MCP server - Agent instructions - The testing-coach and web-accessibility-wizard know when and how to run scans
- VS Code task - Manual scan trigger in the VS Code command palette
The run_axe_scan tool:
- Takes a URL (your running dev server), an optional CSS selector, and an optional report file path
- Runs
@axe-core/cliagainst the live page - Parses the JSON results
- Returns violations grouped by severity (Critical > Serious > Moderate > Minor)
- Includes affected HTML elements, WCAG criteria, and fix suggestions
- When
reportPathis provided, writes a structured markdown report to that file
Prerequisites:
npm install -g @axe-core/cliThe tool generates markdown reports with:
- Scan metadata (URL, date, standard, scanner)
- Summary table of violations by severity
- Each violation with WCAG criteria, help link, and affected elements
- HTML snippets showing problematic code
- Fix suggestions from axe-core
Output files:
| File | Written By | Contents |
|---|---|---|
ACCESSIBILITY-SCAN.md |
run_axe_scan tool |
Raw axe-core scan results |
ACCESSIBILITY-AUDIT.md |
web-accessibility-wizard | Consolidated: agent review + axe-core, deduplicated, with fixes |
The web-accessibility-wizard (Phase 9) asks if you have a dev server running and triggers a scan:
/web-accessibility-wizard run a full audit on this project
@web-accessibility-wizard audit this project for accessibility
The testing-coach runs ad-hoc scans:
/testing-coach run an axe-core scan on http://localhost:3000/dashboard
@testing-coach scan http://localhost:3000/checkout for accessibility issues
Any agent can interpret results you feed manually:
npx @axe-core/cli http://localhost:3000 --save results.json/accessibility-lead triage the violations in results.json
GitHub Actions:
- name: Run axe-core accessibility tests
run: |
npx @axe-core/cli http://localhost:3000 \
--tags wcag2a,wcag2aa,wcag21a,wcag21aa \
--exitTest framework packages:
npm install --save-dev @axe-core/playwright # Playwright
npm install --save-dev cypress-axe axe-core # Cypress
npm install --save-dev jest-axe # Jest (React)| Issue Type | Agents | axe-core | Manual Testing |
|---|---|---|---|
| Missing alt text | Yes | Yes | Yes |
| ARIA pattern correctness | Yes | Partial | Yes |
| Computed contrast ratios | No | Yes | Yes |
| Focus management logic | Yes | No | Yes |
| Live region timing | Yes | No | Yes |
| Tab order design | Yes | No | Yes |
| Keyboard trap detection | Yes | No | Yes |
| Third-party widget issues | No | Yes | Yes |
| Screen reader UX | No | No | Yes |
Agents catch ~70% of issues during code generation. axe-core catches some of the remaining issues by testing the rendered DOM. Manual testing covers what tools cannot.
The @axe-core/playwright package enables axe-core scanning within Playwright, creating a third assessment layer that catches defects in dynamic states that the CLI cannot reach:
| Tool | axe-core Usage |
|---|---|
run_playwright_state_scan |
Clicks triggers, runs AxeBuilder on revealed content |
run_playwright_viewport_scan |
Runs AxeBuilder at each viewport width |
| Scenario | axe-core CLI | Playwright + axe-core |
|---|---|---|
| Static page violations | Yes | Yes |
| Violations in expanded accordions | No | Yes |
| Violations in open menus | No | Yes |
| Violations in modal dialogs | No | Yes |
| Viewport-specific violations | No | Yes |
| Touch target size at mobile widths | No | Yes |
When an issue is found by all three sources (agent code review + axe-core CLI + Playwright behavioral scan), it receives Confirmed confidence with a 1.2x weight multiplier in severity scoring.
npm install -D playwright @axe-core/playwright
npx playwright install chromiumPlaywright is optional. Without it, the CLI-based workflow continues as before.
See Playwright Integration for full details.