seb1n/accessibility testing
Audit web interfaces against WCAG 2.1 AA/AAA standards, identify violations, and produce actionable remediation reports with code fixes.
npx skills add https://github.com/seb1n/awesome-ai-agent-skills --skill Accessibility Testing
This skill enables the agent to perform thorough accessibility audits of web pages and components against the Web Content Accessibility Guidelines (WCAG) 2.1 at AA and AAA conformance levels. The agent identifies violations across four principles — Perceivable, Operable, Understandable, Robust — and generates structured compliance reports with specific code fixes. It covers automated checks (color contrast, missing alt text, ARIA misuse), semi-automated checks (keyboard navigation flows, focus management), and manual check guidance (screen reader announcements, cognitive load).
alt="" for decorative images), that headings form a logical hierarchy (no skipped levels), that landmarks (<nav>, <main>, <aside>) are present, and that dynamic content updates are announced via aria-live regions.Provide the agent with a URL, a block of HTML, or a React/Vue component. Specify the target conformance level (AA or AAA) and any assistive technology requirements. The agent will audit the content and return a structured report with code fixes.
User Request: "Audit this login form for WCAG 2.1 AA compliance."
<div class="login">
<img src="logo.png">
<input type="text" placeholder="Username">
<input type="password" placeholder="Password">
<div class="btn" onclick="login()">Sign In</div>
<p style="color: #aaa; font-size: 12px;">Forgot your password?</p>
</div>
Agent Response — Accessibility Audit Report:
| # | Criterion | Severity | Element | Issue |
|---|-----------|----------|---------|-------|
| 1 | 1.1.1 Non-text Content | Critical | <img src="logo.png"> | Image has no alt attribute. Screen readers cannot describe it. |
| 2 | 1.3.1 Info and Relationships | Critical | <input placeholder="Username"> | Input has no associated <label>. Placeholder text is not a substitute for a label. |
| 3 | 1.3.1 Info and Relationships | Critical | <input placeholder="Password"> | Same label issue as above. |
| 4 | 1.4.3 Contrast Minimum | Serious | <p style="color: #aaa"> | Text color #aaa on white background has a contrast ratio of 2.32:1. AA requires 4.5:1 for text this size. |
| 5 | 2.1.1 Keyboard | Critical | <div class="btn" onclick> | A <div> is not focusable via keyboard. Users cannot Tab to or activate this button. |
| 6 | 4.1.2 Name, Role, Value | Critical | <div class="btn" onclick> | Element has no semantic role. Screen readers announce it as generic text, not as a button. |
Remediation — Fixed Code:
<form class="login" onsubmit="login(event)">
<img src="logo.png" alt="Acme Corp logo">
<label for="username">Username</label>
<input id="username" type="text" autocomplete="username" required>
<label for="password">Password</label>
<input id="password" type="password" autocomplete="current-password" required>
<button type="submit" class="btn">Sign In</button>
<a href="/forgot-password" style="color: #595959; font-size: 14px;">
Forgot your password?
</a>
</form>
Changes made: added alt to the image, replaced placeholder-only inputs with explicit <label> elements, replaced the <div> with a semantic <button>, changed the link color from #aaa (2.32:1) to #595959 (7.0:1), wrapped the form in a <form> element for proper submit handling, and added autocomplete attributes.
User Request: "Fix accessibility issues in this React notification component."
Before (inaccessible):
function Notification({ message, onClose }) {
return (
<div className="notification">
<span>{message}</span>
<span className="close-x" onClick={onClose}>✕</span>
</div>
);
}
After (accessible):
function Notification({ message, onClose }) {
return (
<div role="alert" aria-live="assertive" className="notification">
<p>{message}</p>
<button
type="button"
onClick={onClose}
aria-label="Dismiss notification"
className="close-btn"
>
✕
</button>
</div>
);
}
Fixes applied: (1) Added role="alert" and aria-live="assertive" so screen readers announce the notification immediately when it appears. (2) Replaced the <span onClick> with a <button> so it is keyboard-focusable and announced as an interactive control. (3) Added aria-label="Dismiss notification" because the "✕" character alone does not convey the button's purpose to screen reader users. (4) Changed the inner <span> to a <p> for proper text semantics.
<button> needs no role="button". A <nav> needs no role="navigation". ARIA is a repair tool for situations where semantic HTML is not sufficient, not a replacement for it.aria-live="polite" region to announce route changes, or programmatically move focus to the new page's <h1>.aria-live region or focus is explicitly managed. For toast notifications use aria-live="assertive"; for feed updates use aria-live="polite".scope, headers, and aria-sort attributes. Test that a screen reader user can understand which header applies to each data cell.title attribute to the <iframe>, and provide an accessible alternative when the embedded content is critical to the user flow.Take seb1n/accessibility testing from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.