--- name: a11y description: Accessibility audit + auto-fix (WCAG 2.2 A/AA). Scans built/static HTML for screen-reader, keyboard, and structure failures, fixes the deterministic ones, and escalates to a rendered scan for contrast and focus. Use when the user wants to check or improve accessibility, fix WCAG issues, or pass an a11y review. argument-hint: "" allowed-tools: Bash, Read, Edit, Grep, Glob paths: ["**/*.html", "**/*.htm", "**/index.html"] --- # Accessibility Audit + Auto-Fix (WCAG 2.2) AI builders ship accessibility violations by default — missing alt text, unlabeled inputs, icon-only buttons, no `lang`, broken heading order. These are legally consequential (ADA, EU Accessibility Act) and most are deterministically detectable and fixable. This skill finds them AND fixes them. ## Process ### Phase 1: Scan Run the static scanner on the project (point it at built/exported HTML, e.g. `dist/`, `build/`, `out/`, `.next/`, or `public/`): ```bash node ${CLAUDE_PLUGIN_ROOT}/tools/a11y-scanner.mjs ``` Parse the JSON: `findings[]` (`{ file, severity, category, rule, message }`), `summary` (counts by severity), and `scores.a11y` (0–100, or null when no HTML found). > **Many pages, each needing fixes?** Escalate to a **dynamic Workflow** (describe the audit and include the word "workflow") so scan → fix → verify runs across pages in parallel instead of one at a time. ### Phase 2: Report Present findings grouped by rule, highest severity first. Map each to its WCAG criterion (already in the message). Make clear which are auto-fixable now vs which need a rendered scan (Phase 4). ### Phase 3: Fix (use the Edit tool on the source files) Apply the deterministic fix for each finding. **Do not invent content** — for alt text and labels, derive from nearby context (filename, heading, surrounding copy, `name`/`placeholder`); if genuinely ambiguous, ask the user rather than guessing. | Rule | Fix | |---|---| | `html-missing-lang` / `html-empty-lang` | Add `lang="en"` (or the document's real language) to `` | | `img-missing-alt` | Add `alt=""` from context; use `alt=""` only if the image is purely decorative | | `input-image-missing-alt` | Add `alt=""` | | `control-missing-label` | Add a `