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

accessibility

Skill2 starsChanged 6 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.

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 99 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 99 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)

  • Other versions109 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 109

    1. microsoft/vscode★ 194ksame name
    2. elastic/kibana★ 21ksame name
    3. mozilla-mobile/firefox-ios★ 13ksame name
    4. midudev/preguntas-entrevista-react★ 7.8ksame name
    5. gitpod-io/openvscode-server★ 6.2ksame name
    6. posit-dev/positron★ 4.3ksame name
    7. legions-developer/evilcharts★ 3.2ksame name
    8. midudev/la-velada-web-oficial★ 1.9ksame name
    9. UI5/webcomponents★ 1.8ksame name
    10. theopenco/llmgateway★ 1.7ksame name

    99 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use tool-rename-deprecation, author-contributions and 10 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.
    • gitpod-ioSkill

      tool-rename-deprecation

      Ensure renamed built-in tool references preserve backward compatibility. Use when renaming a toolReferenceName, tool set referenceName, or any tool identifier. Run on ANY change to tool registration code. Covers legacyToolReferenceFullNames for tools and legacyFullNames for tool sets.

      Also in 5 projects that use this

    • MicrosoftSkill

      author-contributions

      Identify all files a specific author contributed to on a branch vs its upstream, tracing code through renames. Use when asked who edited what, what code an author contributed, or to audit authorship before a merge. This skill should be run as a subagent — it performs many git operations and returns a concise table.

      Also in 8 projects that use this

    • MicrosoftSkill

      auto-perf-optimize

      Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

      Also in 7 projects that use this

    • +9 more from microsoft
  • In this repository18 other files it gives its agents.

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.