web-accessibility
Skill1 starsChanged 2 months agoMITView on GitHub
Make a web UI genuinely usable with a keyboard and a screen reader - semantic HTML first, focus management, ARIA only where HTML fails, colour contrast, form labelling, and live regions - with a manual audit checklist and the real-world failures that reject audits (modals, menus, custom selects, focus loss on route change). Use when building or fixing a11y, when a screen reader user is blocked, when a modal or dropdown traps focus, when an automated audit reports violations, or before a launch that requires WCAG conformance. Triggers on "accessibility", "a11y", "WCAG", "screen reader", "keyboard navigation", "focus trap", "aria-label", "alt text", "color contrast", "axe", "Lighthouse accessibility", "tab order", "role".
22 other projects use a version of this.
Adopted by
Most recently taken up by
- autohandai/community-skillstheir own version, first seen Nov 29, 2026
- Lukk17/agent-standardstheir own version, first seen Nov 24, 2026
- meza/skillstheir own version, first seen Nov 15, 2026
- aktsmm/Agent-Skillstheir own version, first seen Nov 10, 2026
- Shui-Ching/skillstheir own version, first seen Nov 8, 2026
- reddygopalkrishna/developer-agent-skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use web-performance and api-design.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MRCalderon3DSkillweb-performance
Keep a browser game inside its frame budget through allocation discipline, pooling, and devtools-driven profiling.
Also in 3 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
Other versions22 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 22
- hoodini/ai-agents-skills★ 303same name
- magnus919/agent-skills★ 197same name
- ziniman/ai-instruct★ 29same name
- aktsmm/Agent-Skills★ 27same name
- s-hiraoku/synapse-a2a★ 17same name
- autohandai/community-skills★ 14same name
- reddygopalkrishna/developer-agent-skills★ 8same name
- chadixearth/graphyloop★ 3same name
- 1leyo/web-accessibility-skill★ 2same name
- Adhamxon/claude-code-skills★ 2same name
12 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository126 other files it gives its agents.
- eu-data-backend-job-hunterSkill
- job-application-matcherSkill
- llm-agents-and-tool-useSkill
- llm-application-architectureSkill
- llm-cost-and-latency-optimizationSkill
- llm-evaluationSkill
- llm-fine-tuning-and-adaptersSkill
- llm-privacy-and-safetySkill
- llm-prompt-engineeringSkill
- llm-rag-systemsSkill
- structured-output-and-jsonSkill
- graphql-api-designSkill
- pagination-and-filteringSkill
- rest-api-designSkill
- webhooks-and-integrationsSkill
- caching-architecture-multi-layerSkill
- resilience-patternsSkill
- service-boundaries-and-monolithsSkill
- system-design-interviewSkill
- go-concurrencySkill
- go-error-handlingSkill
- java-spring-patternsSkill
- nodejs-server-performanceSkill
- python-async-patternsSkill
- python-data-modelingSkill
- python-packaging-and-toolingSkill
- python-performanceSkill
- rest-api-implementationSkill
- rust-error-handlingSkill
- rust-ownership-patternsSkill
- typescript-type-safetySkill
- ci-caching-and-speedupSkill
- ci-pipeline-designSkill
- deployment-strategiesSkill
- github-actions-hardeningSkill
- release-versioning-and-changelogsSkill
- reproducible-buildsSkill
- aws-iam-and-securitySkill
- aws-serverless-architectureSkill
- azure-fundamentalsSkill
- cloud-cost-optimizationSkill
- cloud-networking-and-vpcSkill
- gcp-cloud-architectureSkill
- code-review-skillsSkill
- design-review-and-refactoring-architectureSkill
- refactoring-techniqueSkill
- understanding-unknown-codebaseSkill
- buildkit-and-cacheSkill
- container-image-debuggingSkill
- container-runtime-securitySkill
- docker-compose-workflowsSkill
- dockerfile-authoringSkill
- docker-image-optimizationSkill
- database-connection-managementSkill
- database-transactionsSkill
- distributed-databasesSkill
- nosql-data-modelingSkill
- postgres-query-tuningSkill
- redis-and-cachingSkill
- schema-migrationsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 5 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Semantics: Use the native element that already has the role, keyboard behaviour, and state.
- Distinctive: line 24
Accessible name and description: Every interactive element needs a name that conveys its purpose.
- Distinctive: line 30
ARIA for the rest: Only for custom widgets; get the roles, states, and keyboard model right.
- Distinctive: line 61
Every focusable element needs a visible focus indicator that isn't removed.
- Very specific: line 77
If you don't, focus falls to <body> and the keyboard user restarts at the top of the page.
- Very specific: line 82
Route changes (SPA): after navigation, move focus to the new <h1> or a skip target and announce the change.
- Distinctive: line 104
The first rule of ARIA: don't use ARIA. Second rule: if you must, use a native element.
- Very specific: line 123
Never: put role on a <div> that should just be the right element, and never add a role that contradicts the element (e.g.
- Very specific: line 131
Check with a contrast tool or Lighthouse.
- Very specific: line 157
Autocomplete: use autocomplete attributes (email, name, one-time-code) — WCAG 1.3.5 and a huge real-world usability win.
- Very specific: line 188
Use polite (default) for non-urgent updates ("3 results", "Saved").
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Web Accessibility
Accessibility is mostly using the right HTML. ARIA is a patch for when
native elements cannot express the widget, not a substitute for a <button>.
The fastest way to an accessible UI is a semantic DOM; the fastest way to an
inaccessible one is a <div onclick>.
Target WCAG 2.2 AA unless a regulation says otherwise (many — ADA, EU EAA, Section 508, and public-sector rules in several countries — require AA and are legally enforceable).
The order of operations
- Semantics. Use the native element that already has the role, keyboard behaviour, and state. Most issues end here.
- Accessible name and description. Every interactive element needs a name that conveys its purpose.
- Keyboard. Everything operable by mouse is operable by keyboard, in a sensible order, with a visible focus indicator.
- Contrast and colour. Text ≥4.5:1, large text ≥3:1, UI/focus ≥3:1; never colour alone.
- ARIA for the rest. Only for custom widgets; get the roles, states, and keyboard model right.
Semantics first
| Instead of | Use | Why |
<div onclick> | <button type="button"> | Free role, Enter/Space, focusable, announced |
<a onclick> navigating | <a href="…"> | Link role, middle-click, right-click menu |
<div class="checkbox"> | <input type="checkbox"> (visually styled) | Free state (aria-checked/checked) |
<span role="button"> | <button> | Focus and keyboard for free |
<img> for a button icon | <button aria-label="Close"> | Name from label |
| Headings as text styling | <h1>…<h6> in order | Structure/navigation for screen readers |
<table> for layout | CSS grid/flex | Layout tables confuse screen readers |
| Placeholder as label | <label for> | Placeholders disappear and have poor contrast |
Two things native elements give you that you must otherwise hand-build: keyboard activation and correct role/state announced by the screen reader. A custom widget missing either is a bug.
Keyboard: the contract
- Tab / Shift+Tab move focus forward/back through interactive elements in DOM order. Make DOM order match visual order.
- Enter activates buttons/links; Space toggles buttons/checkboxes; Enter submits forms.
- Escape closes dialogs, menus, popovers.
- Arrow keys move within composite widgets: tabs, menus, listboxes, radio groups, grids.
Tabshould not be trapped except inside a modal dialog, where trapping is the point.- Every focusable element needs a visible focus indicator that isn't
removed. If you hide the default outline, replace it:
(Never:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }outline: nonewithout an equal-or-better replacement. Keep:focus-visibleso mouse users don't see rings, but keyboard users always do.) - Disabled controls: a truly
disabledbutton is not focusable (usearia-disabled="true"+ keep it focusable if the user must discover why it's unavailable).
Focus management — the part teams forget
- On mount, move focus to the new content (a dialog, a wizard step, an error summary).
- On unmount, return focus to the trigger, or the nearest sensible ancestor.
If you don't, focus falls to
<body>and the keyboard user restarts at the top of the page. - Modals: on open, focus the first focusable (or the dialog itself); trap Tab inside; on close, restore focus to the trigger. Implement this yourself or use a component library that does it (Radix, Headless UI, React Aria).
- Route changes (SPA): after navigation, move focus to the new
<h1>or a skip target and announce the change. Otherwise the screen reader user is still "on" the old page. This is the single most common SPA a11y failure — focus silently stays where it was or resets unpredictably. - Deleting the focused element: move focus to a sensible neighbour, not nowhere.
// Route change: focus the new heading.
const { pathname } = useLocation();
const heading = useRef<HTMLHeadingElement>(null);
useEffect(() => { heading.current?.focus(); }, [pathname]);
// …<h1 ref={heading} tabIndex={-1}>New page</h1>ARIA, only where HTML fails
ARIA changes what a screen reader announces and nothing else. It does not add
behaviour. Adding role="button" to a <div> does not make Enter/Space work or
make it focusable — you still owe it tabindex="0" and key handlers. Prefer the
native element and skip all of it.
- The first rule of ARIA: don't use ARIA. Second rule: if you must, use a
native element. The
aria-*you are most likely to need:aria-label,aria-labelledby,aria-describedby,aria-expanded,aria-controls,aria-current,aria-pressed(toggle buttons),aria-haspopup. aria-labeloverrides the content. On a<button>with text,aria-labelreplaces that text for the screen reader — if they differ, the label wins, which is a bug magnet. Prefer visible text overaria-labelwhen there is visible text.- A native
<select>is better than a custom listbox (less code, mobile picker, correct announcement). Build a custom one only if the design demands it, and then it must be a fullrole="listbox"/option(ormenu) widget with arrow-key, Home/End, type-ahead, andaria-activedescendantor rovingtabindex. - Toggle vs checkbox. A button that toggles:
aria-pressed="true|false". A checkbox:<input type="checkbox">(orrole="checkbox"+aria-checked). Don't confuse them. - Tabs:
role="tablist",role="tab"witharia-selected, arrow-key navigation, and each panelrole="tabpanel"linked viaaria-controls/aria-labelledby. - Never put
roleon a<div>that should just be the right element, and never add a role that contradicts the element (e.g.role="button"on an<a href>).
Colour and visual
- Contrast: body text ≥ 4.5:1, large text (≥18.66px bold or ≥24px)
≥ 3:1, UI components and focus indicators ≥ 3:1 (WCAG 2.1 AA).
Check with a contrast tool or Lighthouse;
opacity, greys-on-white, and placeholder text are the usual offenders. - Never colour alone: errors need text/icon too, not just red; charts need patterns/labels.
- Text zoom: support 200% browser zoom and
rem-based sizing; don't fixpxheights that clip. prefers-reduced-motion: disable non-essential animation.@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }- Don't disable zoom (
user-scalable=noin the viewport meta) — WCAG 1.4.4. Correct viewport meta:width=device-width, initial-scale=1.
Forms
- Every field has a
<label for="id">. Placeholders are not labels (they vanish on input and often fail contrast). - Group related fields in a
<fieldset>with a<legend>(radio sets, address blocks). - Errors: identify the field in text, tie it with
aria-describedby, and setaria-invalid="true". Put a summary at the top on submit that links to the failing fields. - Required: mark with the
requiredattribute (and a visible "required" indicator, sincerequiredis not always announced). - Autocomplete: use
autocompleteattributes (email,name,one-time-code) — WCAG 1.3.5 and a huge real-world usability win. - Don't disable the submit button on an invalid form; let the user submit and show what's missing. A permanently disabled button gives no feedback.
- Buttons say what they do ("Save changes"), not "Submit"/"OK" in a dialog that needs context.
Images and media
- Meaningful images:
altdescribing the function ("Search results settings"), not "image of a chart" — oralt=""if purely decorative. - Decorative images:
alt=""(empty, not omitted) so they're skipped. - Complex images (charts, diagrams): a text alternative nearby or a
figcaption/long description —altis not a caption. - Video: captions (
<track kind="captions">) for audio; if the video is decorative, mark itaria-hiddenand provide a transcript. - Icon-only buttons:
aria-label="Close"(or visually-hidden text).
Live regions (announcing dynamic change)
A live region is a container you put text into; screen readers announce changes to it. It must exist in the DOM before the content changes — a region added at the same time as its text is often not announced.
<div aria-live="polite" role="status"> <!-- for status, waits for a pause -->
<p>{statusMessage}</p>
</div>
<div aria-live="assertive" role="alert">…</div> <!-- for errors, interrupts -->- Use
polite(default) for non-urgent updates ("3 results", "Saved");assertive/role="alert"only for errors that must interrupt. - Don't announce every keystroke — debounce search-result announcements.
- Re-rendering a live region wholesale can double-announce; keep it stable and change only the text node.
- Announce route changes, save/save-failed, toasts, item counts.
Dynamic titles and landmarks
- One
<h1>per page; heading levels shouldn't skip. - Landmarks (
<header>,<nav>,<main>,<footer>,<aside>) let users jump; give<nav>an accessible name if there are several (aria-label="Primary"). - Skip link as the first focusable element:
(visually hidden until focused).<a class="skip-link" href="#main">Skip to main content</a> - Set
document.titleper route — the screen reader announces the title on navigation. aria-current="page"on the active nav link.
Common real-world failures (the ones that block people)
- Modal not trapping focus / not restoring it. Tab escapes to the
background; on close, focus is lost. Use a dialog component with a focus
trap,
role="dialog" aria-modal="true", labelled by its title, Escape to close, and focus restore. - Custom menu or select that isn't keyboard-operable. Needs
role="menu"/menuitemorlistbox/option, arrow keys, Escape, and focus management. Most custom dropdowns fail all of these. - Focus lost on SPA route change (see above) — the #1 SPA failure.
- Icon buttons with no name (icon-only, no
aria-label) — announced as "button" with no purpose. - Placeholder-as-label and missing form labels.
- Off-canvas / hamburger menu that doesn't manage focus or announce
expanded state (
aria-expanded,aria-controls). - Colour-only errors / low contrast grey text.
- Images without alt, or
altthat says "image". - Skeleton/loading without
aria-busy/live announcement — the user doesn't know content arrived. - Disabled controls as the only feedback, and tooltips as the only label.
- Keyboard traps in a non-modal widget (a carousel or editor that eats Tab with no way out) — worse than broken focus; users get stuck.
- Custom checkbox/radio/toggle that isn't
<input>and lacksaria-checked/keyboard.
Manual audit checklist (do this; tools can't)
Tools (axe, Lighthouse) catch ~30–40% of issues. The rest need a keyboard and
eyes. Load references/wcag-checklist.md for the full pass/fail checklist with
per-criterion references.
- Unplug the mouse. Tab through the whole page: can you reach everything? Is order logical? Is focus always visible?
- Activate every control with Enter/Space/arrows/Escape as appropriate.
- Open and close every overlay with Escape; confirm focus is trapped and restored.
- Navigate to each route: does focus/announcement move to the new content?
- Zoom to 200% and 400%: no horizontal scroll, nothing clipped.
- Check contrast of text, placeholders, borders, focus rings.
- Turn on a screen reader (VoiceOver
Cmd+F5, NVDA, TalkBack) and listen to the primary flow: are names, roles, states, and updates correct? - Disable images/CSS: does content and function survive?
- Check
prefers-reduced-motionandprefers-color-scheme.
Automated tooling (a floor, not a ceiling)
- Lighthouse / axe DevTools for a quick pass; axe-core or
@axe-core/reactin CI to gate merges. - eslint-plugin-jsx-a11y for the common React mistakes.
- These catch missing
alt, bad ARIA, contrast, missing labels — but not focus order, focus management, or whether the flow makes sense.
Gotchas
- Focusing a programmatic target needs
tabindex="-1".heading.focus()on an<h1>with notabindexis a no-op in most browsers, so the route-change fix silently does nothing.tabindex="-1"is programmatic-only: it stays out of the Tab order. - A native
<dialog>opened withshowModal()moves focus and traps it for you; opening it by setting theopenattribute does not. The second form is an ordinary element in the flow — Tab walks straight out of it and focus is never restored on close. UseshowModal()/close(), or a component library. aria-modal="true"on a background page element does not trap Tab and sometimes makes worse software hide the rest of the page from the screen reader entirely with no keyboard to escape from. Move the modal to a portal and trap focus in a keydown handler.inertis the accessible replacement for hand-rolled focus traps, and only where supported (every current engine; older ones need thearia-hidden+tabindexdance). Settinginerton the app root while the dialog is open removes everything behind it from focus and the accessibility tree in one attribute.aria-hidden="true"on an element containing a focusable descendant is a hard WCAG failure (1.3.1 / 4.1.2), and it is how icon libraries break a page. Screen readers skip it, sighted keyboard users land in it. Useinert, ordisplay: none.- A live region created in the same render as its text is usually never
announced. The region has to be in the DOM, and the assistive technology has
to have registered it, before the text node changes. Render the empty region
first, then set the message; changing a region's
aria-livevalue after mount does not re-trigger announcements. - An assertive region is not just louder, it is a queue-jumper — it
interrupts the user's speech and they lose what they were listening to. One
role="alert"per form submit, never one per validation keystroke; for everything else usepoliteand debounce. - Grey placeholder text and
opacity-faded helper text fail contrast even when the label next to them passes.#999on white is about 2.8:1, well under the 4.5:1 required for anything under 24px; the same value is fine on a 4.5:1 background and fails on a lighter one, so check each pair, not the palette. - Focus indicators are held to 3:1 against adjacent colours, including the
background behind the element. A 2px ring at 1.8:1 on a white card is a WCAG
1.4.11 failure even though it "looks visible" in a design review.
outlinewithoutline-offsetalso survives forced-colors/high-contrast mode;box-shadowdoes not. - A
titleattribute is not a label and aplaceholderis not a label.titleis a tooltip that only appears on hover, is unreachable by keyboard or touch, and is skipped by several screen readers. Every control needs visible text,<label for>,aria-label, oraria-labelledby— nothing else counts. - Focus management on navigation must be driven by the router's location, not
by the nav link's click handler, and must skip the initial mount. A handler
never fires on Back (
popstateis the only signal that does), so a screen-reader user is stranded on the old page; an unguardeduseEffectthat focuses on mount also yanks focus to the top of the page out from under someone who merely tabbed in. Observelocation, and skip the first run. - Dismissing a dialog by removing it from the DOM leaves focus on
<body>. Capture the trigger in arefat open time (not at close time — by then it may have unmounted) and restore it in the cleanup.
Review checklist
- Interactive elements are native (
<button>,<a>,<input>), notdivs with handlers. - Every control has an accessible name; every field a real
<label>. - Focus is visible, ordered, and managed on route change and in overlays.
- Overlays trap focus, close on Escape, and restore focus.
- Dynamic changes are announced via live regions (debounced).
- Contrast meets 4.5:1 / 3:1; no colour-only meaning.
- One
<h1>, landmarks, skip link, per-routedocument.title. - The whole primary flow works keyboard-only, and a screen reader announces it sensibly.
Files
references/wcag-checklist.md— WCAG 2.1/2.2 AA success-criterion checklist, mapped to the failure it catches and how to fix it.
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
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.

