.agents/skills/frontend-accessibility/SKILL.md
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.
npx skillsauth add jeninh/ampskills-dotfile frontend-accessibilityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write accessible frontend code by default. Semantic HTML covers most needs; ARIA is for gaps HTML can't fill.
<button>, <nav>, <main>, <form> - not divs with roles<!-- Informative: describe content -->
<img src="chart.png" alt="Sales increased 25% from Q1 to Q2">
<!-- Decorative: empty alt -->
<img src="divider.png" alt="">
<!-- Complex: summarize + link to details -->
<img src="flowchart.png" alt="User registration flow. Details in following section.">
<!-- Correct: semantic button -->
<button onclick="save()">Save</button>
<!-- Wrong: div cosplaying as button -->
<div onclick="save()" role="button" tabindex="0">Save</div>
The div requires role, tabindex, onkeydown for Enter/Space, focus styles, and still won't work with voice control. Use <button>.
<label for="email">Email address</label>
<input type="email" id="email" name="email" required aria-describedby="email-hint">
<span id="email-hint">We'll never share your email</span>
Every input needs a visible <label> with matching for/id. Use aria-describedby for hints, aria-invalid for errors.
<h1>Page title</h1> <!-- One per page -->
<h2>Section</h2> <!-- Don't skip levels -->
<h3>Subsection</h3>
<h2>Another section</h2>
Headings create navigable structure. Screen reader users jump by heading level.
<!-- Good: describes destination -->
<a href="/pricing">View pricing plans</a>
<!-- Bad: meaningless out of context -->
<a href="/pricing">Click here</a>
Use ARIA only when HTML has no semantic equivalent:
| Need | Solution |
|------|----------|
| Button | <button> not role="button" |
| Navigation | <nav> not role="navigation" |
| Live updates | aria-live="polite" (no HTML equivalent) |
| Current page | aria-current="page" (no HTML equivalent) |
| Expanded state | aria-expanded="true" (no HTML equivalent) |
| Custom widget | ARIA + keyboard handling (last resort) |
See antipatterns.md for detailed examples.
<label for="...">alt="" marks image as decorative<button>, not <div onclick>outline: none without replacementRespect user preferences for reduced motion:
/* Default: full animation */
.animated {
transition: transform 0.3s ease;
}
/* Reduce or remove for users who prefer it */
@media (prefers-reduced-motion: reduce) {
.animated {
transition: none;
}
}
Or start safe and enhance:
/* Safe default */
.animated {
transition: none;
}
/* Only animate if user hasn't requested reduced motion */
@media (prefers-reduced-motion: no-preference) {
.animated {
transition: transform 0.3s ease;
}
}
Applies to: transitions, transforms, parallax, auto-playing video, animated illustrations. Essential for users with vestibular disorders.
htmlFor instead of forclassName instead of class<>) don't affect accessibility treeIf using Radix, Headless UI, or similar - they handle ARIA. Don't add redundant attributes.
Generated code should pass:
Automated tools miss context-dependent issues (alt text quality, heading hierarchy logic, reading order). Human review still required.
See patterns.md for:
development
Writes Roc code with strong static types, helpful compiler errors, and functional programming. Use when the user wants Roc code, mentions Roc, functional programming with types, or needs .roc files. Covers both full applications and one-off Roc scripts with shebangs.
tools
Fetches a Linear issue and creates a comprehensive plan for implementation.
development
Preview and screenshot local dev servers and storybooks. Use when asked to view UI components, take screenshots of storybooks, or inspect the web/server apps.
tools
Instructions for using tmux to spawn multiple processes, inspect them, and capture their output. Useful for running servers or long-running tasks in the background.