skills/accessibility-ci/SKILL.md
--- name: accessibility-ci description: Ship accessibility as a CI gate, not a hope. Wires axe-core unit tests (jest-axe or vitest-axe), @axe-core/playwright e2e, Lighthouse CI, aria-live regions for async state, and focus management in modals. Use right after `/ro:cf-ship` as part of `/ro:app-polish` check #7. category: quality-review argument-hint: [--runner vitest|jest] [--lighthouse] [--skip-e2e] allowed-tools: Bash(*) Read Write Edit Glob Grep content-pipeline: - pipeline:review - platf
npx skillsauth add RonanCodes/ronan-skills skills/accessibility-ciInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ship accessibility checks as code, not as a one-time audit. The three-layer stack catches ~80% of real issues:
vitest-axe / jest-axe on critical components.@axe-core/playwright on key flows.Manual testing (screen reader, keyboard navigation) catches the rest. This skill wires the automated layers; the manual layer is a checklist, not automation.
/ro:accessibility-ci # full install: unit + e2e + lighthouse + aria patterns
/ro:accessibility-ci --runner jest # jest-axe instead of vitest-axe
/ro:accessibility-ci --lighthouse # add Lighthouse CI only
/ro:accessibility-ci --skip-e2e # skip Playwright axe wiring
vitest-axe or jest-axe with a helper for component-level tests.@axe-core/playwright for e2e on critical routes.@lhci/cli with PR thresholds for a11y + performance.aria-live regions on async state containers (loading, error, fetched content).pnpm add -D vitest-axe axe-core @testing-library/react
// src/test/axe-helper.ts
import { axe, toHaveNoViolations } from 'vitest-axe'
import { expect } from 'vitest'
expect.extend({ toHaveNoViolations })
export async function expectNoA11yViolations(container: HTMLElement) {
const results = await axe(container)
expect(results).toHaveNoViolations()
}
Test example:
// src/components/ShareButton.test.tsx
import { render } from '@testing-library/react'
import { ShareButton } from './ShareButton'
import { expectNoA11yViolations } from '@/test/axe-helper'
test('ShareButton is accessible', async () => {
const { container } = render(<ShareButton puzzleDate="2026-04-12" />)
await expectNoA11yViolations(container)
})
What to cover:
role= or aria-* attributes you added manually.aria-label).What NOT to cover: every leaf component. Axe is fast but it's not the unit test's job to re-check every render.
pnpm add -D @axe-core/playwright
// e2e/accessibility.spec.ts
import { test, expect } from '@playwright/test'
import AxeBuilder from '@axe-core/playwright'
const routes = ['/', '/how-it-works', '/api/docs']
for (const route of routes) {
test(`a11y: ${route}`, async ({ page }) => {
await page.goto(route)
const results = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21aa'])
.analyze()
expect(results.violations).toEqual([])
})
}
Tag choice matters. wcag2aa is the usual bar. Skipping wcag2aaa (stricter) is fine — almost nothing passes AAA without deliberate tradeoffs.
Common false positives:
color-contrast on disabled buttons — axe flags these. Use .exclude('[disabled]') if the contrast is deliberate per your design system.region on landmarks — if your app is a single-page utility, axe may want a <main> wrapper.pnpm add -D @lhci/cli
// lighthouserc.json
{
"ci": {
"collect": {
"startServerCommand": "pnpm preview",
"url": ["http://localhost:4173/", "http://localhost:4173/how-it-works"],
"numberOfRuns": 3
},
"assert": {
"assertions": {
"categories:accessibility": ["error", { "minScore": 0.95 }],
"categories:best-practices": ["warn", { "minScore": 0.9 }],
"categories:seo": ["warn", { "minScore": 0.9 }],
"categories:performance": ["warn", { "minScore": 0.8 }]
}
},
"upload": {
"target": "temporary-public-storage"
}
}
}
Accessibility score as error at 0.95 means the PR blocks on regression. Other categories as warn lets the team see scores without failing builds on routine fluctuation.
# .github/workflows/accessibility.yml
name: Accessibility
on: [pull_request]
jobs:
a11y:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test:unit
- run: pnpm exec playwright install --with-deps chromium
- run: pnpm build
- run: pnpm exec playwright test e2e/accessibility.spec.ts
- run: pnpm exec lhci autorun
pnpm test:unit covers the vitest-axe assertions; the Playwright step covers e2e axe; Lighthouse runs last against the built app.
aria-live on async stateAny region that updates after initial render (loading spinner → content, error messages, toast notifications) needs aria-live so screen readers announce the change.
<div role="status" aria-live="polite" aria-busy={isLoading}>
{isLoading && <span>Loading definitions…</span>}
{error && <span role="alert">Failed to load: {error.message}</span>}
{definitions && <DefinitionsList items={definitions} />}
</div>
polite vs assertive:
polite waits for the user to finish what they're saying. Use for most updates.assertive interrupts. Use only for errors or urgent alerts (role="alert" is already assertive).aria-busy toggles off announcements during active loads so the screen reader doesn't read every progressive render.
Most dialog primitives (Radix Dialog, Headless UI Dialog) handle this. If hand-rolling:
const triggerRef = useRef<HTMLButtonElement>(null)
const dialogRef = useRef<HTMLDivElement>(null)
useEffect(() => {
if (open) {
dialogRef.current?.querySelector<HTMLElement>('[data-autofocus]')?.focus()
} else {
triggerRef.current?.focus()
}
}, [open])
<main>TanStack Router:
// src/routes/__root.tsx
import { useEffect } from 'react'
import { useRouter } from '@tanstack/react-router'
function FocusManager() {
const router = useRouter()
useEffect(() => {
const unsub = router.subscribe('onResolved', () => {
document.getElementById('main-content')?.focus()
})
return unsub
}, [router])
return null
}
With <main id="main-content" tabIndex={-1}> in the shell.
First focusable element on the page should be a skip link:
<a
href="#main-content"
className="sr-only focus:not-sr-only focus:absolute focus:top-0 focus:left-0 focus:p-2 focus:bg-white focus:z-50"
>
Skip to main content
</a>
Invisible until focused (via tab). Every page should have one.
prefers-reduced-motion?| Violation | Fix |
|---|---|
| button-name | Icon-only button missing aria-label. Add aria-label="Share". |
| color-contrast | Text too light on background. Darken or thicken the text, don't just add bold. |
| label | Input missing a label. Wrap in <label> or use aria-labelledby. |
| image-alt | <img> without alt. Decorative → alt="", informative → descriptive alt. |
| landmark-one-main | No <main> element. Wrap the main content. |
| heading-order | Skipping heading levels (h1 → h3). Use semantic levels, style with CSS. |
| aria-valid-attr-value | Typo'd aria attribute value. Usually aria-expanded="true" vs aria-expanded={true} in JSX. |
aria-label typos before Playwright or Lighthouse ever run.disabledRules: ['color-contrast'], first ask whether the design is wrong.<input> that looks labelled in JSX may not be — check the rendered DOM./ro:app-polish — umbrella; this is check #7/ro:keyboard-shortcuts — complementary; focus + keyboard nav live together/ro:visual-regression — catches focus-ring regressions that axe misses/ro:playwright-check — the underlying browser tooltesting
--- name: linear-pipeline description: The Fable orchestrator for a single dispatched Linear ticket. Holds almost no context itself; it receives `--issue <ID> --detached`, decides the stage sequence, and fans out a sub-agent per stage, passing forward only each stage's artifact (never re-derived, never inlined into its own context). Step zero, before any planning or stage routing, is a boundary triage against `canon/security-boundary.md` (#199): a match tags Ronan Connolly and stops the run, no
development
--- name: in-your-face description: Capture a chat-only answer into a durable artifact (markdown + HTML, PDF when cheap) and launch it automatically so the user cannot miss it. Use when user says "in your face", "don't let me lose this", "save that answer", "make that durable", or right after answering a substantive side question (a recipe, comparison, how-to, or generated prompt) that would otherwise die with the context. category: workflow argument-hint: [--no-open] [--vault <short>] [hint of
tools
One-shot headless OpenAI Codex CLI calls for background/admin AI tasks — summaries, classification, extraction, admin glue. The default engine for anything that runs AI constantly in the background (daemon-driven, per-event), because it bills the flat ChatGPT subscription instead of Claude usage or per-token API spend, and it keeps working while Claude is rate-limited. NEVER for coding — coding stays Claude. Use when a skill or daemon needs a cheap always-on AI call, when the user says "use codex", "ask codex", "codex as backup", or when building a background summarizer/classifier into a listener or loop. Reads auth from ~/.codex/auth.json (ChatGPT account, no API key).
research
Turn a warranty rejection, repair quote, or RMA email into a cited decision brief — legal read (NL/EU consumer law), is the part user-serviceable, live part and new-unit prices, repair-vs-DIY-vs-new economics, before-you-send-it checklist, deadlines. Use when the user pastes or screenshots a repair quote, warranty rejection, "not covered" email, onderzoekskosten fee, or asks "should I repair or replace this".