agentleFS
bkjain655bkjain655/agent-skills/skills/web-accessibility-wcag/SKILL.md

web-accessibility-wcag

Skill0 starsChanged 3 months agoMITView on GitHub

Web accessibility (WCAG 2.1 AA): landmarks, skip links, ARIA labels, chart text alternatives, keyboard navigation, reduced motion, and axe Playwright CI. Use when fixing a11y issues, adding accessibility tests, or preparing for WCAG compliance.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't remove outline without replacement

    line 67
  2. Very specific:

    Run on public routes in CI: /, /login, marketing pages.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Web Accessibility (WCAG)

Landmarks & skip link

// layout.tsx — first focusable element in body
<a href="#main" className="sr-only focus:not-sr-only focus:fixed focus:z-[100] ...">
  Skip to main content
</a>

// each route
<main id="main">...</main>

One <main> per page. Header nav: aria-label="Main navigation".

Icon buttons & forms

<button type="button" aria-label="Close dialog"><X /></button>
<Label htmlFor="email">Email</Label>
<Input id="email" aria-describedby="email-hint" />

Dialogs: require visible DialogTitle (Radix handles focus trap).

Progress bars

<Progress
  value={67}
  aria-label="Setup progress: step 3 of 5"
  aria-valuemin={0}
  aria-valuemax={100}
  aria-valuenow={67}
/>

Charts — WCAG 1.1.1 text alternative

Recharts/SVG charts need non-visual fallback:

<table className="sr-only">
  <caption>Asset allocation breakdown</caption>
  <thead><tr><th scope="col">Category</th><th scope="col">Share</th></tr></thead>
  <tbody>{rows.map(r => <tr key={r.label}><td>{r.label}</td><td>{r.value}</td></tr>)}</tbody>
</table>
<div aria-hidden="true"><ResponsiveContainer>...</ResponsiveContainer></div>

Also provide visible legend when possible.

Keyboard & focus

  • Interactive rows: avoid wrapping in <button> if children contain buttons — use role="group" + Enter/Space
  • Visible focus rings: focus-visible:ring-2 focus-visible:ring-offset-2
  • Don't remove outline without replacement

Reduced motion

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

Color contrast

  • Text on colored backgrounds: aim 4.5:1 (AA)
  • Chart slices: don't rely on color alone — labels in legend/tooltip/table

Automated testing (axe + Playwright)

npm install -D @axe-core/playwright
import AxeBuilder from "@axe-core/playwright";

const results = await new AxeBuilder({ page })
  .withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"])
  .analyze();
expect(results.violations).toEqual([]);

Run on public routes in CI: /, /login, marketing pages.

Checklist

- [ ] Skip link → #main works
- [ ] All images/icons have alt or aria-label
- [ ] Charts have sr-only table or summary
- [ ] Form errors linked to fields
- [ ] axe scan passes in CI
- [ ] prefers-reduced-motion respected

Anti-patterns

  • Tooltip-only data with no other access path
  • tabIndex={0} on non-interactive divs without role
  • Auto-playing motion without reduced-motion fallback
  • Nested interactive elements (button in button)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.