agentleFS
DeadlymindDeadlymind/nanolama/skills/accessibility/SKILL.md

accessibility

Skill1 starsChanged 5 months agoMITView on GitHub

Builds WCAG 2.2 AA accessible React UI on shadcn/Radix primitives — keyboard operability with a visible focus ring, dialog focus trap and restore, labelled form fields wired to aria-describedby errors, token-based color contrast, and Arabic RTL mirroring. Use when adding or reviewing an interactive component, an icon-only button, a dialog or menu, a form field's error wiring, or a keyboard/focus/contrast/screen-reader fix, and when making a screen work in RTL. Not for translation plumbing or bidi text setup (see i18n-rtl) or design-token definition (see tailwind-shadcn).

70 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use web-quality-audit, core-web-vitals and 9 more.

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.
  • RodrigoTomeESSkill

    web-quality-audit

    Comprehensive web quality audit covering performance, accessibility, SEO, and best practices. Use when asked to "audit my site", "review web quality", "run lighthouse audit", "check page quality", or "optimize my website".

    Also in 8 projects that use this

  • thisisAhsanIqbalSkill

    core-web-vitals

    Audits HTML patterns that affect Core Web Vitals (LCP, CLS, INP). Checks for layout shift causes, largest contentful paint blockers, and interaction responsiveness issues. Use when optimising page performance or fixing Google PageSpeed Insights warnings.

    Also in 10 projects that use this

  • agentset-aiCursor rule

    animations

    Animations Rules and Best Practices

    Also in 3 projects that use this

  • kpbraySkill

    best-practices

    Applies Power BI best practices, BPA rules, and enterprise standards. Use for quality validation, naming conventions, and performance optimization.

    Also in 7 projects that use this

  • YepAPISkill

    background-jobs

    Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

    Also in 3 projects that use this

  • pluginagentmarketplaceSkill

    performance

    Optimize application performance through caching strategies, load balancing, database scaling, and monitoring. Build systems handling thousands of concurrent users.

    Also in 13 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 64 edited versions we read keep these.

  • 0

    Distinctive

    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:

    Keyboard first, visibly: Every action reachable by Tab.

    line 26

“Common” is measured: kept by at least 6 in 10 of the 64 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Accessibility (WCAG 2.2 AA on React + Radix)

When to use

Building or reviewing any interactive UI on this stack — a button, dialog, menu, form field, or a whole screen — that a keyboard or screen-reader user must be able to operate. Treat a control that only works with a mouse as a bug, not a polish item. Target WCAG 2.2 AA as the bar.

Pattern

Reach for an accessible primitive before you hand-build behavior. A Radix/shadcn Button, Dialog, DropdownMenu, or Tabs ships the correct role, focus management, and keyboard handling for free; a <div onClick> ships none of it and you will re-implement them wrong. The invariant: everything is operable by keyboard with a visible focus ring, every control has an accessible name, and state (errors, expansion, selection) is exposed to assistive tech, not just painted.

Idioms

  1. Never div-with-onClick for a control. A clickable div has no role, is not in the tab order, and ignores Enter/Space. Use the primitive (Button, a Radix trigger) so screen readers announce it and keyboards reach it.
  2. Keyboard first, visibly. Every action reachable by Tab; never remove the focus outline without replacing it. Style :focus-visible (not :focus) so a mouse click does not flash a ring but a Tab does.
  3. Trap and restore focus in overlays. A dialog/menu keeps Tab inside it while open, closes on Escape, and returns focus to the element that opened it. Radix Dialog does this — do not fight it with manual focus() calls.
  4. Name every control. Icon-only buttons need an aria-label (or visually hidden text); an unlabelled icon button is silence to a screen reader.
  5. Wire form errors. Associate each field with its <label>, and point aria-describedby at the error node with aria-invalid on the input, so the error is announced when focus lands (ties zod-forms).
  6. Contrast from tokens. Meet 4.5:1 body / 3:1 large-text and UI contrast using semantic design tokens, not ad-hoc hex — one accessible palette, applied everywhere (ties tailwind-shadcn).

Example

// Icon-only button: a screen reader announces "Delete invoice", not "button".
<Button variant="ghost" size="icon" aria-label="Delete invoice">
  <TrashIcon aria-hidden="true" />   {/* decorative: hidden from AT */}
</Button>

// Dialog: Radix traps focus while open, restores it to the trigger on close,
// and closes on Escape. Title/description are wired to the dialog by id.
<Dialog>
  <DialogTrigger asChild>
    <Button>Delete</Button>
  </DialogTrigger>
  <DialogContent>            {/* focus moves in; Tab is trapped here */}
    <DialogTitle>Delete this invoice?</DialogTitle>
    <DialogDescription>This cannot be undone.</DialogDescription>
    <DialogClose asChild><Button variant="outline">Cancel</Button></DialogClose>
  </DialogContent>
</Dialog>

RTL

For Arabic, the whole layout mirrors. Use CSS logical properties (margin-inline-start, padding-inline-end, inset-inline) instead of left/right so spacing flips automatically, and let icons/arrows that imply direction mirror too. Reading order and focus/Tab order must follow the visual order in both directions — set dir="rtl" on the container and verify Tab walks the mirrored layout sensibly (ties i18n-rtl).

Verify

Automated checkers catch only part of the picture — roughly what is machine-testable (missing labels, contrast ratios, bad ARIA), not whether focus order makes sense or a flow is usable. Flow- and layout-level WCAG 2.2 criteria (target size, focus not obscured, redundant entry, consistent help, dragging alternatives) are baked in at design time by product-ux-design and visual-ui-design; this audit verifies they survived implementation. Run all three passes:

  • an axe-style automated scan in CI on rendered pages,
  • a keyboard-only pass (unplug the mouse: Tab, Enter, Space, Escape, arrows),
  • a screen-reader pass (VoiceOver/NVDA) on the primary flow.

Adapt to your repo

Confirm which primitive library you actually use (Radix under shadcn here; Headless UI and others give the same guarantees differently) and that its focus-trap default is on. Point contrast checks at your own token names. Version-pin nothing from this skill — confirm the current release of any axe-style checker or testing library through version-check.

Gotchas

  • aria-label on a <div> does nothing useful without a role — that is why the primitive matters; do not paper over a wrong element with ARIA.
  • Removing the focus outline for looks is a WCAG failure; replace it, never delete it.
  • placeholder is not a label — it vanishes on input and is often skipped by AT.
  • display:none and aria-hidden remove content from the accessibility tree; a "visually hidden" utility (clipped, not hidden) is what keeps label text for AT.
  • RTL breaks when you hard-code left/right or margin-left; logical properties are what let one component serve both directions.
  • A passing axe scan is a floor, not a pass — it cannot judge focus order or whether a custom widget is actually operable.

See also

  • zod-forms
  • tailwind-shadcn
  • i18n-rtl
  • nextjs-module

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.