Prompt file imported from porsche-design-system/testing (
.cursor/commands/a11y-fix.md). Fill in{{auditFile}}before use. Copyright stays with the author.
Fix Web Accessibility Issues
Apply fixes from a completed audit. a11y-issue-fixer is the sole fix policy — read it first and follow its categories, safety rules, and output contract. Do not restate or invent a second auto-fix table here.
Input
Audit report: {{auditFile}} (default: ACCESSIBILITY-AUDIT.md in the newest .a11y/runs/ directory)
Instructions
When the target provides the a11y-audit agent, use it. Otherwise execute this prompt directly with the installed a11y-* skills and preserve the workflow order and safety requirements below.
Run Phase 12 of the audit workflow.
Step 1: Confirm scope
Ask (via askQuestions):
- Report path — default: the report in the newest
.a11y/runs/directory - Fix mode
- Auto-fixable batch — preview the batch, then ask once before applying it
- One by one — show every fix for approve / skip / edit
- Specific issues — user picks by issue number
- Verification URL — dev server URL, or none
Step 2: Load context
- Resolve the report's sibling
findings.json; stop if it is missing or inconsistent. Treat it as$BASELINE. - Create a new
$RUN=.a11y/runs/<timestamp>and$SCRATCH=$(mktemp -d). Never overwrite the baseline run. - Read
$BASELINE.scoring:profile,executedChecksByPage,reviewedPhasesByPage, and thescannerMetadatalist. These define the verification work that must be repeated. - Parse active findings from
findings.json: rule ID, severity, WCAG, file/selector location, and remediation. - Detect the framework (Read
a11y-frameworkwhen the stack is known) so edits use correct syntax. - Read
a11y-issue-fixerand classify every finding using its tables — auto-fixable vs human-judgment.
Step 3: Apply fixes
Follow a11y-issue-fixer. Non-negotiables from that skill:
- Show the complete proposed batch and obtain confirmation before any edit.
- Never auto-add
alt=""to an image whose purpose is unknown. - Never change an ARIA role without first searching all JS/CSS selectors that reference it.
- Every human-judgment fix needs explicit approval before the edit.
For each fix, report Applied / Skipped (reason) / Needs approval with before/after snippets.
Step 4: Verify
-
Run the project linter and confirm the app still builds.
-
scannerMetadatais a list. For each page, use only entries withrunner: a11y-scan; CLI fallback entries are evidence, not configuration. Select the entry whosemodescontainsaxe. If multiple entries differ on any replay option, stop and ask which configuration is authoritative instead of choosing by list order. IfexecutedChecksByPagecontainsaxe, re-run Phase 1 with that entry'stags,selector,storageState,colorScheme,timeout,loadDelay,readiness.readySelector,readiness.stabilityWindow, andreadiness.bestEffortpolicy:node <a11y-playwright>/scripts/a11y-scan.mjs \ --url <URL> --mode axe,tree,coverage \ --tags <baseline-tags> [--selector <baseline-selector>] \ [--storage-state <baseline-storage-state>] \ --color-scheme <baseline-color-scheme> \ --timeout <baseline-timeout> \ --load-delay <baseline-load-delay> \ --stability-window <baseline-stability-window> \ [--ready-selector <baseline-ready-selector>] \ [--best-effort-readiness] \ --out $SCRATCH/scan-axe-page-<M>.jsonIf the replayed
scans.axe.statusis notokand the baseline metadata for this page containsrunner: axe-cli, also repeat the CLI fallback to$SCRATCH/scan-axe-cli-page-<M>.jsonand include it in normalization. -
From the page's metadata entries, union
modes. If that set containskeyboardorviewport, select the matchingrunner: a11y-scanentry using the same no-ambiguity rule. Re-run exactly those Phase 10 modes with itsstorageState,loadDelay, readiness options,viewports,maxTabs, andtimeoutto$SCRATCH/scan-playwright-page-<M>.json. -
Re-run every phase in
reviewedPhasesByPageand write immutable$SCRATCH/findings-agent-phase-<N>-page-<M>.jsonbatches. Runstatic-review.pywhen Phase 1 ran. -
Reuse the baseline run's
dismissals.jsonunchanged when it exists. -
Pass the complete rebuilt input set to
normalize-findings.pywith the baseline profile,--baseline $BASELINE, and--dismisswhen applicable. Write$RUN/findings.json. -
Run
export-findings.py --format summary; never calculate the delta or counts manually.
Step 5: Report
Write $RUN/ACCESSIBILITY-AUDIT.md with the generated summary and a
Fixes Applied section. Summarize inline:
Fixes applied: [count] ([auto] auto, [approved] approved)
Skipped: [count]
Verified by re-scan: [passed] / [attempted]
Score: [previous] -> [current] ([+/-] points)
Remaining: [count] requiring manual attention
Retain raw scans, delete $SCRATCH, and print the new report path.
Progress transparency
- Before starting: "Applying [N] fixes across [N] files ([N] auto-fixable, [N] need approval)"
- Per fix: issue, before/after, status
- On completion: "Fix pass complete: [N] applied, [N] skipped, [N] pending approval"
- On failure: "Fix failed for [file]:[line]: [reason]. File left unchanged."