Skip to content
Back to skills

Unprompted A11y

ASecurity

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.

  • 670 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
ai-agentsgobashnodegit

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add mocasus/unprompted --skill unprompted-a11y --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Unprompted A11y?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Unprompted A11y
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mocasus-unprompted-a11y/badge)](https://www.skillsdirectory.com/skills/mocasus-unprompted-a11y)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: unprompted-a11y
version: 4.3.3
license: MIT
description: >-
  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.
compatibility: [windows, macos, linux]
metadata:
  author: mocasus
  category: accessibility
  repository: https://github.com/mocasus/unprompted
  openclaw:
    emoji: "👁️"
    requiredBins: ["node"]
---

# unprompted-a11y — Contrast, Keyboard & Human Affordances

Extends v4 `A-01…A-12` and `E-03…E-05`. Accessibility is baseline engineering, never an optional post-launch pass.

---

## 1. Measured contrast floors (`A-01`, `E-03`)

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

```bash
# 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 that users can tell *what* is disabled.
- **Record the pairs**: `E-03` needs results for every changed foreground/background pair, including hover, focus, and disabled states. A passing palette is not proof for an untested state.

---

## 2. Keyboard, focus & landmarks (`A-02`, `A-03`, `A-04`)

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+"`.
5. **Landmarks**: One `<main>`, sensible `<header>/<nav>/<footer>` regions, exactly one `<h1>`, and no skipped heading levels. Prefer native landmarks over `role` patches.

---

## 3. Accessible names, forms & non-color states (`A-05`, `A-06`, `A-07`)

- **Names and roles (`A-05`)**: Every control and link has an accessible name. Use a link to navigate and a button to act; do not put a click handler on a `div`. Informative images need useful `alt`; decorative images use `alt=""` or `aria-hidden="true"`. Icon-only buttons need `aria-label`.
- **Persistent visible labels (`A-06`)**: 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 (`A-07`).
- **Distinguishable body links (`A-07`)**: Links inside prose paragraphs must retain an underline (`text-decoration: underline; text-underline-offset: 3px`) or another non-color affordance so color-vision-deficient readers can identify them immediately.
- **Conditional `N/A`**: If a surface has no forms or no data tables, record `A-06` or `A-11` as `N/A` with proof of absence, not a silent skip.

---

## 4. Touch, preference, media & reflow (`A-08`, `A-09`, `A-10`, `A-11`, `A-12`)

- **Touch targets (`A-08`)**: Interactive controls need at least `44×44 CSS px` of hit area and `>= 16px` input font size on mobile.
- **Reduced motion & contrast (`A-09`)**: Wrap non-essential motion and transparency in `@media (prefers-reduced-motion: reduce)`; respect `prefers-contrast` where the surface depends on translucent layers. A reduced-motion path must not hide content.
- **Media alternatives (`A-10`)**: Video/audio needs captions or a transcript where the content carries information; prerecorded media needs an alternative. Record `N/A` when the surface has no time-based media.
- **Table semantics (`A-11`)**: Data tables use `<caption>`, `<th scope="col|row">`, and real headers. Do not fake a table with divs.
- **Zoom/reflow (`A-12`)**: At 200% zoom, content reflows without loss, clipping, or horizontal scroll. Test at `320px` width and a 200% zoom equivalent.

---

## 5. Evidence to attach (`E-03`, `E-04`, `E-05`)

- `E-03`: contrast results for every changed pair, including hover/focus/disabled states.
- `E-04`: a tab-order list plus focus screenshots for each control group.
- `E-05`: proof of no horizontal overflow at the narrowest supported width.

Files in this skill

  • SKILL.md3.5 KB
  • scripts/contrast-check.mjs8.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.