diff --git a/README.md b/README.md index 0a2e3d2800f7d30d0ce6215aaf75bc22a24b7d01..74bdf83954614479cdb2086455403a9a95939331 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,10 @@ agent capabilities through a standardised format. - [resuming-work-through-lunatask](skills/resuming-work-through-lunatask/SKILL.md): Resumes previously deferred work from Lunatask. Use when user pastes a task note, shares a deep link, or references continuing earlier work. +- [frontend-accessibility](skills/frontend-accessibility/SKILL.md): + Generates accessible HTML, React, and frontend code following WCAG 2.2 + AA guidelines. Focuses on semantic HTML, keyboard accessibility, and + screen reader compatibility. ## Installation diff --git a/skills/frontend-accessibility/SKILL.md b/skills/frontend-accessibility/SKILL.md new file mode 100644 index 0000000000000000000000000000000000000000..bb17b6193847060fa186435f26c5ef85b081a0e6 --- /dev/null +++ b/skills/frontend-accessibility/SKILL.md @@ -0,0 +1,157 @@ +--- +name: frontend-accessibility +description: Generates accessible HTML, React, and frontend code following WCAG 2.2 AA guidelines. Use when creating UI components, forms, navigation, or any user-facing frontend code. Focuses on semantic HTML, keyboard accessibility, and screen reader compatibility. +license: AGPL-3.0-or-later +metadata: + author: Amolith + version: "1.0" +--- + +Write accessible frontend code by default. Semantic HTML covers most needs; ARIA is for gaps HTML can't fill. + +## Core principles + +1. **Semantic HTML first**: Use ` + + +
Save
+``` +The div requires `role`, `tabindex`, `onkeydown` for Enter/Space, focus styles, and still won't work with voice control. Use ` +``` + +**Right:** +```html + +``` + +Problems with the wrong version: +- `role="button"` is redundant on ` +{open && setOpen(false)} />} +``` + +- Hover doesn't exist on touch devices +- Keyboard users can't trigger hover +- Click/keyboard activation works universally + +## Auto-playing media + +**Wrong:** +```html + +``` + +**Right:** +```html + +``` + +- Auto-play disrupts screen readers +- Users with vestibular disorders need motion control +- Background audio conflicts with screen reader audio +- Always provide captions for video with speech + +If auto-play is required: +```html +