skills/a11y-testing/SKILL.md
Automated accessibility testing with axe-core, Playwright, and jest-axe for WCAG compliance. Use when adding or validating a11y tests, running WCAG checks, or auditing UI accessibility.
npx skillsauth add pedronauck/skills a11y-testingInstall 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.
Automated accessibility testing with axe-core for WCAG 2.2 compliance. Catches 30-50% of issues automatically.
// jest.setup.ts
import { toHaveNoViolations } from 'jest-axe';
expect.extend(toHaveNoViolations);
// Button.test.tsx
import { render } from '@testing-library/react';
import { axe } from 'jest-axe';
it('has no a11y violations', async () => {
const { container } = render(<Button>Click me</Button>);
expect(await axe(container)).toHaveNoViolations();
});
// e2e/accessibility.spec.ts
import { test, expect } from "@playwright/test";
import AxeBuilder from "@axe-core/playwright";
test("page has no a11y violations", async ({ page }) => {
await page.goto("/");
const results = await new AxeBuilder({ page })
.withTags(["wcag2a", "wcag2aa", "wcag22aa"])
.analyze();
expect(results.violations).toEqual([]);
});
test("modal state has no violations", async ({ page }) => {
await page.goto("/");
await page.click('[data-testid="open-modal"]');
await page.waitForSelector('[role="dialog"]');
const results = await new AxeBuilder({ page })
.include('[role="dialog"]')
.withTags(["wcag2a", "wcag2aa"])
.analyze();
expect(results.violations).toEqual([]);
});
# .github/workflows/accessibility.yml
name: Accessibility
on: [pull_request]
jobs:
a11y:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: "20", cache: "npm" }
- run: npm ci
- run: npm run test:a11y
- run: npm run build
- run: npx playwright install --with-deps chromium
- run: npm start & npx wait-on http://localhost:3000
- run: npx playwright test e2e/accessibility
| Decision | Choice | Rationale | | -------------- | --------------------------- | ----------------------------------- | | Test runner | jest-axe + Playwright | Unit + E2E coverage | | WCAG level | AA (wcag2aa) | Industry standard, legal compliance | | CI gate | Block on violations | Prevent regression | | Browser matrix | Chromium + Firefox | Cross-browser coverage | | Exclusions | Third-party widgets only | Minimize blind spots | | Tags | wcag2a, wcag2aa, wcag22aa | Full WCAG 2.2 AA | | State testing | Test all interactive states | Modal, error, loading |
// BAD: Disabling rules globally
const results = await axe(container, {
rules: { 'color-contrast': { enabled: false } } // NEVER disable rules
});
// BAD: Excluding too much
new AxeBuilder({ page })
.exclude('body') // Defeats the purpose
.analyze();
// BAD: Only testing happy path
it('form is accessible', async () => {
const { container } = render(<Form />);
expect(await axe(container)).toHaveNoViolations();
// Missing: error state, loading state, disabled state
});
// BAD: No CI enforcement
// Accessibility tests exist but don't block PRs
// BAD: Manual-only testing
// Relying solely on human review - catches issues too late
e2e-testing - Playwright E2E testing patternsunit-testing - Jest unit testing fundamentalsdesign-system-starter - Accessible component foundationsKeywords: jest, axe, unit test, component test, react-testing-library Solves:
Keywords: playwright, e2e, axe-core, page scan, wcag, integration Solves:
Keywords: ci, cd, github actions, accessibility gate, automation Solves:
development
Deep review of branch diffs, working trees, or GitHub PRs at any size. Use when the user asks for CodeRabbit-grade review, an incremental re-review after new pushes, publication of findings to a PR, a cross-LLM peer-review verdict round, or conformance review against spec artifacts. Don't use for applying fixes, reviewing specs or PRDs as documents, or quick single-file feedback.
tools
Orchestrate Claude and Codex worker TUIs from a controller agent through herdr panes and the herdr socket CLI. Use when delegating bounded tasks to herdr worker panes, running user-activated plan-first delegations (Claude Code plan mode, Codex Plan mode), waiting on native agent status (idle, working, blocked, done), or verifying worker reports. Workers launch as interactive TUIs via herdr agent start — never through headless runners (compozy exec, claude -p, codex exec). Not for cmux workspaces (see cmux-orchestration) and not for end-user herdr control.
tools
TanStack Query, Router, and Form patterns for React. Use when writing useQuery/queryOptions, mutations, caching, file-based routes, search params, loaders, or TanStack Form validation. Don't use for TanStack Start, TanStack DB/collections, Zustand client state, or non-TanStack routing.
development
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.