Skillshub common-accessibility
WCAG 2.2, ARIA, semantic HTML, keyboard navigation, and color contrast standards for web UIs. Legal compliance baseline. (triggers: **/*.tsx, **/*.jsx, **/*.html, **/*.vue, **/*.component.html, accessibility, a11y, wcag, aria, screen reader, focus, alt text)
install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/HoangNguyen0403/agent-skills-standard/common-accessibility" ~/.claude/skills/comeonoliver-skillshub-common-accessibility && rm -rf "$T"
manifest:
skills/HoangNguyen0403/agent-skills-standard/common-accessibility/SKILL.mdsource content
Common Accessibility (a11y) Standards
Priority: P1 (OPERATIONAL)
Accessibility is a legal requirement in the EU (Web Accessibility Directive), USA (ADA/Section 508), and many other jurisdictions. Non-compliance carries litigation risk. Target WCAG 2.2 Level AA as the minimum.
🏗 Semantic HTML First
-
Use the correct HTML element before reaching for ARIA.
,<button>
,<a>
,<nav>
,<main>
,<section>
,<form>
convey semantics natively.<label> -
Never use
or<div>
for interactive elements — they have no keyboard role by default.<span> -
Headings (
–h1
) must form a logical outline. Oneh6
per page.h1 -
Use
not<button>
,<div onClick>
not<a>
, etc.<span onClick>
🎭 ARIA — Use Sparingly
ARIA supplements semantics when native HTML is insufficient (e.g., custom widgets). Rules:
- No ARIA > Bad ARIA: If native HTML works, use it. ARIA only adds roles, not behavior.
- Required attributes: Every
with required properties must include them (e.g.,role
needsrole="slider"
,aria-valuenow
,aria-valuemin
).aria-valuemax - Live Regions: Use
for status messages;aria-live="polite"
only for critical alerts.aria-live="assertive" - Labels: Every form control must have a programmatic label (
,<label>
, oraria-label
).aria-labelledby - Hidden content: Use
on decorative icons; never on focusable elements.aria-hidden="true"
⌨️ Keyboard Navigation
- All interactive elements MUST be reachable and operable via keyboard.
- Tab order must follow visual reading order. Never use positive
values (tabindex
breaks natural order).tabindex="1" - Provide visible focus indicators (see Focus style rule below).
- Modals/Dialogs: Trap focus inside when open. Return focus to trigger element on close.
- Escape key: Must close modals, dropdowns, and tooltips.
- Focus style: Never
without a visible replacement (min 2px solid, 3:1 contrast).outline: none
🎨 Color & Contrast
- Normal text: ≥ 4.5:1 ratio. Large text (≥ 18pt or 14pt bold): ≥ 3:1. UI components: ≥ 3:1.
- Never convey information through color alone — add icon, pattern, or text label.
- Test with: axe DevTools, WAVE, Lighthouse.
📐 Touch & Pointer Targets
- Minimum interactive target size: 44×44px (WCAG 2.5.5 AAA) / 24×24px minimum (WCAG 2.2 AA).
- Provide sufficient spacing between adjacent targets to prevent mis-taps.
🖼 Images & Media
- Decorative images:
(empty, not missing).alt="" - Informative images: descriptive
text (what the image conveys, not "image of...").alt - Complex charts/graphs: provide a text summary or data table alternative.
- Video: Captions mandatory. Audio descriptions for visual-only content.
🧪 Testing Minimum
- CI gate:
zero critical violations.axe-core - Manual: keyboard-only full flow + screen reader (NVDA/VoiceOver) + 200% zoom.
Anti-Patterns
- No
ononClick
: Use<div>
or add<button>
,role
, and keyboard handlers.tabindex - No missing
: Everyalt
must have an<img>
attribute (empty string if decorative).alt - No color-only status: Red = error must also show an icon or text.
- No
without replacement focus style.outline: none - No auto-playing media: Users with vestibular disorders may be harmed.
- No dynamic content without announcement: Use
for async status updates.aria-live