ultra11y 6.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.opencode/plugins/ultra11y.js +1 -1
  5. package/README.md +115 -643
  6. package/dist/cypress-plugin.mjs +6 -3
  7. package/dist/jest.cjs +199 -0
  8. package/dist/jest.d.ts +24 -0
  9. package/dist/jest.mjs +167 -0
  10. package/dist/playwright.mjs +6 -3
  11. package/dist/unit-C7c8k68J.d.ts +51 -0
  12. package/dist/vitest.d.ts +25 -0
  13. package/dist/vitest.mjs +167 -0
  14. package/package.json +12 -6
  15. package/scripts/ultra11y.mjs +1974 -8012
  16. package/skills/review-a11y/SKILL.md +1 -1
  17. package/skills/review-a11y/scripts/ultra11y.mjs +1974 -8012
  18. package/skills/ultra11y/SKILL.md +26 -43
  19. package/skills/ultra11y/references/automation.md +7 -28
  20. package/skills/ultra11y/references/ci.md +9 -51
  21. package/skills/ultra11y/references/dynamic.md +28 -39
  22. package/skills/ultra11y/references/e2e.md +10 -24
  23. package/skills/ultra11y/references/false-positives.md +1 -1
  24. package/skills/ultra11y/references/focus-and-logic.md +1 -1
  25. package/skills/ultra11y/references/full-audit.md +25 -12
  26. package/skills/ultra11y/references/guidance.md +2 -2
  27. package/skills/ultra11y/references/harnesses.md +15 -38
  28. package/skills/ultra11y/references/judgment.md +9 -40
  29. package/skills/ultra11y/references/media-and-motion.md +1 -1
  30. package/skills/ultra11y/references/methodology.md +3 -3
  31. package/skills/ultra11y/references/orchestrators.md +5 -6
  32. package/skills/ultra11y/references/packs.md +5 -7
  33. package/skills/ultra11y/references/pages.md +3 -36
  34. package/skills/ultra11y/references/prd.md +0 -4
  35. package/skills/ultra11y/references/rendered.md +47 -2
  36. package/skills/ultra11y/references/runbook.md +18 -25
  37. package/skills/ultra11y/references/standards.md +5 -2
  38. package/skills/ultra11y/references/tickets.md +1 -1
  39. package/skills/ultra11y/scripts/ultra11y.mjs +1974 -8012
  40. package/src/adjudicate.ts +27 -13
  41. package/src/adjudication-data.ts +2 -3
  42. package/src/audit.ts +52 -10
  43. package/src/auditor.ts +4 -0
  44. package/src/axe-map.ts +2 -2
  45. package/src/baseline.ts +6 -50
  46. package/src/capture.ts +89 -1
  47. package/src/cli.ts +247 -1672
  48. package/src/config.ts +1 -1
  49. package/src/crawl.ts +1 -1
  50. package/src/criteria.ts +83 -0
  51. package/src/discover.ts +16 -4
  52. package/src/evidence.ts +1 -1
  53. package/src/fix.ts +4 -0
  54. package/src/gh-cli.ts +2 -4
  55. package/src/glob.ts +62 -2
  56. package/src/graph/build.ts +7 -1
  57. package/src/graph/spec-resolve.ts +1 -1
  58. package/src/html-emit.ts +1 -11
  59. package/src/init.ts +9 -92
  60. package/src/install/agents-md.ts +1 -2
  61. package/src/integrations/core.ts +12 -5
  62. package/src/integrations/jest.ts +34 -0
  63. package/src/integrations/payload.ts +20 -2
  64. package/src/integrations/unit.ts +210 -0
  65. package/src/integrations/vitest.ts +35 -0
  66. package/src/md.ts +1 -1
  67. package/src/output.ts +5 -1
  68. package/src/pages.ts +3 -3
  69. package/src/parse/html.ts +14 -0
  70. package/src/parse/snap.ts +460 -0
  71. package/src/parse/source.ts +8 -0
  72. package/src/prd.ts +7 -65
  73. package/src/probes.ts +1 -1
  74. package/src/render.ts +2 -2
  75. package/src/report.ts +12 -4
  76. package/src/rules/cross-rule.ts +2 -2
  77. package/src/rules/rendered.ts +2 -2
  78. package/src/rules/rule.ts +17 -2
  79. package/src/scan-local.ts +18 -26
  80. package/src/scan.ts +16 -337
  81. package/src/site-data.ts +0 -2
  82. package/src/snapshot.ts +1 -1
  83. package/src/standards/derive.ts +3 -4
  84. package/src/standards/document.ts +4 -4
  85. package/src/standards/pack-rules.ts +2 -2
  86. package/src/standards/registry.ts +6 -9
  87. package/src/tickets/grain.ts +2 -5
  88. package/src/tickets/http.ts +1 -1
  89. package/src/tickets/render.ts +1 -24
  90. package/src/tickets/types.ts +0 -2
  91. package/src/types.ts +26 -18
  92. package/src/util.ts +5 -5
  93. package/src/verdict-rules.ts +2 -1
  94. package/src/verify.ts +4 -136
  95. package/src/walk.ts +2 -3
  96. package/docker/Dockerfile +0 -7
  97. package/docker/package.json +0 -9
  98. package/docker/runner.mjs +0 -49
  99. package/skills/ultra11y/references/devtools.md +0 -67
  100. package/skills/ultra11y/references/mcp.md +0 -232
  101. package/src/affected.ts +0 -512
  102. package/src/agent-cli.ts +0 -374
  103. package/src/agent-codex.ts +0 -257
  104. package/src/annotate.ts +0 -1070
  105. package/src/criteria-view.ts +0 -473
  106. package/src/dev.ts +0 -424
  107. package/src/e2e.ts +0 -320
  108. package/src/external/adapters/ara.ts +0 -164
  109. package/src/external/diff.ts +0 -143
  110. package/src/external/registry.ts +0 -22
  111. package/src/external/types.ts +0 -59
  112. package/src/lite.ts +0 -324
  113. package/src/llm.ts +0 -424
  114. package/src/mcp/handlers.ts +0 -822
  115. package/src/mcp/http.ts +0 -260
  116. package/src/mcp/prompts.ts +0 -194
  117. package/src/mcp/protocol.ts +0 -186
  118. package/src/mcp/resources.ts +0 -135
  119. package/src/mcp/server.ts +0 -242
  120. package/src/mcp/standards-resources.ts +0 -174
  121. package/src/mcp/stdio.ts +0 -119
  122. package/src/mcp/tools.ts +0 -590
  123. package/src/method-view.ts +0 -234
  124. package/src/pr-comment.ts +0 -114
  125. package/src/project-lock.ts +0 -42
  126. package/src/sarif.ts +0 -230
package/README.md CHANGED
@@ -1,672 +1,144 @@
1
- # ultra11y — RGAA 4.1.2 accessibility audits, on a WCAG 2.2 AA core
1
+ # ultra11y — l’audit d’accessibilité RGAA 4.1.2
2
2
 
3
3
  [![CI](https://github.com/SocialGouv/ultra11y/actions/workflows/ci.yml/badge.svg)](https://github.com/SocialGouv/ultra11y/actions/workflows/ci.yml)
4
4
  [![npm](https://img.shields.io/npm/v/ultra11y?logo=npm)](https://www.npmjs.com/package/ultra11y)
5
- [![agent plugin](https://img.shields.io/badge/Claude_Code_·_Codex_·_OpenCode-plugin-6b46c1)](#add-to-your-coding-agent)
5
+ [![plugin](https://img.shields.io/badge/Claude_Code_·_Codex_·_OpenCode-plugin-6b46c1)](#installer)
6
6
  [![node](https://img.shields.io/node/v/ultra11y)](https://nodejs.org)
7
- [![license](https://img.shields.io/npm/l/ultra11y)](LICENSE)
7
+ [![licence](https://img.shields.io/npm/l/ultra11y)](LICENSE)
8
8
 
9
- **Documentation (in French): [socialgouv.github.io/ultra11y](https://socialgouv.github.io/ultra11y/)** — what the tool does, what it cannot check, criterion-by-criterion RGAA coverage and how it is tested, with every number generated from the code.
9
+ ultra11y audite un site selon le **RGAA 4.1.2**, le référentiel d’accessibilité de l’État.
10
+ C’est une *skill* pour votre agent de code (Claude Code, Codex, OpenCode) : vous demandez
11
+ un audit, l’agent le mène de bout en bout et vous remet un **rapport de conformité daté**.
12
+ **Il ne déclare jamais conforme ce qu’il n’a pas vérifié.**
10
13
 
11
- ### Add to your coding agent
14
+ Ce que vous obtenez :
12
15
 
13
- Two lines, and the accessibility review runs **by itself** before every commit, push and
14
- pull request — you never type the skill's name:
16
+ - le rapport RGAA daté, en Markdown et en HTML imprimable ;
17
+ - la grille des **106 critères**, page par page, avec le taux de conformité de chaque page
18
+ et le taux moyen de l’échantillon, les chiffres qu’attend une déclaration d’accessibilité ;
19
+ - un dossier par page, avec capture d’écran et chaque non-conformité illustrée ;
20
+ - sur demande, un backlog et des tickets GitHub, GitLab ou Jira.
15
21
 
16
- | | |
17
- |---|---|
18
- | **Claude Code** | `/plugin marketplace add SocialGouv/ultra11y` then `/plugin install ultra11y@ultra11y` |
19
- | **OpenAI Codex CLI** | `codex plugin marketplace add SocialGouv/ultra11y` then `codex plugin add ultra11y@ultra11y` |
20
- | **OpenCode** 1.x and 2.x | `npx ultra11y install --opencode` — or pin `"plugins": ["ultra11y@latest"]` in `opencode.json` (OpenCode 1: `"plugin"`) |
21
- | **Anything else** | `npx ultra11y install --agents-md` (no hook API: see the caveat below) |
22
-
23
- <sub>Prefer the skills only, without the automatic hook? `npx skills add SocialGouv/ultra11y`
24
- (`--agent codex`, `--agent opencode`, …). Already on npm and just want the gate?
25
- `npx ultra11y install --all`, and `npx ultra11y status` to check what is actually wired.
26
- Full details, thresholds and off-switches under [Install](#install).</sub>
27
-
28
- > Audit a site against **RGAA 4.1.2**, the French State's accessibility standard (*référentiel général d'amélioration de l'accessibilité*), on its **WCAG 2.2 AA** core: a dated conformance report, the 106-criterion grid, a backlog and tickets — or author/review accessible markup without regressions. It never declares conforming what it has not verified. A [skills.sh](https://skills.sh) agent skill: a deterministic, zero-dependency static engine **plus** the agent's judgment, with `check`/`verify` gates against hallucinated non-conformities. **The central deliverable is the auditor conformance block** — theme, criterion + official wording, test(s), WCAG mapping + level, finding, expected state, verification, `file:line` occurrences — rendered identically by the `report` (compliance doc), the `prd` backlog and the GitHub issues, in the active standard's vocabulary and **in your language** (`--lang auto` follows the conversation/repo). **RGAA ships first; WCAG is the worldwide core it maps onto, and other country standards are pluggable in-repo packs.**
29
-
30
- ultra11y is built around an honest **division of labour**. Automated tools only catch a fraction of accessibility problems, so the engine does the *mechanical* work — 102 machine-detectable static checks tied to the WCAG 2.2 success criteria — and is explicit about everything it can't decide statically. What it can't, the **AI agent adjudicates** (statically, from the evidence, gated by `verify`/`check`) — not a deferral to a human:
22
+ Documentation complète : **[socialgouv.github.io/ultra11y](https://socialgouv.github.io/ultra11y/)**.
31
23
 
32
- - **Automatable (engine):** missing `alt`/`lang`/`title`, unlabeled fields, empty links/buttons, icon-only controls, iframes without title, tables without headers, heading-level skips, empty/dangling headings & labels, duplicate ids, invalid/broken ARIA, positive `tabindex`, autoplay/timed-refresh/`blink`/`marquee` media…
33
- - **Agent judgment (gated):** alt-text relevance, link purpose in context, reading/tab order, caption accuracy — the agent rules on these via `verify --manual` → `--apply`, each verdict carrying a justification (or a groundable NC), never a silent "conforming".
34
- - **Needs rendering (scan tier):** computed contrast, visible focus, zoom/reflow, content on hover — decided by `scan` (axe-core in a real browser); until then they stay **residual risks**, never silently "conforming".
35
- - **Advisory vs non-conformity:** a good practice with no failing normative test (an `advisory` pack rule, a best-practice-only axe violation, an agent recommendation) renders as « Recommandation (non normative) » — it never flips a criterion to `NC` nor enters the conformance rate. An NC always cites a `normativeRef`.
36
- - **Stateful scan probes:** the local runtime drives the page with bounded, non-navigating interactions (fill inputs then re-measure overflow; a live-region probe for status messages 4.1.3) — `--no-interact` opts out; `--interact-clicks` re-enables button clicks on authenticated scans (destructive-named buttons are never clicked).
37
- - **Normative page sample (échantillon):** a country-standard audit runs over a declared `sample.pages` set — **`pages discover --crawl|--sitemap --write` builds it for you** (names read from each page's `<title>`, existing entries never overwritten), `sample check` lints its coverage against the standard's required page kinds, `scan --sample` scans it, and an un-scanned `--standard rgaa` report is flagged **partial**.
38
- - **Pack-only detection (declarative):** a standards pack can ship its own `rules` (a bounded, ReDoS-guarded matcher DSL — no code) and normativity/severity `overrides`, projecting onto its criteria without forking the engine.
24
+ ## Installer
39
25
 
40
- ## Measured against a corpus it did not write
41
-
42
- A self-authored fixture can only prove that a rule fires on the defect written for it. So the engine is also scored against the **[W3C ACT-Rules Community Group](https://act-rules.github.io) test corpus** — 1 134 `passed` / `failed` / `inapplicable` examples across 91 rules, authored independently of this project:
43
-
44
- | | |
26
+ | Agent | Installation |
45
27
  |---|---|
46
- | Rules scored | **44** (the ACT rules an equivalent engine check exists for) |
47
- | `failed` examples caught | **168 / 187** |
48
- | `passed` / `inapplicable` examples left alone | **401 / 401** — no unexplained false positive |
49
- | Deliberate divergences | 9, each argued on the record |
50
- | Declared gaps (statically decidable, not implemented) | 0 |
51
-
52
- Rules needing a rendered page (computed contrast, keyboard traps) or a human call (is this heading descriptive?) are **declared and routed**, not silently scored zero. The full per-rule matrix — including every gap and every divergence — is generated into [`skills/ultra11y/references/act.md`](skills/ultra11y/references/act.md) and re-checked on every build; the corpus itself is refreshed daily by a workflow, so the numbers cannot quietly go stale.
53
-
54
- ## Install
55
-
56
- **As a CLI** — on npm, zero runtime dependencies (Node ≥ 22.18):
57
-
58
- ```sh
59
- npx ultra11y --help # no install
60
- npm i -D ultra11y # or as a dev dependency
61
- ```
62
-
63
- **As a test-runner plugin** — audit a page inside your own E2E run, in the state your test
64
- built it:
65
-
66
- ```js
67
- import { checkA11y } from "ultra11y/playwright"; // or "ultra11y/cypress" (+ "/plugin")
68
- await checkA11y(page, { as: "accueil" });
69
- ```
70
-
71
- **As an agent skill** — the repository ships **two** (pick at the prompt, or pass the name):
72
- `ultra11y` for full audits, compliance reports, PRD backlogs and standards packs, and
73
- `review-a11y` for the fast loop that audits **exactly the code under change** (staged files,
74
- working diff, or branch vs merge-base) and reports like a code reviewer. Both bundle the same
75
- install-free engine.
76
-
77
- ```sh
78
- npx skills add SocialGouv/ultra11y # this agent
79
- npx skills add SocialGouv/ultra11y --agent codex # …or opencode, cursor, gemini, amp, zed…
80
- ```
81
-
82
- **As an agent plugin** — the same two skills, plus the hook that makes the review
83
- **automatic**. Installed this way, a pending `git commit`, `git push` or `gh pr create`
84
- that carries accessibility findings is stopped once and the agent is handed the findings,
85
- so `review-a11y` runs before the work goes out — you never type the skill's name.
86
-
87
- ```
88
- /plugin marketplace add SocialGouv/ultra11y # Claude Code
89
- codex plugin marketplace add SocialGouv/ultra11y # Codex CLI
90
- npx ultra11y install --opencode # OpenCode 1.x or 2.x (detected; --opencode-version 1|2)
91
- ```
92
-
93
- Codex's hook engine is a near-clone of Claude Code's — same events, same envelope, and it
94
- exports `${CLAUDE_PLUGIN_ROOT}` too — so both harnesses share one `hooks/hooks.json`.
95
- OpenCode has no permission-decision channel, so there the gate surfaces as a **failed shell
96
- call whose error message carries the findings**. One plugin file serves OpenCode 1 and
97
- OpenCode 2, whose plugin APIs differ: V2 reads its `setup(ctx)`, V1 its `server()`.
98
- Per-harness deltas, the Codex feature flag and the trust prompt: [`skills/ultra11y/references/harnesses.md`](skills/ultra11y/references/harnesses.md).
99
-
100
- Four things worth knowing, because they bound what "automatic" means here:
101
-
102
- - A hook **cannot force** a skill to be invoked. It blocks the command and hands over the
103
- reason and the findings; the agent is what invokes `review-a11y`. In practice a motivated
104
- `deny` is enough — it is not a guarantee.
105
- - **Hooks do not enable themselves.** Installing the plugin is what turns them on. On Codex
106
- they also need `[features] hooks = true`, which `install --codex` sets for you; run
107
- `npx ultra11y status` if you are not sure what is live.
108
- - **No harness has a git event** (no `PreCommit`, no `PRCreated`), which is why the hook
109
- listens on `PreToolUse` for the shell tool — `Bash` on Claude Code, `shell` on Codex —
110
- and recognises the commands that publish work.
111
- - On a harness with **no hook API at all** (Cursor, Amp, Zed, Gemini CLI…), nothing is
112
- automatic. `npx ultra11y install --agents-md` makes the engine discoverable and hands the
113
- agent the adjudication protocol; `init --hook` below is what actually enforces the gate.
114
-
115
- The gate never blocks twice for the same findings, so a retry always lands. It stays out of
116
- the way when git's own `no-verify` bypass is used, outside a repository, and whenever the
117
- engine cannot answer.
118
- Disable it per-repo with `"hook": { "failOn": "off" }` in `.ultra11yrc.json`, per-command
119
- with `SKIP_A11Y=1`, or per-session with `ULTRA11Y_HOOK=off`; raise or lower the bar with
120
- `ULTRA11Y_HOOK_FAIL_ON=blocking|major|minor` (default `blocking`).
121
-
122
- **As an MCP server** — so an agent drives the engine as tools instead of shelling out:
123
-
124
- ```sh
125
- claude mcp add ultra11y -- npx -y ultra11y mcp
126
- ```
127
-
128
- **In CI — run iterion's [`rgaa-audit` bot](https://github.com/SocialGouv/iterion/tree/main/bots/rgaa-audit).**
129
- ultra11y ships no CI integration of its own. The bot is the harness that turns the engine into an
130
- audit with no one at the keyboard: it installs the engine pinned (version and sha256), renders
131
- your page sample, has read-only agents adjudicate the judgment criteria, puts every claim on
132
- trial, gates with `check` and files one issue per non-conforming criterion. See
133
- [`references/ci.md`](skills/ultra11y/references/ci.md).
134
-
135
- Or clone and run the bundled engine straight from the repo:
136
-
137
- ```sh
138
- node scripts/ultra11y.mjs --help
139
- ```
140
-
141
- ## Commands
142
-
143
- ```
144
- ultra11y audit <globs… | -> [--standard <pack>] [--out <dir>] [--include <glob>] [--exclude <glob>] [--ext <list>] [--jsx] [--graph] [--json] [--lang auto|en|fr] [--no-default-excludes]
145
- ultra11y audit [--changed | --since <ref> | --staged] [--max-files <n>] [--dedup exact|normalized|off] [--baseline <file>] [--fail-on blocking|major|minor]
146
- ultra11y audit [--captures <dir>] [--no-captures] [--require-captures] # audit rendered-DOM captures alongside source
147
- ultra11y audit [--format sarif|github] # CI: code-scanning SARIF, or inline annotations + job summary
148
- ultra11y audit --lite [--pages <ids>] [--baseline <file>] [--write-baseline <file>] [--fail-on …] # rendered regression gate: snapshots only, new findings only
149
- ultra11y affected --since <ref> | --all [--root <dir>] [--json] # the sample pages a diff can change
150
- ultra11y report --in <audit.json> [--out <dir>] [--standard <pack>] [--format sarif|github] [--lang auto|en|fr]
151
- ultra11y prd --in <audit.json> [--out <dir>] [--split criterion] [--format audit|doc|remediation] [--standard <pack>] [--lang auto|en|fr]
152
- ultra11y tickets --in <audit.json> [--provider auto|github|gitlab|jira] [--grain criterion|page|page-criterion|single|file] [--transport auto|cli|rest] [--max-tickets <n>] [--dry-run] [--json]
153
- ultra11y render [<dir>] [--scaffold | --setup | --e2e | --coverage | --storybook] [--runner playwright|cypress] [--captures <dir>] [--out <file>] [--json]
154
- ultra11y snapshot write [--root <dir>] [--fail-on blocking|major|minor] [--json] # payload on stdin → .ultra11y/pages/<id>/ + audit
155
- ultra11y snapshot list [--root <dir>] [--json]
156
- ultra11y pages --in <audit.json> [--standard <pack>] [--json] [--lang auto|en|fr] # the per-page criterion grid
157
- ultra11y pages --in <audit.json> --format report [--split page] [--out <dir>] # the per-page report, with screenshots
158
- ultra11y pages discover --sitemap <url> | --crawl <url> [--depth <n>] [--max <n>] [--write] # build the page sample
159
- ultra11y dev [--port <n>] [--standard <pack>] | dev --next # live overlay while you build + dashboard
160
- ultra11y criteria [<sc>] [--list] [--standard <pack> [--theme <N>]] [--generate] [--json] [--lang auto|en|fr]
161
- ultra11y judge --in <audit.json> [--standard <pack>] [--runner api|claude|codex] [--model <id>] [--apply] # API or local subscription CLI
162
- ultra11y check --report <md> [--standard <pack>] [--quiet] [--json]
163
- ultra11y verify --report <md> [--standard <pack>] [--semantic] [--apply <verdicts.json>] [--max-verify <n>] [--json]
164
- ultra11y verify --report <md> [--conformities <ledger|adjudication.json> | --no-conformities] # also put the claimed CONFORMITIES on trial
165
- ultra11y fix <globs… | -> [--write] [--iterate] [--changed | --since <ref> | --staged] [--safe] [--only <ids>] [--jsx] [--json]
166
- ultra11y init [--hook] [--ci] [--baseline] [--fail-on blocking|major|minor]
167
- ultra11y pack check <pack.json> [--guidance <g.json>] | scaffold # gate an (AI-)authored standards pack
168
- ultra11y scan <url|file…> [--runtime auto|local|docker] [--cwd <dir>] [--root <dir>] [--storage-state <file>] [--merge <audit.json>] [--out <dir>] [--json]
169
- ultra11y scan --sitemap <url> | --crawl <url> [--depth <n>] [--max <n>] [--runtime …] [--merge <audit.json>] [--json]
170
- ultra11y mcp [--transport stdio|http] [--cwd <dir>] [--allow-write] [--port <n>] [--bind <addr>] [--allow-remote]
171
-
172
- # global: --pack <paths> (load external standards pack(s) at runtime) · --override
173
- ```
174
-
175
- ## Use it as an MCP server
176
-
177
- The skill shells out to the CLI and parses its output. An MCP server skips both:
178
- your agent calls ultra11y as typed tools, with JSON schemas in and structured
179
- results out. Same engine, same standards data, no wrapper.
180
-
181
- ```bash
182
- # stdio — the default, and what Claude Code / Claude Desktop / Cursor expect
183
- claude mcp add ultra11y -- node /abs/path/to/scripts/ultra11y.mjs mcp
184
-
185
- # or over HTTP, on loopback
186
- node scripts/ultra11y.mjs mcp --transport http --port 7341
187
- claude mcp add --transport http ultra11y http://127.0.0.1:7341/mcp
188
- ```
189
-
190
- ```jsonc
191
- // Claude Desktop takes stdio servers only — a remote URL here will not work.
192
- { "mcpServers": { "ultra11y": { "command": "node", "args": ["/abs/path/to/scripts/ultra11y.mjs", "mcp"] } } }
193
- // Cursor, HTTP:
194
- { "mcpServers": { "ultra11y": { "url": "http://127.0.0.1:7341/mcp" } } }
195
- ```
196
-
197
- It serves all three MCP primitives, because a skill is three things: the engine
198
- (**tools**), the method (**prompts**), and the documentation the method refers
199
- to (**resources**). A client given only the tools runs the audit, sees no
200
- errors, and reports the page as accessible — a false conformance claim, which is
201
- the one output an accessibility tool must never produce.
202
-
203
- ### Tools
204
-
205
- Sixteen read tools, in two blocks. **The audit block** tells you what the page does:
206
-
207
- | Tool | What it does |
208
- |------|--------------|
209
- | `ultra11y_audit` | The static pass — findings keyed by success criterion |
210
- | `ultra11y_adjudicate` | The criteria the engine **cannot** decide, with their evidence |
211
- | `ultra11y_report` | The dated conformance report, WCAG or a country pack |
212
- | `ultra11y_prd` | Non-conformities → remediation units with effort |
213
- | `ultra11y_tickets` | The same backlog as a ticket plan — dry-run, files nothing |
214
- | `ultra11y_check` | The gate: nothing asserted conformant that was never tested |
215
- | `ultra11y_verify` | Claim↔evidence worklist |
216
- | `ultra11y_pack_check` | Validate a country standards pack against what it really ships |
217
- | `ultra11y_sample_check` | Lint the normative page sample |
218
- | `ultra11y_pages` | The per-page view: the criterion × page grid, or one dossier per page |
219
- | `ultra11y_read` | A file, or a line range, from the project |
220
-
221
- **The reference block** tells you what the standard requires — the half that keeps an agent
222
- from auditing out of memory. `cwd` is optional on all five; it selects whose packs are visible:
223
-
224
- | Tool | What it does |
225
- |------|--------------|
226
- | `ultra11y_standards` | Which standards exist here, and how much of each any engine can decide |
227
- | `ultra11y_criteria` | One criterion in full — wording, **numbered tests**, techniques, mapping, defined terms — or the index, or one theme |
228
- | `ultra11y_glossary` | What a term the standard **defines** means, and which criteria it governs |
229
- | `ultra11y_guidance` | The before/after implementation pattern, inherited through the WCAG mapping when the pack has none |
230
- | `ultra11y_method` | The work plan: what the engine settles, what needs a render, what is yours |
231
-
232
- `ultra11y_method` is the one to call first. It partitions the standard into evidence tiers —
233
- `source`, `cross-file`, `rendered-page`, `browser`, `judgment`, `out-of-scope` — from the
234
- engine's own per-criterion rule applicability, never from guessing at the wording of a test.
235
- For RGAA it reports that **56 of 106 criteria declare that no engine rule can evidence them**.
236
- That is the standard saying they are yours, and a plan that hides it reads as coverage that
237
- does not exist.
238
-
239
- `standard` carries no enum, deliberately: a country pack arrives with a project, so an enum
240
- pinned when the tool list was built would reject a pack that is perfectly valid for the
241
- project being asked about. The handler validates against the registry and names what it knows.
242
-
243
- `--allow-write` additionally exposes `ultra11y_fix` (safe codemods, dry-run by
244
- default), `ultra11y_fold` (lands the verdicts you wrote on the `ultra11y_adjudicate`
245
- worklist — `verify --apply` over MCP: same gate, partial by default with every refusal
246
- listed, dry-run unless `write: true`, `ledger: true` to record the accepted verdicts) and
247
- `ultra11y_init` (hook/CI/baseline) — the tools that change **your** project. `ultra11y_scan` is declared but declines over MCP: it drives a headless
248
- browser and may pull a Docker image, which is not a subprocess lifecycle a
249
- long-lived server should own. It tells you to run it from the CLI and re-audit.
250
-
251
- Every tool audits exactly what the CLI would: the rendered captures and the page
252
- snapshots under `.ultra11y/` are ingested here too, so the server never reports a
253
- smaller audit than the same command run by hand.
254
-
255
- Pass `--cwd <dir>` at startup to dedicate the server to one project — `cwd` then
256
- becomes optional on every tool.
28
+ | **Claude Code** | `/plugin marketplace add SocialGouv/ultra11y` puis `/plugin install ultra11y@ultra11y` |
29
+ | **Codex CLI** | `codex plugin marketplace add SocialGouv/ultra11y` puis `codex plugin add ultra11y@ultra11y` |
30
+ | **OpenCode** 1.x et 2.x | `npx ultra11y install --opencode` |
31
+ | **Autres agents** | `npx skills add SocialGouv/ultra11y` (les skills seules, sans hook) |
257
32
 
258
- ### Prompts — the workflow, not just the tools
33
+ Le plugin apporte deux skills, `ultra11y` (l’audit complet) et `review-a11y` (la revue d’un
34
+ changement), et un **hook** : avant `git commit`, `git push` ou `gh pr create`, il audite le
35
+ diff et, s’il trouve un défaut, bloque la commande une fois pour que l’agent lance la revue.
36
+ Sur Codex, `npx ultra11y install --codex` active les hooks ; `npx ultra11y status` dit ce qui
37
+ est branché. Le couper : `SKIP_A11Y=1`, `ULTRA11Y_HOOK=off` ou `"hook": { "failOn": "off" }`
38
+ dans `.ultra11yrc.json`. Détails : [`references/harnesses.md`](skills/ultra11y/references/harnesses.md).
259
39
 
260
- | Prompt | Arguments | What it drives |
261
- |--------|-----------|----------------|
262
- | `audit_wcag` | `cwd`, `globs?`, `standard?` | audit → adjudicate → rule on each → report → check, with the untested criteria named |
263
- | `adjudicate_criteria` | `cwd`, `standard?` | What alt-text relevance, link purpose, heading structure and reading order actually ask |
264
- | `review_diff_a11y` | `cwd`, `since?` | Audit exactly the diff, refute the false positives, state the residual risks |
40
+ **La bibliothèque pour vos tests de bout en bout** (Node ≥ 22.18) : `npm i -D ultra11y`.
265
41
 
266
- Each carries the coverage arithmetic: of the 55 WCAG 2.2 AA criteria the static
267
- engine decides a handful, a browser decides fourteen, and **thirty-eight are
268
- yours**.
42
+ ## Utiliser
269
43
 
270
- ### Resources — the documentation, and the standards themselves
44
+ **1. Demander un audit.** Dans l’agent : « audite ce site selon le RGAA ». La skill suit
45
+ [`references/full-audit.md`](skills/ultra11y/references/full-audit.md), le même parcours sur
46
+ tous les agents :
271
47
 
272
- `SKILL.md` and all 37 `references/*.md` are served under `skill://`, read off
273
- disk at request time — so a documentation fix reaches every client without a
274
- rebuild.
48
+ 1. passage du moteur statique sur le code source ;
49
+ 2. capture des pages rendues dans un vrai navigateur (axe-core, sondes de focus, zoom, survol) ;
50
+ 3. arbitrage par l’agent des critères qui demandent un jugement, preuve à l’appui ;
51
+ 4. contre-vérification de chaque NC, C et NA : une NC réfutée est retirée, un C ou un NA
52
+ réfuté repart « à évaluer » ;
53
+ 5. registre des verdicts, publication des livrables, puis contrôle par `check`.
275
54
 
276
- The standards are served too, under `std://`, because in MCP documentation is a
277
- *resource*, not a tool call:
55
+ **2. Capturer les pages depuis vos tests.** Le test audite la page dans l’état où il l’a
56
+ laissée (session connectée, formulaire rempli, modale ouverte). Chaque page est enregistrée
57
+ dans `.ultra11y/pages/<id>/` et sera réauditée hors ligne par l’audit complet.
278
58
 
279
- ```
280
- std://rgaa/criteria/8.3 std://rgaa/glossary/lien std://rgaa/method
281
- std://rgaa/themes/8 std://rgaa/guidance/13.2 std://rgaa/pack.json
282
- std://wcag/criteria/1.4.3 std://wcag/glossary std://wcag/method
283
- ```
284
-
285
- `resources/list` carries a bounded index per standard; the per-item URIs are
286
- **templates** (`resources/templates/list`), because enumerating RGAA's 106
287
- criteria and 119 glossary terms would bloat every client's listing and go stale
288
- the moment a project's own pack registers.
289
-
290
- Two things worth knowing:
291
-
292
- - **A criterion nobody tested is untested, never conformant.** Every tool
293
- description and every prompt says so, because the failure mode here is not a
294
- wrong answer — it is a confident silence.
295
- - **The HTTP transport binds `127.0.0.1` and refuses anything else** unless you
296
- pass `--allow-remote`. This server reads local files; an exposed port is a
297
- read-anything primitive for whoever finds it.
298
-
299
- ## Standards packs (RGAA France first; add your country)
300
-
301
- WCAG 2.2 AA is the ENGINE's canonical key, because its rules are tied to success criteria and
302
- a pack criterion is defined as a projection of them. Each country standard ships as an in-repo
303
- **standards pack** — a small JSON carrying that mapping — and `--standard` re-keys everything
304
- a reader sees, starting with `audit` itself:
305
-
306
- ```sh
307
- node scripts/ultra11y.mjs audit src --standard rgaa # RGAA-titled summary by thématique, findings tagged [8.4]
308
- node scripts/ultra11y.mjs audit src --standard rgaa --out audits --json # a pack-keyed document: 106 criteria, 13 themes
309
- node scripts/ultra11y.mjs report --in audits/audit-latest.json --standard rgaa # → audits/rgaa-YYYY-MM-DD.md
310
- node scripts/ultra11y.mjs criteria --standard rgaa 8.3 # a pack criterion (+ its WCAG SCs)
311
- ```
312
-
313
- `.ultra11yrc.json { "standard": "rgaa" }` makes it the default for every command. Under a pack,
314
- no deliverable carries a WCAG cross-reference — report, PRD, per-page sheets, CI annotations
315
- and SARIF name that standard's criteria and nothing else; the WCAG core travels inside the
316
- document's `core` field, where the pipeline reads it and no rendering does. The one place the
317
- mapping is still printed is `criteria --standard rgaa <id>`, which is a reference lookup and
318
- where a reader goes looking for it.
319
-
320
- **RGAA 4.1.2** (France) ships as the flagship pack. Section 508 (US), EN 301 549 (EU) and
321
- others are welcome — adding a country is a single PR (pack JSON + one registration line +
322
- a test). See [`CONTRIBUTING.md`](CONTRIBUTING.md) and `skills/ultra11y/references/standards.md`.
323
-
324
- ### What RGAA automation actually covers
325
-
326
- The engine's 102 rules are not 102 RGAA criteria: several rules can evidence the same official
327
- test, and a rule can detect a useful symptom without exhausting the criterion's alternatives,
328
- exceptions or relevance checks. The generated contract classifies all **258 official RGAA
329
- tests**:
330
-
331
- - **30 `static` tests across 22 criteria:** `1.1`, `1.9`, `2.1`, `5.7`, `5.8`, `6.1`, `6.2`, `7.1`,
332
- `8.2`, `8.3`, `8.4`, `8.5`, `8.10`, `9.3`, `10.1`, `10.12`, `11.1`, `11.2`, `11.5`,
333
- `11.6`, `11.8`, `11.9`.
334
- - **3 `rendered` tests across 3 criteria:** `1.1`, `8.1`, `10.7`.
335
- - Those two tiers cover **24 distinct criteria that can produce a deterministic `NC`**;
336
- `1.1` belongs to both.
337
- - **54 criteria receive a normative engine signal:** 24 have at least one decisive rule and
338
- 43 receive candidate evidence, with overlap. One additional criterion receives only an
339
- advisory signal. A candidate is forwarded to adjudication and never changes a verdict by
340
- itself.
341
- - Only **8.3 and 8.5** may earn `C` from a complete silent measurement. For the other
342
- mechanically detectable tests, silence can mean “no subject found” or “an alternative or
343
- exception still needs judging”, so it cannot prove conformity. 10.1 was on that list and
344
- left it: its rule tolerates `<u>`, tolerates `width`/`height` on nine tags where the
345
- glossary names five, and covers “presentation built out of spaces” with two heuristics —
346
- every one of them a deliberate under-report, which is the safe direction for a finding and
347
- the wrong one for a conformity.
348
- - The remaining **225 `judgment` tests across 92 criteria** all enter the AI worklist,
349
- including an apparently absent subject whose `NA` still needs confirmation. Overall,
350
- **104 of 106 criteria require adjudication to earn `C`**.
351
-
352
- The number can grow, but the useful target is **more observed, exact failures**, not a larger
353
- marketing count. The best next candidates are complete rendered probes for zoom/reflow and
354
- hover content (10.4, 10.11, 10.13), and contrast,
355
- link distinction or orientation checks (3.2, 3.3, 10.6, 13.9) that first rule out every
356
- official alternative and particular case. The ACT corpus's remaining misses are another
357
- implementation queue, although closing one does not necessarily cover a new RGAA criterion. A candidate is
358
- promoted only when a narrower rule demonstrably exhausts its cited official test; the two
359
- `C`-by-silence criteria stay unchanged until an equally complete proof exists.
360
-
361
- The generated [106-criterion / 258-test matrix](skills/ultra11y/references/rgaa-automation.md)
362
- is the source of truth; CI rebuilds it from the vendored DINUM data and rejects drift.
363
-
364
- **Downloadable PDF documents (RGAA 13.3).** The engine reads PDFs with its own zero-dependency
365
- reader (Node `zlib` only): `audit report.pdf` / `audit "public/**/*.pdf"`, and `scan` — or the
366
- Playwright fixture, through the test's own session — downloads the same-origin PDFs each captured
367
- page links to into `.ultra11y/documents/`: a `.pdf` path, a `download` link, a link or route
368
- naming PDF (`/api/declaration-pdf`), kept only when the response is a PDF; `scan --storage-state`
369
- sends the session's matching cookies (bounded, `--no-pdf` / `pdf: false` to opt out). Five document checks — `pdf-untagged`, `pdf-lang-missing`,
370
- `pdf-title-missing` (title + `DisplayDocTitle`), `pdf-no-text` (image-only scan) and the advisory
371
- `pdf-structure-shallow` — are listed per document in the report and reach RGAA 13.3 as
372
- **candidate** evidence: an accessible alternative version may exist, so they never decide a
373
- verdict, and passing them is never PDF/UA conformance (veraPDF/PAC establish that). An encrypted
374
- or malformed file is reported unreadable. See `skills/ultra11y/references/audit.md`.
375
-
376
- ### Scale, fixes, and repo automation
377
-
378
- - **Scale** — the engine streams file-by-file (bounded memory), audits **only markup**,
379
- and lets you focus: `--changed`/`--since` (git diff only), priority ordering
380
- (layouts/templates/shared components first), content de-duplication, and an explicit
381
- `--max-files` cap with logged truncation. See `references/scale.md`.
382
- - **Fixes** — `fix` puts the fixes in place (native-first, anti-hallucination): deterministic
383
- auto-codemods, fill-in `TODO` placeholders for the agent to complete, and judgment-only
384
- proposals. `--dry-run` is the default; `--write` applies but only after a re-audit proves
385
- no new non-conformity, and never on lossy JSX/TSX. See `references/fix.md`.
386
- - **During your E2E run** — `import { checkA11y } from "ultra11y/playwright"` (or
387
- `ultra11y/cypress` + `ultra11y/cypress/plugin`) audits a targeted page **inside the test run
388
- you already have**; `render --e2e` still writes install-free fixtures for a repo that does
389
- not depend on ultra11y, and the two cannot drift (the fixtures interpolate the published
390
- module's tables, and a test gates both over the same findings). Cypress now feeds the pixel
391
- tier too, via `after:screenshot`. `checkA11y(page, { report: true })` emits the per-page
392
- report straight out of the run. The audit runs, so the page is checked in the state
393
- your test built (logged in, form filled, modal open) — state a separate `scan` run does not
394
- have. Each checked page is persisted as a **snapshot** (`.ultra11y/pages/<id>/`: the whole
395
- rendered document + computed styles + boxes), which is the durable half: the same page
396
- re-audits **offline, with no browser**, so CI and the per-page report work from it. Because
397
- a snapshot is a full document, the page-scoped rules finally run — RGAA **8.3** (`lang`),
398
- **8.5/8.6** (`title`) — and every finding carries both its page and the source file that
399
- rendered it. See `references/e2e.md` and `references/pages.md`.
400
- - **While you build** — `dev --next` writes a one-line Next overlay component and `dev` starts
401
- a loopback side-car: a floating panel lists the current page's non-conformities as you
402
- browse, each linking to its `file:line` in your editor, and `http://127.0.0.1:4111` shows
403
- the per-page grid accumulating. The overlay detaches itself before collecting — otherwise it
404
- would audit itself and shift every element index — and renders nothing outside development.
405
- See `references/devtools.md`.
406
- - **A country standard is adjudicated at its OWN granularity** — 97 of RGAA's 106 criteria
407
- carry at least one judgment test and can still need adjudication to earn C; decisive rules
408
- can nevertheless prove their bounded failures.
409
- `verify --manual
410
- --standard rgaa` now keys the worklist by **RGAA criteria**, each carrying its numbered tests
411
- in full, its technical note, its particular cases, its guidance and the glossary definitions
412
- its tests cite (119 entries that previously had no reader). A `normativeRef` must cite one of
413
- the item's **own** tests — the laxer check accepted a WCAG id that happened to collide with
414
- an unrelated RGAA test number. Verdicts fold into a separate `packAdjudication` layer so a
415
- pack decision never rewrites the WCAG core. See `references/judgment.md`.
416
- - **Rendered tier (offline)** — six rules read a snapshot's browser-only signals inside the
417
- ordinary `audit`: **no browser, no Docker, no running server**. `rendered-contrast` measures
418
- contrast on the *computed* styles (the inline-literal rule could only see colours written in
419
- the markup); `rendered-contrast-pixel` measures it **on the screenshot** for text over a
420
- gradient or image, where `background-color` is transparent and every CSSOM-based checker —
421
- axe-core included — is blind; `rendered-nontext-contrast` decides whether a form control's
422
- boundary is perceivable (**RGAA 3.3**); and two more read the *stylesheet itself*, which is
423
- the only place they exist: a focus indicator removed with nothing put back (**10.7**, until
424
- now reachable only by a live browser probe) and an orientation lock (**13.9**).
425
- `rendered-link-colour-only` makes **RGAA 10.6** decidable at all.
426
- Each can say *"I don't know"*: an unresolvable backdrop, a varied region, a cross-origin
427
- stylesheet, a `box-shadow` that might be the boundary — all leave the criterion undecided
428
- rather than guessed, and without signals the rules do not fire, so no pre-existing verdict
429
- changes. `tests/rgaa-coverage.test.ts` pins a floor of **50 of 106** RGAA criteria mapped
430
- onto an engine rule, up from 43 before this tier; silently losing one fails CI.
431
- - **Every scanned page is a snapshot** — `scan` no longer keeps only findings: each page it
432
- visits is persisted to `.ultra11y/pages/<id>/` (`--no-snapshot` opts out). That is what turns
433
- a URL into a real per-page verdict — a page known only by its URL can never be conforming by
434
- silence, so a sitemap-driven audit used to produce an almost empty grid. With a snapshot the
435
- page-scoped rules run (**RGAA 8.3 / 8.5 / 8.6**), the DOM **JavaScript built at runtime** is
436
- audited like any other markup, and the page re-audits **offline, with no browser**. The
437
- collection happens on the *pristine* page — before axe injects its source and before any probe
438
- fills an input or resizes the viewport — otherwise the snapshot would record our own
439
- instrumentation instead of the site.
440
- - **Page by page** — RGAA is a per-page norm; the engine's verdict is scope-wide. `pages`
441
- bridges the two: one row per criterion, one column per page URL, embedded in `report` and
442
- rebuilt from a committed `audit.json` alone. The per-page status is not recomputed — a
443
- per-page *view* of the audit runs through the very same projection the report uses, so grid
444
- and report agree by construction. Two rules hold the line: a finding is attributed to a page
445
- only when something **says** so (else it is counted as unattributed, never spread across
446
- pages), and a criterion is conforming *by silence* only on a page whose real rendered DOM
447
- was audited. An adjudicated non-conformity counts only on the pages its findings are on; an adjudicated
448
- conformity stays a claim about the whole run, except on a page with none of the criterion's
449
- subject. Under a country standard, a page's rate is the RGAA page formula: conforming ÷
450
- (conforming + non-conforming), the criteria still to assess counted beside it and marking it
451
- provisional. And `pages --format report [--split page]` turns that into the **deliverable an
452
- auditor hands over**: one dossier per page — identity, **screenshot**, rate, *every* criterion
453
- of the standard with its status on that page, then each non-conformity as the ordinary auditor
454
- block. It re-decides nothing and invents no format, so a page sheet and the compliance report
455
- cannot disagree; `check` gates it against invented criteria like any other report.
456
- See `references/pages.md`.
457
- - **CI through iterion** — ultra11y ships no GitHub Action or GitLab template. CI audits run
458
- through iterion's [`rgaa-audit` bot](https://github.com/SocialGouv/iterion/tree/main/bots/rgaa-audit),
459
- which drives the engine CLI pinned, adjudicates and refutes with read-only agents, and files
460
- the issues. The CLI it calls — `audit`, `scan --sample`, `verify --manual`/`--apply`/`--report`,
461
- `check`, `report`, `pages`, `tickets` — is the engine's stable contract. See `references/ci.md`.
462
- - **CI surfaces** — a red job says *that* the build broke, not *where*. `--format sarif` emits
463
- SARIF 2.1.0 for GitHub code scanning, so each finding lands as an **inline annotation on the
464
- causing line** of the PR; `--format github` does the same via `::error::` workflow commands
465
- plus a `$GITHUB_STEP_SUMMARY` table, for plans without code scanning. Alert identity reuses
466
- the baseline's `findingId`, so an alert survives line drift; a URL-keyed finding gets **no**
467
- location rather than a guessed one. Run it from `report --standard rgaa` for pack-keyed
468
- output. `ULTRA11Y_PR_COMMENT=1` also keeps one sticky PR comment per standard and kind
469
- (`digest`, `pages`, `full`), edited in place. See `references/ci.md`.
470
- - **Automation** — `init --hook` (default) wires a zero-dependency git pre-commit gate over the
471
- **strict staged snapshot**: it audits the exact index blobs, auto-applies the safe fixes and
472
- re-stages them, and blocks only on judgment issues. `init --baseline`/`--ci` is the opt-in
473
- regression variant (hook + committed baseline / GitHub Actions job) that fails only on **new**
474
- non-conformities, not the existing backlog. See `references/automation.md`.
475
-
476
- ### Rendered regressions on every pull request (`audit --lite`)
477
-
478
- The full page-by-page run captures every page and adjudicates with a model, which is minutes of
479
- browser and tens of minutes of model: it belongs on a schedule. The static gate runs on every pull
480
- request but cannot see the rendered page. `audit --lite` is the gate in between, priced for every
481
- pull request:
482
-
483
- - **only the pages the diff can change** — `ultra11y affected --since origin/main` diffs from the
484
- merge-base and follows each sample page's `sources` through their imports (relative paths,
485
- tsconfig aliases, `import()`, stylesheets and Sass `@use`/`@import`; type-only imports are
486
- erased, so they select nothing). A Next.js App Router page is wrapped by every `layout`/`template`
487
- above it. What no import says goes in `sample.global` — a touched global file selects every
488
- page — and changed markup no page reaches is listed as `unmapped`, in a warning. No browser, no
489
- parse: it reads only the files the pages reach, in well under a second;
490
- - **the engine alone** — `ultra11y audit --lite --pages <ids>` audits those snapshots and nothing
491
- else: no source audit, no adjudication, no per-page report, no PDF, no pixel tier, no HTML;
492
- - **only NEW findings fail** — the baseline keys a rendered finding on
493
- `page|rule|criterion|normalized selector` (generated ids, hashes and digits folded), not on its
494
- position in the serialized DOM, which moves whenever anything above it changes. A finding that
495
- only moved is not new; a third `img` without `alt` on a page that had two is. Where the baseline
496
- is kept is the caller's choice: the push to the default branch audits every page and writes it
497
- (`--write-baseline`), and a pull request compares against the one of its merge-base;
498
- - **a new page is judged with no reference** — that push records every sample page, clean ones
499
- included, so a page the merge-base's own baseline does not know was added by the pull request:
500
- every finding on it at `fail-on` is new and fails, and the summary says the page is new. Only a
501
- baseline that cannot speak for it only warns: none at all, one written by another ultra11y
502
- version, or one that is not the merge-base's own (`--baseline-approximate`). A page
503
- the push was asked for, or that the sample declares, but that left no snapshot is recorded as
504
- `skipped` in the baseline and never judged new;
505
- - **a route nobody declared is named** — `affected` lists the route files the diff adds or changes
506
- (Next.js App Router `page.*`, a `pages/` router — Next, Nuxt, Astro —, SvelteKit
507
- `+page.svelte`) that no sample page declares in its `sources`, as `unsampled`.
508
- `--require-sampled` fails on them: declare
509
- the page in `sample.pages`, or exempt it in `sample.exempt` with a reason. A router configured in
510
- code (React Router, Vue Router) has no route files to recognise: declare those pages.
511
-
512
- ```jsonc
513
- // .ultra11yrc.json
514
- {
515
- "sample": {
516
- // What no import says: the root layout, global styles, and what changes the rendered output
517
- // from outside the source tree — dependencies (lockfile, patches), relative to this file.
518
- "global": ["src/app/layout.tsx", "src/styles/**", "package.json", "../../pnpm-lock.yaml", "../../patches/**"],
519
- // Routes deliberately outside the sample — a reason is required.
520
- "exempt": [{ "path": "src/app/(mfa)/**", "reason": "behind MFA, unreachable from the capture" }],
521
- "pages": [{ "id": "accueil", "name": "Accueil", "url": "http://localhost:3000/", "sources": ["src/app/page.tsx"] }]
522
- }
523
- }
524
- ```
525
-
526
- ```ts
527
- // e2e/a11y/sweep.a11y.ts — capture only what `affected` selected
528
- const only = process.env.ULTRA11Y_PAGES?.split(",").filter(Boolean);
529
- for (const route of ROUTES.filter((r) => !only?.length || only.includes(r.id))) {
530
- test(route.id, async ({ page }) => {
531
- await page.goto(route.path);
532
- await checkA11y(page, { as: route.id, name: route.name, sources: route.sources, failOn: false });
533
- });
534
- }
535
- ```
536
-
537
- The loop is `ultra11y affected --since origin/main --json`, your capture of those pages, then
538
- `ultra11y audit --lite --pages <ids> --baseline <file> --fail-on blocking` (and
539
- `--write-baseline <file>` on the default branch); `--format sarif|github` renders the new
540
- findings for code scanning or as annotations.
541
-
542
- ### Optional model tier (`judge`) — for the runs with no agent in the loop
543
-
544
- Inside a coding agent the judgment criteria are the agent's to rule on. Outside one — CI or an
545
- E2E run — nobody does, so they stay « à évaluer ». `judge` adjudicates
546
- them with a model, and is a **caller, not a second judge**: the worklist, the evidence and the
547
- prompt are `verify --manual`'s own, and the verdicts pass through the **same fail-closed gate**
548
- an agent's do. An unjustified `C`, an `NC` citing a line that does not resolve, a verdict for a
549
- criterion nobody asked about, or an incomplete run are all refused — and a rejected
550
- adjudication leaves the audit untouched. All-`manual` with reasons is accepted, because that is
551
- a correct answer. Choose the transport explicitly:
552
-
553
- ```sh
554
- # Anthropic Messages API
555
- ANTHROPIC_API_KEY=… ultra11y judge --in audits/audit-latest.json --runner api --apply
556
-
557
- # Local CLI subscriptions; each reuses that CLI's existing login
558
- ultra11y judge --in audits/audit-latest.json --runner claude --apply
559
- ultra11y judge --in audits/audit-latest.json --runner codex --apply
560
- ```
561
-
562
- `--runner cli` remains an alias of `claude` for existing scripts. The Codex runner invokes
563
- `codex exec` ephemerally, read-only, offline, without repository rules, hooks or user config;
564
- it uses the model attached to the ChatGPT account unless `--model` is given. Its subscription
565
- has no per-run dollar-budget flag, so `--max-budget-usd` is rejected for Codex rather than
566
- pretending to enforce a ceiling. Use `--timeout` and `--max` to bound the local run.
567
-
568
- In CI, the judgment criteria are adjudicated by iterion's
569
- [`rgaa-audit` bot](https://github.com/SocialGouv/iterion/tree/main/bots/rgaa-audit), with
570
- read-only agents and a second reader, through the same fail-closed fold.
571
- ChatGPT-subscription authentication stays local: public CI does not receive or manufacture a
572
- Codex subscription secret.
573
-
574
- ### Optional dynamic tier (axe-core)
575
-
576
- `scan` runs **axe-core in a headless browser** to decide the *needs-rendering* criteria the static engine leaves as residual risks — chiefly **computed colour contrast (1.4.3)** plus a 320px **reflow** check (1.4.10) and a render cross-check of the structural rules. Two runtimes (default `--runtime auto`): **`--runtime local`** uses a Playwright that resolves from your project (`--cwd`) — **no Docker** — and additionally probes focus visibility (2.4.7), 200% zoom (1.4.4), text spacing (1.4.12) and content-on-hover (1.4.13), plus **stateful** probes (fill inputs then re-measure overflow, and a live-region probe for status messages 4.1.3 — opt out with `--no-interact`, `--interact-clicks` for authed-scan button clicks), and takes `--storage-state` for authenticated pages; **`--runtime docker`** falls back to a self-contained image built on first use. `--merge` folds the findings into a static `AuditResult`, upgrading `manual` criteria to `C`/`NC`. A country-standard audit scans its declared page sample with `scan --sample` (lint it first with `sample check`):
577
-
578
- ```sh
579
- node scripts/ultra11y.mjs audit "src/**/*.html" --out audits --json > /dev/null
580
- node scripts/ultra11y.mjs scan http://localhost:3000 --runtime local --cwd . --merge audits/audit-latest.json --out audits
581
- node scripts/ultra11y.mjs report --in audits/audit-latest.json --out audits
582
- ```
583
-
584
- Only the Docker runtime needs Docker. `--runtime local` needs a Chromium binary (`npx playwright install chromium`, or one already on the machine named with `--browser-path /usr/bin/chromium` / `ULTRA11Y_BROWSER_PATH` — launched as given, never replaced by a fallback) plus `@playwright/test` and `@axe-core/playwright` — which **come with the npm package**, since they are its own dependencies; the audited project's own copies take precedence when it has them. Running the engine as a **standalone skill bundle** is the exception: an installed skill has no `node_modules` beside it, so there the two packages must be in the audited project, reachable from `--cwd`. The engine bundle itself stays dependency-free either way. The Docker runner + Dockerfile are embedded in the engine and mirrored under `docker/` (with a `docker-compose.yml`). See `skills/ultra11y/references/dynamic.md`.
585
-
586
- Typical audit flow:
587
-
588
- ```sh
589
- node scripts/ultra11y.mjs audit "src/**/*.html" --json > audit.json
590
- node scripts/ultra11y.mjs report --in audit.json --out audits # audits/wcag-YYYY-MM-DD.md
591
- node scripts/ultra11y.mjs check --report audits/wcag-YYYY-MM-DD.md # integrity gate
592
- ```
593
-
594
- ### A report someone will actually open
595
-
596
- There are two deliberate publication profiles. In an interactive audit — on Claude Code, Codex
597
- or OpenCode alike, following `skills/ultra11y/references/full-audit.md` — the skill produces the
598
- detailed deliverable: adjudicated Markdown, a printable single-file HTML report,
599
- per-page HTML/Markdown dossiers, screenshots and annotated evidence. In CI, iterion's
600
- `rgaa-audit` bot publishes the dated report, the per-page grid, the coverage annex and the
601
- verdict ledger.
602
-
603
- `--html` turns the audit into a page: `audits/index.html` as the entry point, plus — from
604
- `report` — a detachable single file that prints to PDF. Self-contained — no script, no
605
- external asset, nothing pointing outside the directory — and it passes this engine's own
606
- accessibility audit, which is the least a tool like this owes. `pages --html` writes the
607
- navigable sheets only: **one composite per artifact**, or every inlined crop travels twice.
59
+ ```js
60
+ import { test } from "ultra11y/playwright";
608
61
 
609
- ```sh
610
- node scripts/ultra11y.mjs report --in audit.json --html --evidence --out audits
611
- node scripts/ultra11y.mjs pages --in audit.json --format report --split page \
612
- --evidence --html --out audits/pages
62
+ test("accueil", async ({ page, ultra11y }) => {
63
+ await page.goto("/");
64
+ await ultra11y({ as: "accueil" }); // ou checkA11y(page, { as: "accueil" })
65
+ });
613
66
  ```
614
67
 
615
- `--evidence` illustrates each non-conformity with an **annotated crop of the offending
616
- element**, cut from the page snapshot: `selectorHint` is lossy, and a rendered-tier finding on
617
- a client-rendered page is anchored at `dom.html:2` whatever it is really about. It illustrates
618
- the Markdown conformance report as much as the HTML — one set of files in `assets/`, referenced
619
- by every document that shows the defect — so `--html` is not required to get pictures.
68
+ Cypress : `ultra11y(on)` dans `setupNodeEvents` (import depuis `ultra11y/cypress/plugin`),
69
+ `import "ultra11y/cypress"` dans le fichier de support, puis `cy.ultra11y({ as: "accueil" })`.
70
+ `sweepSample()` parcourt l’échantillon déclaré dans `.ultra11yrc.json`. Options :
71
+ [`references/e2e.md`](skills/ultra11y/references/e2e.md).
620
72
 
621
- It needs snapshots, and it says per page and per criterion what it could not draw and why — an
622
- occurrence with no picture must never read as an occurrence with no defect. It distinguishes
623
- an occurrence *folded* into another's picture from a distinct defect a limit *cut off*, because
624
- only the second is a gap.
73
+ Tests unitaires : `audit` lit les instantanés `__snapshots__/*.snap` de Jest et Vitest tels quels,
74
+ et `checkA11y(container)` ou `expect(container).toBeAccessible()` (depuis `ultra11y/vitest` ou
75
+ `ultra11y/jest`) auditent un composant rendu par jsdom. Voir [`references/rendered.md`](skills/ultra11y/references/rendered.md).
625
76
 
626
- The skill (`skills/ultra11y/SKILL.md` + `references/`) teaches the agent when and how to run these, how to complete the manual criteria, and the native-first authoring doctrine.
77
+ **3. En CI : le bot [`rgaa-audit` d’iterion](https://github.com/SocialGouv/iterion/tree/main/bots/rgaa-audit).**
78
+ Il installe le moteur à une version épinglée, rend l’échantillon de pages, fait arbitrer et
79
+ contre-vérifier les critères par des agents en lecture seule, contrôle le résultat avec `check`
80
+ et ouvre un ticket par critère non conforme. Voir [`references/ci.md`](skills/ultra11y/references/ci.md).
627
81
 
628
- ## Démo RGAA : le refuge
82
+ ## Commandes
629
83
 
630
- Le dépôt contient un [site de démonstration local](demos/refuge-rgaa/README.txt)
631
- avec **59 scénarios volontairement non conformes et 59 témoins séparés**.
632
- Il prolonge la démo Microsoft Edge, conservée avec sa licence et sa provenance
633
- dans [`demos/microsoft-edge-a11y`](demos/microsoft-edge-a11y).
84
+ Le moteur en ligne de commande sert surtout à l’agent et au bot. Ce qu’une personne peut
85
+ lancer elle-même, avec `npx ultra11y <commande>` (tout le reste : `npx ultra11y --help`) :
634
86
 
635
- ```sh
636
- pnpm run demo:refuge # Python 3 ; http://127.0.0.1:8765/
637
- pnpm run demo:refuge:check # ressources, liens, critères et séparation des témoins
638
- ```
639
-
640
- Les pages et les médias sont fournis : aucune génération ni dépendance Python
641
- supplémentaire n’est nécessaire pour visiter le site. Le
642
- [guide de la démo](demos/refuge-rgaa/README.txt) décrit la reconstruction,
643
- les tests navigateur et les commandes d’audit. Le catalogue et les verdicts
644
- attendus restent hors du site audité ; ils ne constituent pas des détections
645
- mesurées de l’outil. Cette démo ne prétend pas couvrir les 106 critères du RGAA.
646
-
647
- ## Development
87
+ | Commande | Rôle |
88
+ |---|---|
89
+ | `audit <chemins> --standard rgaa --out audits --json` | passe le moteur statique sur le code |
90
+ | `scan <url> --merge audits/audit-latest.json` | mesure une page dans un navigateur |
91
+ | `report --in audits/audit-latest.json --standard rgaa --html` | écrit le rapport daté |
92
+ | `pages --in audits/audit-latest.json --format report --split page` | un dossier par page |
93
+ | `check --report <rapport.md>` | contrôle l’intégrité d’un rapport |
94
+ | `tickets --in audits/audit-latest.json --dry-run` | prépare les tickets GitHub, GitLab ou Jira |
95
+ | `criteria --standard rgaa 8.3` | texte officiel d’un critère, ses tests, le glossaire |
96
+ | `install --all` · `status` | branche le hook dans les agents, dit ce qui est actif |
97
+
98
+ ## Pourquoi s’y fier
99
+
100
+ - **Le silence ne vaut pas conformité.** Un critère que personne n’a vérifié reste « à
101
+ évaluer ». Seuls 8.3 et 8.5 (langue et titre de la page) peuvent être déclarés conformes
102
+ sur une mesure complète sans erreur :
103
+ **104 critères sur 106 demandent un arbitrage pour obtenir `C`**.
104
+ - **Le moteur fait le travail mécanique** : 102 vérifications statiques, puis le rendu.
105
+ Sur les 258 tests officiels, une règle tranche
106
+ **30 tests `static` sur 22 critères** et **3 tests `rendered` sur 3 critères** ;
107
+ les **225 tests `judgment` sur 92 critères** passent par l’agent.
108
+ - **Chaque verdict cite sa preuve.** `check` et `verify` rejettent un critère inventé, une
109
+ non-conformité sans élément réel, un « conforme » sur des preuves incomplètes.
110
+ - **Mesuré sur un corpus qu’il n’a pas écrit** (W3C ACT). Chiffres et limites :
111
+ [Couverture](https://socialgouv.github.io/ultra11y/couverture.html),
112
+ [Fiabilité](https://socialgouv.github.io/ultra11y/fiabilite.html). Ce n’est pas une
113
+ certification : avant une déclaration officielle, une personne compétente relit les verdicts.
114
+
115
+ ## Référentiels
116
+
117
+ Le RGAA 4.1.2 est livré avec ultra11y (`--standard rgaa`, ou `{ "standard": "rgaa" }` dans
118
+ `.ultra11yrc.json`) ; il repose sur les WCAG 2.2 AA, le socle interne du moteur. Un autre pays
119
+ s’ajoute par un paquet JSON : [`references/packs.md`](skills/ultra11y/references/packs.md), [`CONTRIBUTING.md`](CONTRIBUTING.md).
120
+
121
+ ## Développement
648
122
 
649
123
  ```sh
650
124
  pnpm install
651
- pnpm test # vitest
652
- pnpm run typecheck
653
- pnpm run build # tsup → scripts/ultra11y.mjs (engine) + dist/ (the e2e plugins)
654
- pnpm run check:build # asserts every committed artefact is reproducible from its source
655
- pnpm run build:wcag # re-derive src/data/wcag.json from the vendored W3C source
656
- pnpm run build:pack:rgaa # re-build the RGAA pack from the vendored DINUM source
657
- pnpm run build:criteria # regenerate skills/ultra11y/references/criteria.md
658
- ```
659
-
660
- Releases are cut automatically by **semantic-release** on push to `main` (GitHub release +
661
- npm publish via OIDC trusted publishing, plus the moving `v5` major tag). The version bump is
662
- decided by **Conventional Commits**: a commit whose subject carries no `feat:`/`fix:` prefix
663
- is analysed as *no release*, so a change that must ship needs at least one conventional commit
664
- in the range — otherwise the major alias and npm keep serving the previous version while `main`
665
- moves on.
666
-
667
- ## Data & licensing
668
-
669
- - ultra11y's code: **MIT** (see `LICENSE`).
670
- - The **WCAG 2.2** success-criteria dataset (`src/data/wcag.json`) is derived from the official W3C source ([w3c/wcag](https://github.com/w3c/wcag)); WCAG 2.2 is © **W3C**, reused under the **W3C Document License** (only SC ids/titles/levels are reproduced) — see `NOTICE`.
671
- - The **RGAA pack** (`src/data/standards/rgaa.json`, `rgaa.glossary.json`) is derived from the official **RGAA 4.1.2** reference published by DINUM/DISIC, under the **Licence Ouverte / Etalab 2.0** — see `NOTICE`. Attribution: « RGAA 4.1.2 — DINUM ».
672
- - The report format is inspired by DINUM/etalab-ia audit conventions; the native-first authoring rules are adapted from the SocialGouv accessibility skill. No source code was copied.
125
+ pnpm test && pnpm run lint && pnpm run typecheck
126
+ pnpm run build # moteur (scripts/ultra11y.mjs) et bibliothèque (dist/)
127
+ pnpm run check:build # chaque artefact commité se reconstruit à l’identique
128
+ pnpm run build:site # régénère les chiffres du site (site/)
129
+ pnpm run build:pack:rgaa # reconstruit le paquet RGAA depuis la source DINUM
130
+ ```
131
+
132
+ Les versions sont publiées par semantic-release à chaque push sur `main`, selon les
133
+ Conventional Commits : un commit sans préfixe `feat:` ou `fix:` ne déclenche aucune version.
134
+
135
+ ## Données et licences
136
+
137
+ - Code d’ultra11y : **MIT** (voir `LICENSE`).
138
+ - Le **paquet RGAA** (`src/data/standards/rgaa.json`, `rgaa.glossary.json`) dérive du **RGAA 4.1.2**
139
+ publié par la DINUM, sous **Licence Ouverte / Etalab 2.0**. Attribution : « RGAA 4.1.2 — DINUM ».
140
+ - Les critères **WCAG 2.2** (`src/data/wcag.json`) dérivent de la source officielle du W3C
141
+ ([w3c/wcag](https://github.com/w3c/wcag)), © **W3C**, sous **W3C Document License**.
142
+ - Le format du rapport s’inspire des conventions d’audit de la DINUM et d’etalab-ia ; les règles
143
+ d’écriture accessible sont adaptées de la skill SocialGouv. Aucun code source n’a été copié.
144
+ - Détail de chaque source et de chaque dépendance intégrée : `NOTICE`.