Skip to content
FunCoding

unprompted-a11y

WCAG 2.2 contrast verification, keyboard navigation, focus-visible rings, semantic landmarks, form label/error wiring, and human interaction affordances. Load whenever choosing colors, building forms, dialogs, menus, or auditing UI.

Star
504
License
MIT
Last commit
Dec 2, 2026

skills/unprompted-a11y/SKILL.md

View on GitHub

unprompted-a11y — Contrast, Keyboard & Human Affordances

Extends core rules U-09, U-10, U-21–U-24, and U-32. Accessibility is baseline engineering, never an optional post-launch pass.


1. Measured Contrast Floors (U-09)

Never eyeball contrast—especially on tinted paper neutrals, muted captions, or dark-mode secondary text. Verify pairs with the bundled zero-dependency calculator:

# Check a single foreground/background hex pair:
node <skills-dir>/unprompted-a11y/scripts/contrast-check.mjs --fg "#524e48" --bg "#f7f5f0"

# Scan a CSS token file for --fg-* against --bg-* custom properties:
node <skills-dir>/unprompted-a11y/scripts/contrast-check.mjs --css ./styles/tokens.css

Required Thresholds (WCAG 2.2)

  • Normal Text (< 24px, or < 18.66px bold): >= 4.5:1 (aim for >= 7:1 AAA on primary reading prose).
  • Large Display Text (>= 24px, or >= 18.66px bold): >= 3.0:1.
  • UI Controls, Input Borders & Functional Icons: >= 3.0:1 against adjacent surface (unless an explicit high-contrast text label already defines the boundary).
  • Disabled Controls: Exempt from 4.5:1, but must still remain legible enough (~2.2:1+) that users can tell what is disabled and why.

2. Keyboard & Focus Architecture (U-10)

  1. Native Elements First: Use <button>, <a href>, <input>, <select>, <details>/<summary>, and <dialog> before reaching for div + role + tabIndex.
  2. Visible Focus Ring: Every interactive element must show a clear :focus-visible ring (2px solid var(--accent) with 2px–3px outline-offset, or a dual-ring box-shadow when sitting over varied backgrounds). Never write outline: none without an immediate high-contrast :focus-visible replacement.
  3. Focus Trapping & Restoration: Modal <dialog>s and drawers must keep Tab/Shift+Tab inside while open, close on Escape, and return focus to the triggering element on close.
  4. Logical Tab Order: DOM order must match visual reading order; never use positive tabindex="1+".

3. Forms, Labels & Error Wiring (U-22, U-23)

  • Persistent Visible Labels (U-22): Every <input>, <textarea>, and <select> requires an associated <label for="...">. Placeholders vanish the instant typing starts and fail contrast rules.
  • Correct Control Selection:
    • Single choice among 2–5 visible options -> <fieldset> + <legend> + <input type="radio">.
    • Independent boolean opt-in ("Remember this device") -> <input type="checkbox"> (never a lone ungrouped radio button).
  • Programmatic Error Descriptions: Link inline validation text via aria-describedby and set aria-invalid="true" on invalid fields; never rely on turning a border red alone (color-only failure).
  • Distinguishable Body Links (U-23): Links inside prose paragraphs must retain an underline (text-decoration: underline; text-underline-offset: 3px) so color-vision-deficient readers can identify them immediately.

Similar Skills

reverse-engineer-anything

MOmorluto/rea486k8,943 new stars in the last 7 days

reverse-engineer-anything

MOmorluto/rea486k8,943 new stars in the last 7 days

test-driven-development

OBobra/superpowers331k4,772 new stars in the last 7 days

Featured

accessibility

Audit accessibility on Web, iOS, and Android to meet WCAG 2.2, with keyboard navigation and screen-reader support.

AFaffaan-m/ECC315k4,381 new stars in the last 7 days

ai-regression-testing

AFaffaan-m/ECC315k4,381 new stars in the last 7 days

agent-runtime-gateway-smoke-test

AFaffaan-m/ECC315k4,381 new stars in the last 7 days