--- name: a11y-page-audit description: > Run an accessibility and keyboard navigation audit on a web page or project, then fix what it finds — audit, fix, and verify, not just a report. Use whenever the user asks about accessibility, a11y, keyboard navigation, focus styles or focus management, screen readers, ARIA, WCAG compliance, skip links, tab order, or making a site keyboard-navigable before shipping. --- # Accessibility & Keyboard Navigation Audit Audit-then-fix workflow. The goal is to leave the codebase with working keyboard nav, visible focus indicators, correct semantics, and proper ARIA — not just a report. ## Phase 0 — Understand the target 1. **Input type**: directory → scan components, layouts, global CSS. URL → fetch HTML and flag that source fixes need the actual codebase. 2. **Framework**: determines where layouts, head tags, and route changes live. 3. **Design system**: tokens / CSS custom properties / Tailwind / component library — determines how to implement the focus ring. If ambiguous, ask one focused question before proceeding. ## Phase 1 — Audit & fix Work through each category: record file path, current state, verdict (✅ PASS / ⚠️ WARN / ❌ FAIL), then apply the fix pattern for every ❌ and ⚠️. ### 1.1 Global CSS resets **Check**: `* { outline: none }`, `*:focus { outline: none }`, or any blanket `outline: 0` without a paired visible alternative — the most common a11y regression. **Fix**: remove global outline resets. If a component legitimately needs a custom indicator (e.g. `box-shadow` ring on inputs), keep `outline: none` only when paired with a visible alternative using the focus token. ### 1.2 Focus ring system **Check**: is there a shared, theme-aware focus ring? - A design token / custom property for focus color that adapts between light and dark mode - Passes WCAG AA contrast for UI components (3:1) against each mode's background - A global `:focus-visible` rule applying the ring - Components aliasing the token rather than hardcoding hex values **Fix** — if missing, build it: 1. Add a system-level focus color token per theme. Pick from the existing palette when possible; each mode's value must pass 3:1 against that mode's background. If the brand palette has no passing color, use the closest passing color and document the override — don't sacrifice visibility for brand consistency. 2. Add component-level tokens aliasing it: `--focus-ring-color`, `--focus-ring-width: 2px`, `--focus-ring-offset: 2px`. 3. Add the global rule: ```css :focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: var(--focus-ring-offset); } ``` Do NOT set `border-radius` here — `outline` follows the element's existing radius automatically; setting it changes the element's shape on focus. 4. Re-point existing per-component focus tokens to alias the system color. ### 1.3 Interactive elements **Check** focus visibility and keyboard operability for: buttons (real `