a11y
npx skills add https://github.com/politician/a11y-skill --skill a11y
Agent 安装分布
Skill 文档
a11y skill (WCAG + RGAA 4.1.2)
This skill equips the agent to fix web pages against:
- RGAA 4.1.2 (French criteria/tests methodology)
- WCAG 2.1 alignment (RGAA 4.1.2 references WCAG success criteria and techniques)
It also equips the agent to propose extra hardening toward WCAG 2.2 (best-effort suggestions), even when those improvements are not strictly required by RGAA 4.1.2.
Primary source in this skill folder:
- Référentiel RGAA 4.1.2.md (authoritative for RGAA test wording/methodology)
When to use
Use this skill when the user asks to:
- fix accessibility issues (keyboard, focus, forms, ARIA, images, headings, contrastâ¦)
- map issues to RGAA theme/criterion/test (e.g. â1.1.1â, â7.3.1â, â11.10.1ââ¦)
- suggest improvements beyond RGAA (toward WCAG 2.2)
Non-goals / safety
- Do not claim full legal compliance for a whole site unless the user explicitly provides an official audit scope and asks for that.
- Do not invent RGAA test requirements: when in doubt, look up the exact test in the local referential file.
- Prefer semantic HTML over ARIA. Follow the âfirst rule of ARIAâ: use native elements whenever possible.
Minimal inputs to request (only if missing)
If the user did not provide these, ask briefly:
- Where the issue occurs (URL/route/file, component name)
- Expected behavior and how it fails (keyboard? screen reader? zoom? contrast?)
- Constraints (framework, design system, cannot change markup, etc.)
Default assumption if not provided: fix the issue in the files/pages in the current workspace, prioritizing RGAA 4.1.2 compatibility.
How to use the RGAA referential file
RGAA is structured: Thématique â Critère â Tests.
Locating a specific test
To avoid mistakes, locate tests by their identifier in the referential file:
- Search for headings like
#### 1.1.1(test) or### 1.1(criterion).
Recording results
For each applicable test, record:
- Status: Conforme / Non conforme / Non applicable
- Evidence: exact element(s), selector/DOM path, screenshot description, or reproduced steps
- Impact: which users are blocked and how (keyboard-only, screen reader, low vision, cognitiveâ¦)
- Fix: concrete code change(s) + verification step
Remediation workflow (RGAA-first)
1) Reproduce the issue
- Identify the failing UI and the interaction that breaks (keyboard sequence, SR announcement, zoom level, etc.).
- Confirm whether it is a markup issue (semantics/labels), a behavior issue (JS), or a styling issue (focus/contrast/layout).
2) Map to RGAA test(s)
- Find the exact test(s) in Référentiel RGAA 4.1.2.md
- Follow the test methodology steps to avoid over/under-fixing.
3) Implement the smallest correct fix
Priority order:
- Native HTML/semantics
- Keyboard and focus behavior
- Minimal ARIA (only if needed; must remain accurate over time)
4) Verify
- Keyboard-only verification
- âName / Role / Valueâ sanity check
- Regression check for nearby components
5) Suggest WCAG 2.2 improvements (bonus)
If relevant, propose enhancements aligning to WCAG 2.2 new success criteria (see section below).
Common remediation patterns (quick reference)
These are patterns; validate against the exact RGAA test(s) before finalizing.
Images (RGAA theme 1)
- Informative
<img>: provide an accessible name viaalt(prefer), oraria-label/aria-labelledby. - Decorative
<img>:alt=""and notitle,aria-label,aria-labelledby. - Informative
<svg>:role="img"+ accessible name (<title>oraria-label/aria-labelledby). - Decorative
<svg>:aria-hidden="true"and ensure no<title>/<desc>or labeling attributes.
Links and buttons (name/role/value)
- Use
<button>for actions;<a href>for navigation. - Ensure accessible name matches visible label (avoid
aria-labelthat contradicts visible text). - Avoid
div/spanwith click handlers; if unavoidable, add full keyboard support + role + focusability.
Forms
- Every control needs an explicit label:
<label for>or wrapping<label>. - Group related fields with
<fieldset><legend>. - Help text and errors: associate via
aria-describedby; ensure errors are programmatically determinable. - Required fields: use native
requiredwhere possible and expose requirement in text.
Headings and landmarks
- Ensure a logical heading hierarchy (
h1thenh2â¦; donât skip levels without reason). - Use landmarks (
<header>,<nav>,<main>,<footer>) appropriately. - Provide a skip link to main content if page has repeated navigation.
Keyboard and focus
- Visible focus indicator must not be removed.
- Modals/dialogs: focus moves into dialog, is trapped while open, ESC closes (if appropriate), focus returns.
- Donât use positive
tabindex(creates confusing tab order).
WCAG 2.2 âbonusâ fixes to suggest (beyond RGAA 4.1.2)
RGAA 4.1.2 is aligned to WCAG 2.1; WCAG 2.2 adds additional expectations that are often worth implementing.
When the user asks âgo beyond RGAAâ, prioritize these (when applicable):
Focus visibility and obstruction
- 2.4.11 Focus Not Obscured (Minimum) (AA): ensure focused element isnât hidden by sticky headers/footers, overlays, cookie banners.
- Typical fix: add
scroll-margin-topon focusable elements/anchors, or adjust sticky layout; ensure overlays donât cover focus.
- Typical fix: add
- (Optional) 2.4.12 (AAA) and 2.4.13 (AAA): improved focus appearance and non-obscured focus.
Dragging alternatives
- 2.5.7 Dragging Movements (AA): if an action requires drag (slider, drag-and-drop), provide a non-drag alternative (buttons, keyboard, stepper input).
Target size
- 2.5.8 Target Size (Minimum) (AA): ensure touch targets have sufficient size/spacing.
- Typical fix: increase padding/line-height, ensure clickable area matches visual affordance, avoid tiny icon-only targets.
Consistent help
- 3.2.6 Consistent Help (A): help mechanisms (contact link, chat, FAQ) should be placed consistently across pages where present.
Redundant entry
- 3.3.7 Redundant Entry (A): avoid requiring users to re-enter information already provided.
- Typical fix: auto-fill from previous step, provide âsame asâ checkbox, persist values.
Accessible authentication
- 3.3.8 Accessible Authentication (Minimum) (AA): donât rely on cognitive function tests (remembering passwords, puzzles) without alternatives.
- Typical fix: allow password managers/paste, use âemail magic linkâ, passkeys, or one-time codes; avoid blocking copy/paste.
- (Optional) 3.3.9 (AAA): stronger version.
Dynamic updates
- For inline status updates (e.g., âadded to cartâ), use a proper live region (
aria-live) when needed. - Donât spam screen readers: prefer
politefor non-critical updates.
Language
- Set
<html lang="â¦">for the default language. - Mark language changes in content with
lang.
Quality bar before declaring a fix âdoneâ
- The element has correct name/role/value in the accessibility tree.
- All functionality is reachable and operable with keyboard alone.
- Screen reader output is understandable (no duplicate/contradictory labels).
- RGAA tests that were failing are re-run and now pass.
How to communicate fixes (recommended)
When responding, include:
- RGAA test id(s) targeted
- What changed (file/component)
- Why it satisfies the test methodology
- A quick âhow to verifyâ checklist (keyboard + SR sanity)