agentleFS
ViviBeriViviBeri/webcraft-pro/skills/accessible-components/SKILL.md

accessible-components

Skill11 starsChanged 10 days agoMITView on GitHub

Use when designing or implementing reusable accessible dialogs, menus, tabs, accordions, disclosures, comboboxes, and other interactive UI components.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 16 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer a native HTML element when it provides the required behavior.

    line 14
  2. Distinctive:

    Keep component APIs explicit.

    line 18
  3. Distinctive:

    Use a button to toggle the controlled content.

    line 24
  4. Distinctive:

    Keep the button in the normal Tab sequence.

    line 27
  5. Distinctive:

    Ensure the panel content is hidden from interaction when collapsed.

    line 28
  6. Distinctive:

    Use tablist, tab and tabpanel semantics only when implementing the tabs interaction pattern.

    line 32
  7. Distinctive:

    Keep aria-selected, tabindex and panel relationships synchronized.

    line 33
  8. Distinctive:

    Do not use tabs semantics for ordinary navigation links.

    line 36
  9. Distinctive:

    Use ordinary navigation links for site navigation.

    line 40
  10. Distinctive:

    Use menu roles only for a true menu widget with the expected keyboard model.

    line 41
  11. Distinctive:

    Ensure submenus have predictable open, close and focus behavior.

    line 42
  12. Distinctive:

    Use native dialog where appropriate, while still testing browser and assistive-technology behavior.

    line 49
  13. Distinctive:

    Follow the exact APG pattern for editable or select-only behavior.

    line 53
  14. Distinctive:

    Keep active option, selected value, popup visibility and expanded state distinct and synchronized.

    line 54
  15. Distinctive:

    Do not build a custom combobox when a native select meets the product requirement.

    line 56
  16. Distinctive:

    Test every state with keyboard-only interaction, browser accessibility inspection and representative screen readers.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Accessible Component Engineering

Objective

Build reusable components whose semantics, keyboard behavior, focus lifecycle and state remain correct across every supported state.

Before implementation

  1. Prefer a native HTML element when it provides the required behavior.
  2. Identify the exact interaction pattern in the WAI-ARIA Authoring Practices Guide.
  3. Define states, transitions, keyboard commands, focus rules, accessible names and disabled behavior before writing code.
  4. Confirm whether the component is modal, non-modal, single-select, multi-select or navigation.
  5. Keep component APIs explicit; do not let consumers create contradictory ARIA state.

Pattern requirements

Disclosure and accordion

  • Use a button to toggle the controlled content.
  • Expose expanded/collapsed state with aria-expanded.
  • Connect the control to its panel with aria-controls when useful.
  • Keep the button in the normal Tab sequence.
  • Ensure the panel content is hidden from interaction when collapsed.

Tabs

  • Use tablist, tab and tabpanel semantics only when implementing the tabs interaction pattern.
  • Keep aria-selected, tabindex and panel relationships synchronized.
  • Choose and document manual or automatic activation.
  • Implement the pattern's arrow-key behavior and Home/End where applicable.
  • Do not use tabs semantics for ordinary navigation links.

Menu and navigation

  • Use ordinary navigation links for site navigation; do not apply application-menu keyboard behavior to a standard nav list.
  • Use menu roles only for a true menu widget with the expected keyboard model.
  • Ensure submenus have predictable open, close and focus behavior.

Dialog

  • Give the dialog an accessible name, preferably through a visible heading.
  • Set modal semantics only when the background is actually modal and unavailable.
  • Move focus into the dialog, manage contained focus, support permitted dismissal and restore focus on close.
  • Use native dialog where appropriate, while still testing browser and assistive-technology behavior.

Combobox and listbox

  • Follow the exact APG pattern for editable or select-only behavior.
  • Keep active option, selected value, popup visibility and expanded state distinct and synchronized.
  • Support the expected arrow, Escape, Enter and text-editing behavior.
  • Do not build a custom combobox when a native select meets the product requirement.

Component API design

Document:

  • Accessible name source and required labeling.
  • Controlled/uncontrolled state contract.
  • Keyboard interaction contract.
  • Focus entry, exit and restoration.
  • Disabled and read-only behavior.
  • Async loading, empty, error and success states.
  • Portal, nested overlay and stacking behavior.
  • Supported browser and assistive-technology coverage.

Verification

Test every state with keyboard-only interaction, browser accessibility inspection and representative screen readers. Add component tests for state and keyboard transitions, plus end-to-end tests for complete user tasks.

Completion criteria

The component follows a documented interaction pattern, exposes accurate semantics and state, supports expected keyboard behavior, and has tests for lifecycle and edge states.

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.