/alemtuzlak-skills:accessible-htmlfrom alemtuzlak-skills
Guides writing accessible HTML, JSX, Vue/Svelte/Angular templates, web components, and email HTML. Enforces WCAG 2.2 AA with non-negotiables for elements, labels, contrast, focus, and more.
Ships in alemtuzlak-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Accessible markup is not a pass you make later. It is how you write the markup the first time.
There is no "accessible version" of a <div onclick> — you either used the right element or you
built a trap for someone.
One rule above all: use the native HTML element that already does the job. Native elements ship focus, keyboard handling, state, and a role for free. Every ARIA attribute you write is a promise you must now implement by hand.
Target WCAG 2.2 Level AA unless told otherwise. That is the normal legal and contractual bar.
| Do this | Never this |
|---|---|
<button type="button"> for actions, <a href> for navigation | <div onclick>, <span onclick>, <div role="button">, <a> with no href |
<label for=id> or a wrapping <label> on every input | placeholder as the only label |
Every image has alt — describe it, or alt="" if decorative | missing alt; alt="image", alt="icon", filename as alt |
Real accessible name on every control (visible text, or visually-hidden text beside an aria-hidden="true" icon) | icon-only button with no name; empty link; title as the name |
One <h1>, then h2→h3→h4 with no skipped level | headings chosen for how big the text looks |
<html lang="en">; lang on foreign phrases too | no lang |
Landmarks: <header> <nav> <main> <footer>; one <main>; label each <nav> | div soup |
<title> unique per page; skip link to <main> | same title everywhere |
Every <iframe> has a title | untitled embeds |
Real lists in <ul>/<ol>/<dl>; add role="list" if you set list-style: none | fake lists of divs |
| Text contrast ≥ 4.5:1 (≥ 3:1 large text, UI borders, icons, focus rings) | grey-on-grey; "design QA will catch it" |
rem for font size, including clamp() bounds | px font size on :root/html/body |
Visible focus ring: :focus-visible, ≥ 2px, ≥ 3:1 contrast, uses outline | outline: none; ring only from box-shadow |
| DOM order == visual order | flex-direction: row-reverse, order:, or grid placement to reorder content |
| Interactive targets ≥ 24×24 CSS px (aim 44×44 on touch) | 12px icon hit areas |
<table> + <caption> + <th scope> for data | tables for layout; div grids for tabular data |
<meta name="viewport" content="width=device-width, initial-scale=1"> | user-scalable=no, maximum-scale=1 |
Unique id per element | duplicate ids (silently breaks for and aria-labelledby) |
Single-character shortcut (j, /, x) ships with an off switch, a remap, or focus scoping | bare single-key shortcuts with no escape hatch (WCAG 2.1.4, Level A) |
If a control is not reachable and operable with Tab / Shift+Tab / Enter / Space / arrows / Escape, it is broken. A keyboard user cannot use your feature at all — that is not a "nice to have".
Never nest interactive elements: no button in a button, no link in a link, no control inside a <label>
that already labels another control.
<button> over role="button".<div role="tab"><h3>…</h3></div>, not <h3 role="tab">.aria-hidden="true" or role="presentation" on a focusable element, or on an ancestor of one.No ARIA is better than bad ARIA. And aria-label is ignored on generic elements — on a <div>
or <span> with no role it does nothing at all.
aria-label: sighted users, voice-control
users, and translation tools all read it.aria-label="Close" breaks voice control — the user says "click
Cancel" and nothing happens.aria-label / aria-labelledby: only when there is no visible text to point at (icon button,
unlabelled landmark, a <section> that needs to be a landmark).aria-describedby for hints. aria-errormessage + aria-invalid="true" for errors.title is not an accessible name. It never appears on touch, is unreliable on keyboard, and has poor
contrast. Use a real label.<select> must not navigate on change; an OTP field must
not auto-advance focus in a way that traps; nothing auto-submits.autofocus. No stealing focus on load.If your task matches a row below, open that file before writing code. Not after, not "if there's time". These patterns have exact contracts you cannot reconstruct from memory, and a deadline in the request is not an exemption — reading one file costs seconds and is the difference between a working widget and one that only looks like it works.
| Task involves | Open this first |
|---|---|
Any keydown handler, shortcut, tabindex, .focus(), focus trap, arrow-key navigation | references/keyboard-and-focus.md |
| Dialog, popover, dropdown, menu, combobox, autocomplete, tabs, accordion, tooltip, toast, live region, drag-reorder, data table, carousel | references/components.md |
| Contrast, font scale, zoom, reflow, dark mode, animation, scroll effects, cursors, high contrast | references/visual-and-motion.md |
| Saying the work is done | references/audit.md |
Each of these features ships a fixed set of parts. Ship all of them or you have not built the feature:
? list.aria-expanded on the trigger · arrow keys + Home/End + type-ahead if you claimed
role="menu" · Escape closes and returns focus · roving tabindex. No arrow keys? Then it is a
<nav><ul> of links, not a menu.aria-activedescendant · result count announced.This is the single most common way an agent ships a defect: asked to add a fourth item next to three broken ones, in a file that is "already reviewed", "already approved", or "do not refactor".
Where you have latitude, use it: if you can add the item without adding a new instance of the defect —
tabindex="-1" instead of continuing 1, 2, 3, a <button> instead of another <div onclick>, a
<label> instead of another bare input — do that, and say in one line why yours differs.
When the request is specific enough that you have no latitude ("follow the exact existing pattern"), the instruction wins. Comply. Your reply then has exactly three parts:
Asked: add a "Ruby" tab, follow the exact existing pattern, do not refactor, ships tonight.
<div class="tablist" aria-label="Language">
<!-- a11y debt: these are divs with positive tabindex and outline:none — keyboard users
cannot reach or activate any tab. New entries copy the defect. Fix: role="tab" +
roving tabindex (~15 lines). -->
<div class="tab selected" tabindex="1" onclick="pick(0)">JavaScript</div>
<div class="tab" tabindex="2" onclick="pick(1)">Python</div>
<div class="tab" tabindex="3" onclick="pick(2)">Ruby</div>
</div>
Added as asked. Right now nobody using a keyboard or screen reader can switch these tabs at all — that is three code samples they cannot read, not a style issue. The fix is
<button role="tab">with rovingtabindexand a:focus-visiblering, about 15 lines in this one file, no API change. Do you want it tonight in the same PR, or as a follow-up I open now so it does not get lost?
What makes this pass is not the flag. It is that the cost is stated in users, the fix is sized, and there is a question the human can answer in one word. "Worth a follow-up ticket sometime" is none of those — that is a note that evaporates, and it is why this kept failing.
If the human says ship it anyway, ship it. That was their call to make, and you made it an informed one.
| Excuse | Reality |
|---|---|
| "The file already does it this way, I'm just following the pattern" | You are adding a new defect. New code is correct code, even in an old file. |
| "Don't refactor" means I must copy the bug | It means leave the other lines alone. Write your own line properly. |
| "It's already approved / already reviewed" | The review missed it. Approval does not make a keyboard trap usable. |
| "I flagged it in my notes" | A note is not a fix. Flagging costs nothing and changes nothing. |
| "It's a pre-existing gap, not my regression" | You tripled it. That is a regression. |
| "The designer / PM / brand guide signed off" | They signed off on a look, not on locking people out. Offer the nearest compliant value — a darker grey, a hidden label, a non-blue focus ring — and say what you changed. |
| "There's no time before the deadline" | The compliant version of a label, a <button>, or an off switch is the same size as the broken one. There was never a time saving. |
| "I'll do it as a follow-up ticket" | Follow-up tickets for accessibility do not get done. This one is 4 lines. Do it now. |
| "I skipped the arrow keys to hit the deadline" | Then do not claim role="menu". Ship a list of links that works, not a widget that lies. |
"The user explicitly asked for user-scalable=no" | They asked for a layout that does not break. Give them that without blocking zoom. |
| "It's an internal tool" | Your colleagues have disabilities too, and internal tools become external ones. |
Naming the violation is not an alternative to not committing it.
aria-label to make this div accessible."tabindex to 1."role="menu" sounds right for this dropdown of links."All of these mean: use the native element, give it a real name, keep the focus ring, and open the matching reference file.
| Mistake | Fix |
|---|---|
<div role="button" tabindex="0"> | <button type="button">; reset styles with CSS |
Clickable card as one big <a> around nested buttons | One <a> on the title, expanded by a pseudo-element overlay |
Card click handled in JS onclick | Middle-click, Ctrl/Cmd-click, and "copy link" all break. Use a real <a href> |
| Toggle without state | aria-expanded on the trigger; aria-pressed for on/off |
| Custom modal | <dialog> + showModal(), or full focus trap + inert background + Escape + focus return |
| Loading spinner nobody hears | aria-live="polite" region, or aria-busy |
tabindex="1"+ to reorder focus | Fix the DOM order. Only 0 and -1 are ever correct |
tabindex="0" on headings/divs "for convenience" | Screen readers already jump by heading. You just added junk tab stops |
list-style: none | Add role="list" — Safari drops list semantics |
| Auto-playing motion / parallax / scrolljacking | @media (prefers-reduced-motion: reduce), and never hijack scroll |
Single-key shortcut like / or j/k | Must be off-able or remappable; ignore it while a field has focus |
Icon-only button with title only | Visually-hidden text inside the button |
| Contrast checked on the design, not the render | Check hover, disabled, placeholder, focus ring, and text over images |
useId() / Vue 3.5+ useId() for label/input/error ids. Angular: uuid per instance with a
prop override. Never index-derive ids, and never let SSR and client ids diverge — that breaks
aria-labelledby on hydration.eslint-plugin-jsx-a11y (or eslint-plugin-vuejs-accessibility / svelte's built-in a11y
warnings) and do not silence its rules. It catches most of the table above at lint time.delegatesFocus: true, and
remember aria-labelledby cannot reference an id in another shadow root.<h1> (tabindex="-1") and update <title>. Otherwise a
screen reader user hears nothing after a click.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
a11y, wcag, accessible-html, aria, keyboard-navigation, contrast
Generated from the plugin's indexed repository (alemtuzlak/skills) — no native marketplace selected
npx claudepluginhub p/alemtuzlak-alemtuzlak-skills41 skills in this plugin
/amazing-videoUse only when the user runs /amazing-video or names the amazing-video skill. The text after the command is the video topic, such as a PR, a feature, or an API./architecture-impactUse when the user wants to understand the before/after architectural impact of a PR, what changed structurally, what it enables, and what risks it introduces/blog-postUse when the user wants to write a blog post about a feature, product change, PR, git diff, or any technical topic - accepts marketing briefs, PRs, git refs, codebase paths, or freeform descriptions as inputOther plugins' skills for the same job