agentleFS
LeonxLJXLeonxLJX/web-engineer-skills/skills/web-a11y/SKILL.md

web-a11y

Skill0 starsChanged 2 months agoMITView on GitHub

Ship accessible UI by default — semantic HTML first, ARIA only when semantics fail, keyboard flows, focus management, and the checklist that catches 90% of issues. Use when building or reviewing any user-facing component.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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. Very specific:

    Every input has a <label for> (or aria-label when visually hidden).

    line 36
  2. Distinctive:

    Don't disable the submit button to "prevent double submit" without an announcement.

    line 38
  3. Distinctive:

    Don't rely on color alone to convey state (add icon/text).

    line 50

≈ “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

Accessibility as default

Semantics before ARIA

The cheapest accessible component is the native one. <button> gets focus, keyboard, and role for free; a <div onClick> gets nothing you don't hand-code.

  • Navigation → <nav> + list, forms → real <form>, dialogs → <dialog> or a tested primitive.
  • Custom widget? Before inventing one, check whether a native element (details, dialog, input types) covers it.
  • Reach for ARIA only to patch what semantics can't express: aria-expanded, aria-live, aria-current.

Keyboard: every feature has a path

For each interactive element verify: Tab reaches it → Enter/Space activates it → Escape exits overlays → arrows work inside composites (listbox, tabs, menu — follow the WAI-ARIA pattern for that widget, don't invent).

// ❌ div soup
<div className="menu-item" onClick={open}>Open</div>

// ✅ real button, real focus
<button type="button" onClick={open} aria-haspopup="menu">Open</button>

Focus management

  • Route change / modal open → move focus into the new surface; close → restore focus to the trigger.
  • One visible :focus-visible style per interactive element — removing focus outlines is a bug, not a design.
  • Trap focus inside modals (inert on background or a focus-trap primitive).

Forms

  • Every input has a <label for> (or aria-label when visually hidden).
  • Errors: reference the input via aria-describedby, set aria-invalid, announce via role="alert" or an aria-live region.
  • Don't disable the submit button to "prevent double submit" without an announcement; allow resubmission after fix.

Dynamic content

  • Async updates announce via aria-live="polite"; errors via assertive.
  • Loading states are real text (not just spinners) so SR users get feedback.
  • Toasts are live regions with a stable container, not remounted per message.

Visual

  • Contrast ≥ 4.5:1 text, ≥ 3:1 UI borders — verify with a tool, not by eye.
  • Zoom to 200%: no clipped functionality. Test prefers-reduced-motion — gate animations.
  • Don't rely on color alone to convey state (add icon/text).

Definition of done (agent checklist)

  • Tab order follows visual order; no tabindex > 0
  • Every icon-only control has aria-label
  • Images: meaningful alt, decorative alt=""
  • Dialogs: focus trapped, Escape closes, focus restored
  • axe/Lighthouse a11y pass, manual keyboard walkthrough done
  • No positive tabindex, no outline: none without replacement

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.