agentleFS
Piyush8296Piyush8296/claude-workspace/.claude/skills/accessibility/SKILL.md

accessibility

Skill2 starsChanged 7 months agoMITView on GitHub

WCAG 2.1 AA accessibility patterns for React — semantic HTML, ARIA, keyboard navigation, screen readers, focus management. Use when building interactive components, forms, modals, or auditing accessibility.

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, animations 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

  • 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

  • mmondoraSkill

    data-modeling

    Schema design, multi-tenant data isolation, and migration management. Firestore and PostgreSQL patterns, RLS, UUID v7 conventions. Use when designing database schemas, writing migrations, or implementing multi-tenant data access.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 64 edited versions we read keep these.

  • 1

    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. Distinctive:

    Use the right element before reaching for ARIA:

    line 10
  2. Very specific:

    Every input has a visible <label> linked via htmlFor/id

    line 169

“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 (a11y)

Principle: Semantic HTML First

Use the right element before reaching for ARIA:

// BAD: div cosplaying as a button
<div onClick={handleClick} className="btn">
  Submit
</div>

// GOOD: actual button
<button onClick={handleClick} type="button">
  Submit
</button>

Semantic elements provide keyboard handling, focus management, and screen reader semantics for free.

Interactive Element Patterns

Buttons vs Links

// Button: performs an action
<button type="button" onClick={handleSave}>
  Save Changes
</button>

// Link: navigates somewhere
<a href="/settings">Go to Settings</a>

// NEVER: link styled as button that performs action
// <a href="#" onClick={handleSave}>Save</a> // NO!

Toggle Button

function ToggleButton({ isPressed, onToggle, label }: ToggleButtonProps) {
  return (
    <button
      type="button"
      aria-pressed={isPressed}
      onClick={onToggle}
    >
      {label}
    </button>
  );
}

Disclosure (Expand/Collapse)

function Disclosure({ title, children }: DisclosureProps) {
  const [isOpen, setIsOpen] = useState(false);
  const contentId = useId();

  return (
    <div>
      <button
        type="button"
        aria-expanded={isOpen}
        aria-controls={contentId}
        onClick={() => setIsOpen(!isOpen)}
      >
        {title}
      </button>
      <div id={contentId} role="region" hidden={!isOpen}>
        {children}
      </div>
    </div>
  );
}

Modal / Dialog

function Modal({ isOpen, onClose, title, children }: ModalProps) {
  const titleId = useId();
  const previousFocus = useRef<HTMLElement | null>(null);

  useEffect(() => {
    if (isOpen) {
      previousFocus.current = document.activeElement as HTMLElement;
    } else {
      previousFocus.current?.focus(); // Restore focus on close
    }
  }, [isOpen]);

  if (!isOpen) return null;

  return (
    <div
      role="dialog"
      aria-modal="true"
      aria-labelledby={titleId}
      onKeyDown={(e) => e.key === 'Escape' && onClose()}
    >
      <h2 id={titleId}>{title}</h2>
      {children}
      <button type="button" onClick={onClose} aria-label="Close dialog">
        ×
      </button>
    </div>
  );
}

Modal requirements:

  • role="dialog" + aria-modal="true"
  • aria-labelledby pointing to the title
  • Focus trapped inside while open
  • Escape key closes
  • Focus returns to trigger on close

Forms

function LoginForm() {
  const emailId = useId();
  const passwordId = useId();
  const emailErrorId = useId();

  return (
    <form>
      <div>
        <label htmlFor={emailId}>Email address</label>
        <input
          id={emailId}
          type="email"
          autoComplete="email"
          aria-required="true"
          aria-invalid={!!errors.email}
          aria-describedby={errors.email ? emailErrorId : undefined}
        />
        {errors.email && (
          <p id={emailErrorId} role="alert">
            {errors.email}
          </p>
        )}
      </div>

      <div>
        <label htmlFor={passwordId}>Password</label>
        <input
          id={passwordId}
          type="password"
          autoComplete="current-password"
          aria-required="true"
        />
      </div>

      <button type="submit">Sign in</button>
    </form>
  );
}

Form requirements:

  • Every input has a visible <label> linked via htmlFor/id
  • aria-required on required fields
  • aria-invalid + aria-describedby for error messages
  • autocomplete attributes for autofill support
  • Error messages linked and announced

Live Regions

// Toast notification
<div role="alert" aria-live="assertive">
  {errorMessage}
</div>

// Status update (non-urgent)
<div role="status" aria-live="polite">
  {`${results.length} results found`}
</div>

// Loading state
<div aria-busy={isLoading} aria-live="polite">
  {isLoading ? 'Loading...' : content}
</div>
UrgencyUseARIA
InterruptingError alerts, urgent notificationsrole="alert" or aria-live="assertive"
BackgroundSearch results, saved confirmationrole="status" or aria-live="polite"
LoadingAsync operationsaria-busy="true" + aria-live="polite"

Images

// Informative image
<img src="/chart.png" alt="Revenue grew 23% quarter over quarter in Q4 2024" />

// Decorative image (no info conveyed)
<img src="/divider.svg" alt="" role="presentation" />

// Complex image (needs long description)
<figure>
  <img src="/architecture.png" alt="System architecture diagram" aria-describedby="arch-desc" />
  <figcaption id="arch-desc">
    The system consists of three microservices communicating via an event bus...
  </figcaption>
</figure>

// Icon button (no visible text)
<button type="button" aria-label="Close" onClick={onClose}>
  <XIcon aria-hidden="true" />
</button>

Keyboard Navigation Patterns

WidgetKeysBehavior
ButtonEnter, SpaceActivate
LinkEnterNavigate
TabsArrow Left/RightSwitch tab
MenuArrow Up/DownNavigate items
DialogEscapeClose, return focus
DropdownEscapeClose
CheckboxSpaceToggle

Testing

# Automated (catches ~30% of issues)
npx axe <url>                    # axe-core CLI
npx eslint --rule '{"jsx-a11y/*": "error"}' src/

# Manual (catches the rest)
# 1. Tab through entire page — logical order? Focus visible?
# 2. Screen reader test — VoiceOver (Mac), NVDA (Windows)
# 3. Zoom to 200% — content reflows? Nothing hidden?
# 4. Keyboard-only — every action possible without mouse?

Checklist

  • Semantic HTML for all elements
  • All interactive elements keyboard accessible
  • Focus visible on all focusable elements
  • Color contrast ≥ 4.5:1
  • Images have alt text
  • Forms have labels and error messages
  • Modals trap focus and support Escape
  • Dynamic content announced via live regions
  • prefers-reduced-motion respected
  • Page works at 200% zoom

Integration with Other Skills

  • react-patterns: Accessible component templates
  • css-architecture: Focus styles, contrast, motion preferences
  • testing-strategy: Accessible query priority in tests

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.