agentleFS
casooncasoon/ai-agent-config/skills/accessibility-audit/SKILL.md

accessibility-audit

Skill1 starsChanged 2 months agoMITView on GitHub

WCAG 2.2 AA patterns for Astro — semantic HTML, keyboard navigation, focus indicators, form labels, contrast ratios, ARIA roles, and motion preferences. Use when building or auditing any UI for accessibility, adding forms or interactive components, reviewing contrast or touch targets, or when fixing axe-core violations from Playwright tests. Load this skill before adding any form, dialog, tab, accordion, or icon-only button.

37 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use design-system-audit, design-critique and 5 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.
  • zeon-kunSkill

    design-system-audit

    Scan an existing React/Next.js codebase and extract its implicit design system — colors, typography, spacing, component patterns, and inconsistencies. Use when onboarding to an existing project or before formalizing a design system.

    Also in 4 projects that use this

  • AnthropicSkill

    design-critique

    Get structured design feedback on usability, hierarchy, and consistency. Trigger with "review this design", "critique this mockup", "what do you think of this screen?", or when sharing a Figma link or screenshot for feedback at any stage from exploration to final polish.

    Also in 3 projects that use this

  • dylantarreSkill

    performance-optimization

    Use when animation runs slow, janky, or causes frame drops

    Also in 4 projects that use this

  • AnthropicSkill

    seo-audit

    Run a comprehensive SEO audit — keyword research, on-page analysis, content gaps, technical checks, and competitor comparison. Use when assessing a site's SEO health, when finding keyword opportunities and content gaps competitors own, or when you need a prioritized action plan split into quick wins and strategic investments.

    Also in 3 projects that use this

  • AWSSkill

    prototype

    Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

    Also in 3 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 4 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 34 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never use <a> without href for actions — use <button type="button">.

    line 31
  2. Very specific:

    Always set type="button" or type="submit" explicitly.

    line 36
  3. Very specific:

    Never <div onclick> — use <button>.

    line 37
  4. Distinctive:

    Never use tables for layout.

    line 95
  5. Very specific:

    Always set width and height to prevent layout shift.

    line 100
  6. Distinctive:

    Never use color as the sole indicator — pair with icon, text, or pattern.

    line 111
  7. Very specific:

    Every color class needs an explicit dark: counterpart.

    line 112
  8. Very specific:

    Avoid low-contrast muted grays on white (e.g.

    line 113
  9. Very specific:

    All animations must respect prefers-reduced-motion:

    line 117
  10. Distinctive:

    No blinking or flashing effects (WCAG 2.3.1 — max 3 flashes/sec).

    line 127
  11. Very specific:

    Prefer native <details> + <summary>.

    line 141
  12. Very specific:

    Prefer native <dialog>. For custom modals:

    line 152
  13. Very specific:

    All images have alt (or alt="" + aria-hidden).

    line 188
  14. Distinctive:

    All links have visible underline (or button styling is intentional).

    line 189

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

Accessibility is baseline, not a feature. Every pattern must be usable without a mouse, without sight, and without fine motor control.

Focus areas

  • Semantic HTML first — use native elements (<button>, <a>, <details>, <dialog>) where possible.
  • Keyboard access and visible focus indicators on all interactive elements.
  • Labels, landmarks, and sensible heading hierarchy.
  • Contrast and motion preferences respected in light and dark mode.

Page structure

  • One <h1> per page, no skipped heading levels.
  • Landmarks: <nav aria-label="…">, <main id="main">, <article>, <section aria-labelledby="…">, <aside>, <footer>.
  • Skip link to #main in the layout.
  • Set lang on <html>; derive per locale where i18n is in use.

Interactive elements

Links

  • Links distinguishable by underline, not color alone.
  • External links with target="_blank" need rel="noopener noreferrer" and a screen reader hint (<span class="sr-only">(opens in new tab)</span>).
  • Icon-only links need aria-label; the icon inside gets aria-hidden="true".
  • Never use <a> without href for actions — use <button type="button">.

Buttons

  • Icon-only buttons must have aria-label; inner icon aria-hidden="true".
  • Always set type="button" or type="submit" explicitly.
  • Never <div onclick> — use <button>.

Keyboard navigation

/* Global focus style — never remove without a visible alternative */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
  • Focus order follows visual layout — don't use positive tabindex.
  • Custom interactive elements need tabindex="0", appropriate role, and keyboard event handlers.

Touch targets (WCAG 2.5.8)

Minimum 44×44 px for all interactive elements. Apply padding or min-h-[44px] min-w-[44px].

Forms

<div>
  <label for="email" class="text-sm font-semibold">
    Email <span aria-hidden="true">*</span>
  </label>
  <input
    type="email"
    id="email"
    name="email"
    required
    autocomplete="email"
    aria-invalid={!!inputError?.email}
    aria-describedby={inputError?.email ? 'email-error' : undefined}
  />
  {inputError?.email && (
    <span id="email-error" class="text-xs text-error" role="alert">
      {inputError.email}
    </span>
  )}
</div>

Checklist:

RequirementImplementation
Associated label<label for="id"> matching <input id="id">
Required indicatorVisual * with aria-hidden="true" plus required
Error statearia-invalid={true} on invalid input
Error message<span role="alert"> linked via aria-describedby
Autocompleteautocomplete="name|email|tel|..."
Grouped inputs<fieldset> + <legend> for radios/checkboxes/address blocks
Success feedback<div role="status">

Tables

  • <caption> for purpose, <th scope="col"> for columns, <th scope="row"> for row headers.
  • Never use tables for layout.

Images

  • All <img> need alt. Decorative: alt="" plus aria-hidden="true".
  • Always set width and height to prevent layout shift.
  • SVG icons: aria-hidden="true" focusable="false" when decorative.

Color & contrast

Text typeMinimum ratio
Normal text (< 18 px)4.5:1
Large text (>= 18 px bold / 24 px)3:1
UI components, borders, icons, focus rings3:1
  • Never use color as the sole indicator — pair with icon, text, or pattern.
  • Every color class needs an explicit dark: counterpart; both modes must independently meet contrast.
  • Avoid low-contrast muted grays on white (e.g. text-neutral-400).

Motion

All animations must respect prefers-reduced-motion:

.animate-fade-in { animation: fadeIn 0.3s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in { animation: none; }
}
  • No blinking or flashing effects (WCAG 2.3.1 — max 3 flashes/sec).
  • Tailwind: use motion-safe: and motion-reduce: variants.
  • Scroll-driven animations: provide @supports fallback plus reduced-motion override.

ARIA patterns

Navigation with aria-current

<a href={href} aria-current={isActive ? 'page' : undefined}>{label}</a>

Disclosure / accordion

Prefer native <details> + <summary>. For custom accordions use aria-expanded and aria-controls.

Tabs

  • role="tablist" with aria-label on container.
  • role="tab" + aria-selected on each tab; inactive tabs tabindex="-1".
  • role="tabpanel" + aria-labelledby on each panel.
  • Arrow-key navigation left/right.

Dialog

Prefer native <dialog>. For custom modals:

  • role="dialog" + aria-modal="true" + aria-labelledby.
  • Focus trap, Escape closes, return focus to trigger on close.

Live regions

  • aria-live="polite" for non-urgent status.
  • role="alert" for errors (assertive).
  • role="status" for success messages.

Lists

Tailwind's list-none strips list semantics in Safari — add role="list" when you need the semantic back.

Anti-patterns

<!-- WRONG -->  <div class="cursor-pointer" onclick="…">Click me</div>
<!-- RIGHT -->  <button type="button">Click me</button>

<!-- WRONG -->  <button><svg>…</svg></button>
<!-- RIGHT -->  <button aria-label="Close menu"><svg aria-hidden="true">…</svg></button>

<!-- WRONG -->  <span class="text-red-500">Error</span>
<!-- RIGHT -->  <span class="text-red-500">⚠ Error: email is required</span>

<!-- WRONG -->  <p class="text-neutral-700">Text</p>
<!-- RIGHT -->  <p class="text-neutral-700 dark:text-neutral-300">Text</p>

New page checklist

  • lang set on <html>.
  • Single <h1>, sensible heading hierarchy.
  • Semantic landmarks in place, skip link works.
  • All images have alt (or alt="" + aria-hidden).
  • All links have visible underline (or button styling is intentional).
  • Icon-only buttons/links have aria-label.
  • Form inputs: <label>, aria-invalid, aria-describedby, autocomplete.
  • Fieldset + legend for grouped inputs.
  • Error messages use role="alert"; success uses role="status".
  • Focus indicators visible, no keyboard traps, all interactive elements reachable.
  • Contrast meets 4.5:1 / 3:1 and holds in dark mode.
  • No color-only signals.
  • Touch targets ≥ 44×44 px.
  • Animations respect reduced motion.
  • External links: rel="noopener noreferrer".
  • Tables: <caption> and <th scope>.

Testing

Automated (axe-core + Playwright)

import AxeBuilder from '@axe-core/playwright';

test('page has no a11y violations', async ({ page }) => {
  await page.goto('/new-page');
  const results = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa', 'wcag22aa'])
    .analyze();
  expect(results.violations).toEqual([]);
});

Build-time

@casoon/astro-post-audit checks after every build for missing alt text, missing labels, empty button text, missing skip link, and heading hierarchy violations.

Manual

  • Tab through the page — verify focus order and visibility.
  • Screen reader (VoiceOver / NVDA / Orca).
  • Zoom to 200 % — content must reflow without horizontal scroll.
  • Enable prefers-reduced-motion in DevTools — animations must stop.
  • DevTools Accessibility tab — check computed roles and names.

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.