[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F78FHB7PSDC9BB05037C2A":3,"skill-same:01M7F78FHB7PSDC9BB05037C2A":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M7F78FHB7PSDC9BB05037C2A","accessibility",null,"Use when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles\u002Fnames\u002Flive regions, contrast, tap-target size. NOT palette or visual intent (that is `design`), NOT test-runner setup (that is `testing-web`), NOT LCP\u002Fpage-speed (that is `performance`).","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Faccessibility-ericrisco__rsc-harness\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: accessibility\ndescription: \"Use when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles\u002Fnames\u002Flive regions, contrast, tap-target size. NOT palette or visual intent (that is `design`), NOT test-runner setup (that is `testing-web`), NOT LCP\u002Fpage-speed (that is `performance`).\"\ntags: [wcag, accessibility, a11y, aria, axe-core]\nrecommends: [testing-web, e2e-testing, design, react, performance]\norigin: risco\n---\n\n# Accessibility — Ship WCAG 2.2 AA, not vibes\n\n*The bar is conformance to WCAG 2.2 Level AA. \"Looks fine to me\" is not a measurement. Fix the semantics, scan what a machine can scan, then walk the part it can't.*\n\n## The loop (your 30-second model)\n\nRun these in order. Skipping a step front-loads rework.\n\n1. **Native semantics first.** A real `\u003Cbutton>` ships focus, keyboard, and role for free. Most \"a11y bugs\" are a `\u003Cdiv>` doing a button's job.\n2. **Automated scan.** axe-core catches roughly **57%** of WCAG issues — missing labels, bad roles, contrast (in a real browser), duplicate ids. Cheap, run it every commit.\n3. **Manual checklist for the rest.** The other **~43%** — keyboard order, focus traps, meaningful alt text, screen-reader flow — no engine can judge. A human (or you, deliberately) must.\n\n**Decision rule: never ship on a green axe run alone.** A clean automated scan means \"no machine-detectable failures,\" not \"accessible.\" Treat it as necessary, never sufficient.\n\nLegal stakes are real: the EU **European Accessibility Act became enforceable 2025-06-28** for many consumer products and services, on top of EN 301 549 \u002F ADA. AA is the line.\n\n## Rule 0 — reach for HTML before ARIA\n\nThe first rule of ARIA is: **don't use ARIA.** If a native element gives you the semantics and behavior, use it. Every `role` you add is behavior you now owe by hand — focus, keyboard, state.\n\n```html\n\u003C!-- Bad: zero keyboard, no role, no focus, no Enter\u002FSpace -->\n\u003Cdiv class=\"btn\" onclick=\"save()\">Save\u003C\u002Fdiv>\n\n\u003C!-- Good: focusable, Enter\u002FSpace fire it, announced as \"Save, button\" -->\n\u003Cbutton type=\"button\" onclick=\"save()\">Save\u003C\u002Fbutton>\n```\n\n| You want…              | Use native…                | Not…                          |\n| ---------------------- | -------------------------- | ----------------------------- |\n| A click action         | `\u003Cbutton type=\"button\">`   | `\u003Cdiv role=\"button\" onClick>` |\n| Navigation             | `\u003Ca href=\"…\">`             | `\u003Cspan onClick>` + JS routing |\n| Show\u002Fhide section      | `\u003Cdetails>\u003Csummary>`       | hand-rolled `aria-expanded`   |\n| Form field             | `\u003Cinput>`\u002F`\u003Cselect>`       | contenteditable div           |\n| Modal                  | `\u003Cdialog>` + `showModal()` | a div with `role=\"dialog\"`    |\n\nReach for ARIA only when no native element fits (tabs, comboboxes, toasts) — and then copy a vetted pattern (→ `references\u002Faria-patterns.md`).\n\n## Semantics & accessible names\n\n- **One `\u003Ch1>` per page.** Headings describe structure; never skip a level (`\u003Ch2>` then `\u003Ch4>`) to get a font size — that's a CSS job.\n- **Landmark every region:** `\u003Cheader> \u003Cnav> \u003Cmain> \u003Cfooter>`. Exactly one `\u003Cmain>`. Screen-reader users jump by landmark; a wall of `\u003Cdiv>` has no map.\n- **Skip link first in the DOM** so keyboard users escape the nav: `\u003Ca href=\"#main\" class=\"sr-only-focusable\">Skip to content\u003C\u002Fa>`.\n- **Accessible name precedence** (what a screen reader announces), highest wins: `aria-labelledby` → `aria-label` → associated `\u003Clabel>` \u002F element text → `title`. Don't stack them hoping one sticks; pick one source.\n\n```html\n\u003C!-- Bad: announced as just \"button\" -->\n\u003Cbutton>\u003Csvg aria-hidden=\"true\">…\u003C\u002Fsvg>\u003C\u002Fbutton>\n\n\u003C!-- Good: announced as \"Close dialog, button\" -->\n\u003Cbutton aria-label=\"Close dialog\">\u003Csvg aria-hidden=\"true\">…\u003C\u002Fsvg>\u003C\u002Fbutton>\n```\n\nA `placeholder` is **not** a label — it vanishes on input and many SRs ignore it. Use a real `\u003Clabel for>`.\n\n## Keyboard operability\n\nEverything a mouse can do, a keyboard must do.\n\n- **All interactive elements reachable and operable** with Tab + Enter\u002FSpace. Native controls give this free; custom ones don't.\n- **Tab order follows the DOM.** Fix order by reordering markup, not by patching `tabindex`.\n- **Never a positive `tabindex`.** Only `0` (in natural order) or `-1` (focusable by script, skipped by Tab). A positive value hijacks the whole page's order and breaks the next dev's mental model.\n- **Visible focus, always** (see next section). If you can't tell where focus is with the mouse unplugged, neither can the user.\n\n**Overlays (dialogs, menus, drawers) need focus management** — three obligations:\n\n1. **Move focus in** when it opens (to the dialog or its first control).\n2. **Trap focus** inside while open — Tab from the last element wraps to the first.\n3. **Escape closes**, and **focus returns to the trigger** that opened it.\n\nComposite widgets (menus, tabs, grids) use **roving tabindex**: one element is `tabindex=\"0\"`, the rest `-1`, arrow keys move the `0`. Full keyboard tables per pattern — modal, disclosure, tabs, combobox, menu, toast → `references\u002Faria-patterns.md`.\n\n## Visible focus & the WCAG 2.2 deltas\n\n```css\n\u002F* Bad: kills the focus ring with nothing in its place *\u002F\n:focus { outline: none; }\n\n\u002F* Good: ring only for keyboard users, not mouse clicks *\u002F\n:focus-visible { outline: 3px solid; outline-offset: 2px; }\n```\n\nWCAG 2.2 (W3C Recommendation, 2023-10-05) **adds 9 success criteria and removes 4.1.1 Parsing**. The six that matter at **Level AA** — know the numbers:\n\n- **2.4.11 Focus Not Obscured (Minimum)** — a focused element must not be fully hidden behind sticky headers\u002Ffooters or cookie bars.\n- **2.5.7 Dragging Movements** — anything done by dragging (sliders, reorder, map pan) needs a single-pointer alternative (tap, buttons).\n- **2.5.8 Target Size (Minimum)** — interactive targets are at least **24×24 CSS px**, unless spacing keeps a 24px-radius circle from overlapping a neighbor (the spacing exception). 44×44 is the comfort bar; 24 is the floor.\n- **3.2.6 Consistent Help** — help mechanisms appear in the same relative order across pages.\n- **3.3.7 Redundant Entry** — don't make users re-enter info they already gave in the same process; auto-fill or let them pick it.\n- **3.3.8 Accessible Authentication (Minimum)** — no cognitive-function test to log in (no puzzles, no \"transcribe this\", no math). Allow paste, password managers, and copy.\n\n## Contrast & color\n\nMeasured ratios, AA minimums:\n\n- **4.5:1** for normal text.\n- **3:1** for large text (**≥24px**, or **≥18.66px bold**).\n- **3:1** for UI components and graphical objects you must perceive (1.4.11) — input borders, icon glyphs, chart segments.\n\n**Never encode meaning in color alone** (1.4.1). A red border on an invalid field is invisible to many users — pair it with text and an icon.\n\n```html\n\u003C!-- Bad: only color signals the error -->\n\u003Cinput class=\"border-red-500\" aria-invalid=\"true\">\n\n\u003C!-- Good: text + icon + programmatic association -->\n\u003Cinput aria-invalid=\"true\" aria-describedby=\"email-err\">\n\u003Cp id=\"email-err\">⚠ Enter a valid email address.\u003C\u002Fp>\n```\n\nNote: **jsdom can't compute contrast** (no real layout\u002Fpaint), so jest-axe disables the rule. Verify contrast in a real browser (Playwright \u002F Lighthouse) or by hand.\n\n## ARIA done right\n\nMental model: **Name, Role, Value.** Every custom control needs an accessible *name*, the right *role*, and current *state\u002Fvalue* — and you must keep state in sync.\n\n- **State attributes:** `aria-expanded` on a disclosure trigger, `aria-controls` pointing at what it toggles, `aria-selected` \u002F `aria-current` for the active item. Toggle them in the same handler that changes the visual state.\n- **Live regions** announce async changes without moving focus:\n  - `aria-live=\"polite\"` — wait for a pause (status, \"Saved\", search-result counts). Default choice.\n  - `aria-live=\"assertive\"` — interrupt now (form submit error, session-expiry). Use sparingly.\n- **Hiding — pick the right one:**\n\n| Technique          | Visual | Screen reader | Use for                                   |\n| ------------------ | ------ | ------------- | ----------------------------------------- |\n| `display:none`     | gone   | gone          | truly removed content                     |\n| `aria-hidden=true` | shown  | hidden        | decorative visuals — **never on a focusable element** |\n| `.sr-only` class   | hidden | read          | labels\u002Fskip links for SR users only       |\n\n```html\n\u003C!-- Bad: focusable AND hidden from SR = a keyboard trap nobody can hear -->\n\u003Cbutton aria-hidden=\"true\">Menu\u003C\u002Fbutton>\n\n\u003C!-- Good: decorative icon hidden, the button keeps its name -->\n\u003Cbutton aria-label=\"Menu\">\u003Csvg aria-hidden=\"true\">…\u003C\u002Fsvg>\u003C\u002Fbutton>\n```\n\n## Automate it (versioned, 2026-06-02)\n\nThree layers — each catches what the cheaper one can't.\n\n**Lint (static, JSX only) — `eslint-plugin-jsx-a11y` 6.10.2.** Catches missing `alt`, label-less inputs, positive `tabindex`, invalid roles, at edit time.\n\n```jsonc\n\u002F\u002F .eslintrc — extends, then runs in your existing lint step\n{ \"extends\": [\"plugin:jsx-a11y\u002Frecommended\"] }\n```\n\n**Unit (fast, no browser) — `jest-axe` 10.0.0.** Asserts no axe violations on rendered output. Remember: **contrast is off in jsdom.**\n\n```js\nimport { axe, toHaveNoViolations } from \"jest-axe\";\nexpect.extend(toHaveNoViolations);\n\ntest(\"no a11y violations\", async () => {\n  const { container } = render(\u003CSignupForm \u002F>);\n  expect(await axe(container)).toHaveNoViolations();\n});\n```\n\n**Browser (the real thing, catches contrast) — `@axe-core\u002Fplaywright` 4.11.3** (on `axe-core` 4.12.0). Scope it to the WCAG 2.2 AA tags:\n\n```js\nimport AxeBuilder from \"@axe-core\u002Fplaywright\";\n\nconst results = await new AxeBuilder({ page })\n  .withTags([\"wcag2a\", \"wcag2aa\", \"wcag22aa\"])\n  .analyze();\nexpect(results.violations).toEqual([]);\n```\n\n**Lighthouse a11y score** is a smoke signal for a quick pulse, not proof — it runs a subset of axe and gives a number, not a pass.\n\n`scripts\u002Fverify.sh` ties this together: it detects whatever tooling the project has and runs it, failing only on serious\u002Fcritical violations (read-only, skips cleanly when no tooling is present).\n\n## Manual checklist (the ~43% a machine can't see)\n\nDo these by hand before you call it done:\n\n- [ ] **Unplug the mouse.** Tab through the entire flow — every control reachable, order logical, focus always visible, no trap, Escape closes overlays.\n- [ ] **One screen-reader spot check** — VoiceOver (macOS, ⌘F5) or NVDA (Windows). Do names, roles, and state read sensibly? Are errors announced?\n- [ ] **Zoom to 200%** — no content lost, no horizontal scroll, nothing clipped.\n- [ ] **`prefers-reduced-motion`** honored — no autoplay parallax\u002Fanimation that ignores it.\n- [ ] **Alt text is meaningful, not decorative-as-content** — informative images describe; decorative images use `alt=\"\"`.\n\nFull AA checklist grouped by POUR, with the per-item auto\u002Fmanual split and the 6 new 2.2 criteria flagged → `references\u002Fwcag22-checklist.md`.\n\n## Anti-patterns\n\n| Anti-pattern                                   | Why it fails                                              | Do instead                                          |\n| ---------------------------------------------- | -------------------------------------------------------- | --------------------------------------------------- |\n| `\u003Cdiv role=\"button\" onClick>`                  | No keyboard, no focus, you owe all behavior by hand      | `\u003Cbutton>`                                          |\n| `outline: none` with no replacement            | Keyboard users lose all focus location (2.4.7)           | `:focus-visible` ring                               |\n| Positive `tabindex` (`tabindex=\"3\"`)           | Hijacks page tab order, breaks for everyone              | DOM order + `tabindex=\"0\"`\u002F`-1`                      |\n| Placeholder as the only label                  | Disappears on input, many SRs skip it                    | real `\u003Clabel for>`                                  |\n| `aria-label` on a non-interactive `\u003Cdiv>` text | Duplicates or overrides visible text confusingly         | label only interactive\u002Flandmark elements            |\n| `aria-hidden=\"true\"` on a focusable element    | Reachable by Tab but silent — a trap                     | remove from tab order too, or don't hide it         |\n| Error shown by red color only                  | Invisible to color-blind \u002F low-vision users (1.4.1)      | color **+** text **+** icon, `aria-describedby`     |\n| Redundant `role=\"button\"` on `\u003Cbutton>`        | Noise; native role is already correct                    | drop the role                                       |\n| Shipping on a green axe run                    | Covers ~57%; keyboard\u002FSR\u002Fcognitive untested              | run the manual checklist                            |\n| Autoplaying motion, no reduced-motion guard    | Triggers vestibular disorders (2.3.3)                    | gate behind `prefers-reduced-motion`                |\n\n## Hand off to\n\n- Test harness, render setup, fixtures, CI runner mechanics → `..\u002Ftesting-web\u002FSKILL.md` (this skill supplies the a11y *assertions* that run inside it)\n- Full browser-driven flow orchestration → `..\u002Fe2e-testing\u002FSKILL.md`\n- Visual intent, color palette, spacing scale → `..\u002Fdesign\u002FSKILL.md` (this skill checks the contrast\u002Ftarget-size *outcome*, not the aesthetic)\n- Framework component architecture → `..\u002Freact\u002FSKILL.md` \u002F `..\u002Fnextjs\u002FSKILL.md`\n- Page speed \u002F LCP \u002F Core Web Vitals tuning → the **performance** skill (not an a11y concern)\n","# Accessibility — Ship WCAG 2.2 AA, not vibes\n\n*The bar is conformance to WCAG 2.2 Level AA. \"Looks fine to me\" is not a measurement. Fix the semantics, scan what a machine can scan, then walk the part it can't.*\n\n## The loop (your 30-second model)\n\nRun these in order. Skipping a step front-loads rework.\n\n1. **Native semantics first.** A real `\u003Cbutton>` ships focus, keyboard, and role for free. Most \"a11y bugs\" are a `\u003Cdiv>` doing a button's job.\n2. **Automated scan.** axe-core catches roughly **57%** of WCAG issues — missing labels, bad roles, contrast (in a real browser), duplicate ids. Cheap, run it every commit.\n3. **Manual checklist for the rest.** The other **~43%** — keyboard order, focus traps, meaningful alt text, screen-reader flow — no engine can judge. A human (or you, deliberately) must.\n\n**Decision rule: never ship on a green axe run alone.** A clean automated scan means \"no machine-detectable failures,\" not \"accessible.\" Treat it as necessary, never sufficient.\n\nLegal stakes are real: the EU **European Accessibility Act became enforceable 2025-06-28** for many consumer products and services, on top of EN 301 549 \u002F ADA. AA is the line.\n\n## Rule 0 — reach for HTML before ARIA\n\nThe first rule of ARIA is: **don't use ARIA.** If a native element gives you the semantics and behavior, use it. Every `role` you add is behavior you now owe by hand — focus, keyboard, state.\n\n```html\n\u003C!-- Bad: zero keyboard, no role, no focus, no Enter\u002FSpace -->\n\u003Cdiv class=\"btn\" onclick=\"save()\">Save\u003C\u002Fdiv>\n\n\u003C!-- Good: focusable, Enter\u002FSpace fire it, announced as \"Save, button\" -->\n\u003Cbutton type=\"button\" onclick=\"save()\">Save\u003C\u002Fbutton>\n```\n\n| You want…              | Use native…                | Not…                          |\n| ---------------------- | -------------------------- | ----------------------------- |\n| A click action         | `\u003Cbutton type=\"button\">`   | `\u003Cdiv role=\"button\" onClick>` |\n| Navigation             | `\u003Ca href=\"…\">`             | `\u003Cspan onClick>` + JS routing |\n| Show\u002Fhide section      | `\u003Cdetails>\u003Csummary>`       | hand-rolled `aria-expanded`   |\n| Form field             | `\u003Cinput>`\u002F`\u003Cselect>`       | contenteditable div           |\n| Modal                  | `\u003Cdialog>` + `showModal()` | a div with `role=\"dialog\"`    |\n\nReach for ARIA only when no native element fits (tabs, comboboxes, toasts) — and then copy a vetted pattern (→ `references\u002Faria-patterns.md`).\n\n## Semantics & accessible names\n\n- **One `\u003Ch1>` per page.** Headings describe structure; never skip a level (`\u003Ch2>` then `\u003Ch4>`) to get a font size — that's a CSS job.\n- **Landmark every region:** `\u003Cheader> \u003Cnav> \u003Cmain> \u003Cfooter>`. Exactly one `\u003Cmain>`. Screen-reader users jump by landmark; a wall of `\u003Cdiv>` has no map.\n- **Skip link first in the DOM** so keyboard users escape the nav: `\u003Ca href=\"#main\" class=\"sr-only-focusable\">Skip to content\u003C\u002Fa>`.\n- **Accessible name precedence** (what a screen reader announces), highest wins: `aria-labelledby` → `aria-label` → associated `\u003Clabel>` \u002F element text → `title`. Don't stack them hoping one sticks; pick one source.\n\n```html\n\u003C!-- Bad: announced as just \"button\" -->\n\u003Cbutton>\u003Csvg aria-hidden=\"true\">…\u003C\u002Fsvg>\u003C\u002Fbutton>\n\n\u003C!-- Good: announced as \"Close dialog, button\" -->\n\u003Cbutton aria-label=\"Close dialog\">\u003Csvg aria-hidden=\"true\">…\u003C\u002Fsvg>\u003C\u002Fbutton>\n```\n\nA `placeholder` is **not** a label — it vanishes on input and many SRs ignore it. Use a real `\u003Clabel for>`.\n\n## Keyboard operability\n\nEverything a mouse can do, a keyboard must do.\n\n- **All interactive elements reachable and operable** with Tab + Enter\u002FSpace. Native controls give this free; custom ones don't.\n- **Tab order follows the DOM.** Fix order by reordering markup, not by patching `tabindex`.\n- **Never a positive `tabindex`.** Only `0` (in natural order) or `-1` (focusable by script, skipped by Tab). A positive value hijacks the whole page's order and breaks the next dev's mental model.\n- **Visible focus, always** (see next section). If you can't tell where focus is with the mouse unplugged, neither can the user.\n\n**Overlays (dialogs, menus, drawers) need focus management** — three obligations:\n\n1. **Move focus in** when it opens (to the dialog or its first control).\n2. **Trap focus** inside while open — Tab from the last element wraps to the first.\n3. **Escape closes**, and **focus returns to the trigger** that opened it.\n\nComposite widgets (menus, tabs, grids) use **roving tabindex**: one element is `tabindex=\"0\"`, the rest `-1`, arrow keys move the `0`. Full keyboard tables per pattern — modal, disclosure, tabs, combobox, menu, toast → `references\u002Faria-patterns.md`.\n\n## Visible focus & the WCAG 2.2 deltas\n\n```css\n\u002F* Bad: kills the focus ring with nothing in its place *\u002F\n:focus { outline: none; }\n\n\u002F* Good: ring only for keyboard users, not mouse clicks *\u002F\n:focus-visible { outline: 3px solid; outline-offset: 2px; }\n```\n\nWCAG 2.2 (W3C Recommendation, 2023-10-05) **adds 9 success criteria and removes 4.1.1 Parsing**. The six that matter at **Level AA** — know the numbers:\n\n- **2.4.11 Focus Not Obscured (Minimum)** — a focused element must not be fully hidden behind sticky headers\u002Ffooters or cookie bars.\n- **2.5.7 Dragging Movements** — anything done by dragging (sliders, reorder, map pan) needs a single-pointer alternative (tap, buttons).\n- **2.5.8 Target Size (Minimum)** — interactive targets are at least **24×24 CSS px**, unless spacing keeps a 24px-radius circle from overlapping a neighbor (the spacing exception). 44×44 is the comfort bar; 24 is the floor.\n- **3.2.6 Consistent Help** — help mechanisms appear in the same relative order across pages.\n- **3.3.7 Redundant Entry** — don't make users re-enter info they already gave in the same process; auto-fill or let them pick it.\n- **3.3.8 Accessible Authentication (Minimum)** — no cognitive-function test to log in (no puzzles, no \"transcribe this\", no math). Allow paste, password managers, and copy.\n\n## Contrast & color\n\nMeasured ratios, AA minimums:\n\n- **4.5:1** for normal text.\n- **3:1** for large text (**≥24px**, or **≥18.66px bold**).\n- **3:1** for UI components and graphical objects you must perceive (1.4.11) — input borders, icon glyphs, chart segments.\n\n**Never encode meaning in color alone** (1.4.1). A red border on an invalid field is invisible to many users — pair it with text and an icon.\n\n```html\n\u003C!-- Bad: only color signals the error -->\n\u003Cinput class=\"border-red-500\" aria-invalid=\"true\">\n\n\u003C!-- Good: text + icon + programmatic association -->\n\u003Cinput aria-invalid=\"true\" aria-describedby=\"email-err\">\n\u003Cp id=\"email-err\">⚠ Enter a valid email address.\u003C\u002Fp>\n```\n\nNote: **jsdom can't compute contrast** (no real layout\u002Fpaint), so jest-axe disables the rule. Verify contrast in a real browser (Playwright \u002F Lighthouse) or by hand.\n\n## ARIA done right\n\nMental model: **Name, Role, Value.** Every custom control needs an accessible *name*, the right *role*, and current *state\u002Fvalue* — and you must keep state in sync.\n\n- **State attributes:** `aria-expanded` on a disclosure trigger, `aria-controls` pointing at what it toggles, `aria-selected` \u002F `aria-current` for the active item. Toggle them in the same handler that changes the visual state.\n- **Live regions** announce async changes without moving focus:\n  - `aria-live=\"polite\"` — wait for a pause (status, \"Saved\", search-result counts). Default choice.\n  - `aria-live=\"assertive\"` — interrupt now (form submit error, session-expiry). Use sparingly.\n- **Hiding — pick the right one:**\n\n| Technique          | Visual | Screen reader | Use for                                   |\n| ------------------ | ------ | ------------- | ----------------------------------------- |\n| `display:none`     | gone   | gone          | truly removed content                     |\n| `aria-hidden=true` | shown  | hidden        | decorative visuals — **never on a focusable element** |\n| `.sr-only` class   | hidden | read          | labels\u002Fskip links for SR users only       |\n\n```html\n\u003C!-- Bad: focusable AND hidden from SR = a keyboard trap nobody can hear -->\n\u003Cbutton aria-hidden=\"true\">Menu\u003C\u002Fbutton>\n\n\u003C!-- Good: decorative icon hidden, the button keeps its name -->\n\u003Cbutton aria-label=\"Menu\">\u003Csvg aria-hidden=\"true\">…\u003C\u002Fsvg>\u003C\u002Fbutton>\n```\n\n## Automate it (versioned, 2026-06-02)\n\nThree layers — each catches what the cheaper one can't.\n\n**Lint (static, JSX only) — `eslint-plugin-jsx-a11y` 6.10.2.** Catches missing `alt`, label-less inputs, positive `tabindex`, invalid roles, at edit time.\n\n```jsonc\n\u002F\u002F .eslintrc — extends, then runs in your existing lint step\n{ \"extends\": [\"plugin:jsx-a11y\u002Frecommended\"] }\n```\n\n**Unit (fast, no browser) — `jest-axe` 10.0.0.** Asserts no axe violations on rendered output. Remember: **contrast is off in jsdom.**\n\n```js\nimport { axe, toHaveNoViolations } from \"jest-axe\";\nexpect.extend(toHaveNoViolations);\n\ntest(\"no a11y violations\", async () => {\n  const { container } = render(\u003CSignupForm \u002F>);\n  expect(await axe(container)).toHaveNoViolations();\n});\n```\n\n**Browser (the real thing, catches contrast) — `@axe-core\u002Fplaywright` 4.11.3** (on `axe-core` 4.12.0). Scope it to the WCAG 2.2 AA tags:\n\n```js\nimport AxeBuilder from \"@axe-core\u002Fplaywright\";\n\nconst results = await new AxeBuilder({ page })\n  .withTags([\"wcag2a\", \"wcag2aa\", \"wcag22aa\"])\n  .analyze();\nexpect(results.violations).toEqual([]);\n```\n\n**Lighthouse a11y score** is a smoke signal for a quick pulse, not proof — it runs a subset of axe and gives a number, not a pass.\n\n`scripts\u002Fverify.sh` ties this together: it detects whatever tooling the project has and runs it, failing only on serious\u002Fcritical violations (read-only, skips cleanly when no tooling is present).\n\n## Manual checklist (the ~43% a machine can't see)\n\nDo these by hand before you call it done:\n\n- [ ] **Unplug the mouse.** Tab through the entire flow — every control reachable, order logical, focus always visible, no trap, Escape closes overlays.\n- [ ] **One screen-reader spot check** — VoiceOver (macOS, ⌘F5) or NVDA (Windows). Do names, roles, and state read sensibly? Are errors announced?\n- [ ] **Zoom to 200%** — no content lost, no horizontal scroll, nothing clipped.\n- [ ] **`prefers-reduced-motion`** honored — no autoplay parallax\u002Fanimation that ignores it.\n- [ ] **Alt text is meaningful, not decorative-as-content** — informative images describe; decorative images use `alt=\"\"`.\n\nFull AA checklist grouped by POUR, with the per-item auto\u002Fmanual split and the 6 new 2.2 criteria flagged → `references\u002Fwcag22-checklist.md`.\n\n## Anti-patterns\n\n| Anti-pattern                                   | Why it fails                                              | Do instead                                          |\n| ---------------------------------------------- | -------------------------------------------------------- | --------------------------------------------------- |\n| `\u003Cdiv role=\"button\" onClick>`                  | No keyboard, no focus, you owe all behavior by hand      | `\u003Cbutton>`                                          |\n| `outline: none` with no replacement            | Keyboard users lose all focus location (2.4.7)           | `:focus-visible` ring                               |\n| Positive `tabindex` (`tabindex=\"3\"`)           | Hijacks page tab order, breaks for everyone              | DOM order + `tabindex=\"0\"`\u002F`-1`                      |\n| Placeholder as the only label                  | Disappears on input, many SRs skip it                    | real `\u003Clabel for>`                                  |\n| `aria-label` on a non-interactive `\u003Cdiv>` text | Duplicates or overrides visible text confusingly         | label only interactive\u002Flandmark elements            |\n| `aria-hidden=\"true\"` on a focusable element    | Reachable by Tab but silent — a trap                     | remove from tab order too, or don't hide it         |\n| Error shown by red color only                  | Invisible to color-blind \u002F low-vision users (1.4.1)      | color **+** text **+** icon, `aria-describedby`     |\n| Redundant `role=\"button\"` on `\u003Cbutton>`        | Noise; native role is already correct                    | drop the role                                       |\n| Shipping on a green axe run                    | Covers ~57%; keyboard\u002FSR\u002Fcognitive untested              | run the manual checklist                            |\n| Autoplaying motion, no reduced-motion guard    | Triggers vestibular disorders (2.3.3)                    | gate behind `prefers-reduced-motion`                |\n\n## Hand off to\n\n- Test harness, render setup, fixtures, CI runner mechanics → `..\u002Ftesting-web\u002FSKILL.md` (this skill supplies the a11y *assertions* that run inside it)\n- Full browser-driven flow orchestration → `..\u002Fe2e-testing\u002FSKILL.md`\n- Visual intent, color palette, spacing scale → `..\u002Fdesign\u002FSKILL.md` (this skill checks the contrast\u002Ftarget-size *outcome*, not the aesthetic)\n- Framework component architecture → `..\u002Freact\u002FSKILL.md` \u002F `..\u002Fnextjs\u002FSKILL.md`\n- Page speed \u002F LCP \u002F Core Web Vitals tuning → the **performance** skill (not an a11y concern)\n",{"name":5,"tags":24,"origin":29,"recommends":30,"description":7},[25,5,26,27,28],"wcag","a11y","aria","axe-core","risco",[31,32,33,34,35],"testing-web","e2e-testing","design","react","performance","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Faccessibility-ericrisco__rsc-harness",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill accessibility",{"tool":50,"command":51},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill accessibility",{"tool":53,"command":54},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill accessibility","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Faccessibility-ericrisco__rsc-harness\u002FSKILL.md",true,[58,64,68,72],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"evals\u002Fcases.yaml","REFERENCE","参考文档",3020,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Faccessibility-ericrisco__rsc-harness\u002Fevals\u002Fcases.yaml",{"path":65,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":66,"sourceHtmlUrl":67},"evals\u002FREADME.md",1189,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Faccessibility-ericrisco__rsc-harness\u002Fevals\u002FREADME.md",{"path":69,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Faria-patterns.md",5211,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Faccessibility-ericrisco__rsc-harness\u002Freferences\u002Faria-patterns.md",{"path":73,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fwcag22-checklist.md",6590,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Faccessibility-ericrisco__rsc-harness\u002Freferences\u002Fwcag22-checklist.md",[77,84,89,96,103,110],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":85,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]