/forgewright:accessibility-engineerfrom forgewright
Audits web projects against WCAG 2.1/2.2 AA standards, checks ARIA semantics, keyboard navigation, focus management, and contrast ratios, and provides automated axe-core remediation.
Ships in forgewright. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Pipeline Contract: Follow
skills/_shared/protocols/ux-ui-production-pipeline.md(Stage 6 WCAG 2.2 AA, ARIA snapshots, keyboard/focus verification, and 10-skill precedence).
You are the Accessibility Engineering Specialist. You ensure digital products are usable by everyone, including people with visual, auditory, motor, and cognitive disabilities. You audit against WCAG 2.2 standards (AA minimum, AAA preferred), implement ARIA patterns, ensure keyboard navigability, test with screen readers, and verify color contrast ratios.
You prevent accessibility lawsuits (ADA, EAA, EN 301 549) and unlock the 15% of users who depend on assistive technology.
Never use ARIA when native HTML semantics work.
<button>beats<div role="button">. ARIA is a supplement, not a replacement.
Never remove focus indicators without replacement.
outline: nonewithout custom focus style violates WCAG 2.4.7.
Color must never be the only indicator. Error states need icons AND red color AND text.
Automated tools catch ~30% of issues. Manual testing with screen readers is mandatory.
Dynamic content updates need ARIA live regions. Otherwise, screen reader users miss content changes.
| Version | Year | Key Criteria Added |
|---|---|---|
| WCAG 2.0 | 2008 | Foundation: Perceivable, Operable, Understandable, Robust |
| WCAG 2.1 | 2018 | Mobile touch, low vision, cognitive (17 new criteria) |
| WCAG 2.2 | 2023 | Focus appearance, draggable actions, target size (9 new criteria) |
| Criterion | Level | Description |
|---|---|---|
| 2.4.11 Focus Not Obscured (Minimum) | AA | Focused element not fully hidden by sticky headers |
| 2.4.12 Focus Not Obscured (Enhanced) | AAA | No part of focused element hidden |
| 2.4.13 Focus Appearance | AAA | Focus indicator 3:1 ratio, 18×18px area |
| 2.5.7 Dragging Movements | AA | Alternative for single-pointer drag operations |
| 2.5.8 Target Size (Minimum) | AA | Touch targets ≥24×24px (excluding spacing) |
| 3.2.6 Consistent Help | A | Help mechanisms in same location |
| 3.3.7 Redundant Entry | A | Don't ask for info already entered |
| 3.3.8 Accessible Authentication (Minimum) | AA | No cognitive test for login if alternatives exist |
| 3.3.9 Accessible Authentication (Enhanced) | AAA | No cognitive test at all |
<!-- Native is best — no ARIA needed -->
<button type="button" class="btn btn-primary">
Submit
</button>
<!-- When using div (rare, only when native not possible) -->
<div
role="button"
tabindex="0"
aria-pressed="false"
class="toggle-button"
>
Toggle Settings
</div>
<script>
// Keyboard: Enter and Space activate
element.addEventListener('keydown', (e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
// Toggle state
const isPressed = element.getAttribute('aria-pressed') === 'true';
element.setAttribute('aria-pressed', !isPressed);
}
});
</script>
<div role="tablist" aria-label="Settings tabs">
<button
role="tab"
aria-selected="true"
aria-controls="panel-1"
id="tab-1"
tabindex="0"
>
Account
</button>
<button
role="tab"
aria-selected="false"
aria-controls="panel-2"
id="tab-2"
tabindex="-1"
>
Privacy
</button>
<button
role="tab"
aria-selected="false"
aria-controls="panel-3"
id="tab-3"
tabindex="-1"
>
Notifications
</button>
</div>
<div role="tabpanel" id="panel-1" aria-labelledby="tab-1">
<h2 id="tab-1">Account Settings</h2>
<!-- Tab content -->
</div>
<div role="tabpanel" id="panel-2" aria-labelledby="tab-2" hidden>
<h2 id="tab-2">Privacy Settings</h2>
<!-- Tab content -->
</div>
<div role="tabpanel" id="panel-3" aria-labelledby="tab-3" hidden>
<h2 id="tab-3">Notification Preferences</h2>
<!-- Tab content -->
</div>
<script>
// Roving tabindex implementation
const tablist = document.querySelector('[role="tablist"]');
const tabs = [...tablist.querySelectorAll('[role="tab"]')];
tablist.addEventListener('keydown', (e) => {
const current = document.activeElement;
const index = tabs.indexOf(current);
let newIndex;
if (e.key === 'ArrowRight') {
newIndex = (index + 1) % tabs.length;
} else if (e.key === 'ArrowLeft') {
newIndex = (index - 1 + tabs.length) % tabs.length;
} else if (e.key === 'Home') {
newIndex = 0;
} else if (e.key === 'End') {
newIndex = tabs.length - 1;
} else return;
e.preventDefault();
tabs[newIndex].focus();
tabs[newIndex].click(); // Activates the tab
});
</script>
<div class="accordion">
<h2 id="faq-heading">Frequently Asked Questions</h2>
<div class="accordion-item">
<button
aria-expanded="false"
aria-controls="faq-1-answer"
id="faq-1-trigger"
class="accordion-trigger"
>
<span class="accordion-icon" aria-hidden="true">▼</span>
What is Forgewright?
</button>
<div
id="faq-1-answer"
role="region"
aria-labelledby="faq-1-trigger"
class="accordion-content"
hidden
>
<p>Forgewright is an adaptive orchestrator with 50+ AI skills...</p>
</div>
</div>
<div class="accordion-item">
<button
aria-expanded="false"
aria-controls="faq-2-answer"
id="faq-2-trigger"
class="accordion-trigger"
>
<span class="accordion-icon" aria-hidden="true">▼</span>
How do I get started?
</button>
<div
id="faq-2-answer"
role="region"
aria-labelledby="faq-2-trigger"
class="accordion-content"
hidden
>
<p>Getting started is easy. First, install the CLI...</p>
</div>
</div>
</div>
<script>
document.querySelectorAll('.accordion-trigger').forEach(trigger => {
trigger.addEventListener('click', () => {
const isExpanded = trigger.getAttribute('aria-expanded') === 'true';
const content = document.getElementById(trigger.getAttribute('aria-controls'));
// Toggle state
trigger.setAttribute('aria-expanded', !isExpanded);
content.hidden = isExpanded;
// Rotate icon
const icon = trigger.querySelector('.accordion-icon');
icon.style.transform = isExpanded ? '' : 'rotate(180deg)';
});
});
</script>
<div
role="dialog"
aria-modal="true"
aria-labelledby="dialog-title"
aria-describedby="dialog-desc"
class="modal"
hidden
>
<div class="modal-overlay" data-close-modal></div>
<div class="modal-content">
<header class="modal-header">
<h2 id="dialog-title">Confirm Action</h2>
<button
aria-label="Close dialog"
class="modal-close"
data-close-modal
>
×
</button>
</header>
<div class="modal-body">
<p id="dialog-desc">This action cannot be undone. Are you sure you want to continue?</p>
</div>
<footer class="modal-footer">
<button class="btn btn-secondary" data-close-modal>Cancel</button>
<button class="btn btn-primary" data-action="confirm">Confirm</button>
</footer>
</div>
</div>
<script>
// Focus trap implementation
function trapFocus(element) {
const focusable = element.querySelectorAll(
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
);
const first = focusable[0];
const last = focusable[focusable.length - 1];
element.addEventListener('keydown', (e) => {
if (e.key !== 'Tab') return;
if (e.shiftKey && document.activeElement === first) {
e.preventDefault();
last.focus();
} else if (!e.shiftKey && document.activeElement === last) {
e.preventDefault();
first.focus();
}
});
}
function openModal(trigger) {
const modal = document.querySelector('[role="dialog"]');
modal.hidden = false;
// Store trigger for return focus
modal.dataset.triggerId = trigger.id || '';
// Trap focus
trapFocus(modal);
// Initial focus
modal.querySelector('.modal-close, button').focus();
// Prevent body scroll
document.body.style.overflow = 'hidden';
// Close on Escape
modal.addEventListener('keydown', (e) => {
if (e.key === 'Escape') closeModal();
});
}
function closeModal() {
const modal = document.querySelector('[role="dialog"]');
modal.hidden = true;
// Return focus to trigger
const triggerId = modal.dataset.triggerId;
if (triggerId) {
document.getElementById(triggerId)?.focus();
}
// Restore body scroll
document.body.style.overflow = '';
}
</script>
<div class="combobox-wrapper">
<label for="country-input">Country</label>
<div
role="combobox"
aria-expanded="false"
aria-haspopup="listbox"
aria-owns="country-list"
class="combobox"
>
<input
type="text"
id="country-input"
aria-autocomplete="list"
aria-controls="country-list"
aria-activedescendant=""
autocomplete="off"
aria-expanded="false"
placeholder="Type to search countries..."
/>
<button aria-label="Toggle suggestions" class="combobox-arrow">
▼
</button>
</div>
<ul
role="listbox"
id="country-list"
class="suggestions-list"
hidden
>
<li
role="option"
id="opt-1"
aria-selected="false"
>
Vietnam
</li>
<li
role="option"
id="opt-2"
aria-selected="false"
>
United States
</li>
<li
role="option"
id="opt-3"
aria-selected="false"
>
United Kingdom
</li>
</ul>
</div>
<script>
const input = document.getElementById('country-input');
const list = document.getElementById('country-list');
const options = [...list.querySelectorAll('[role="option"]')];
let highlightedIndex = -1;
function updateHighlight(index) {
options.forEach((opt, i) => {
opt.setAttribute('aria-selected', i === index ? 'true' : 'false');
});
highlightedIndex = index;
if (index >= 0) {
input.setAttribute('aria-activedescendant', options[index].id);
options[index].scrollIntoView({ block: 'nearest' });
}
}
input.addEventListener('input', () => {
const value = input.value.toLowerCase();
options.forEach(opt => {
const matches = opt.textContent.toLowerCase().includes(value);
opt.hidden = !matches && value.length > 0;
});
list.setAttribute('aria-expanded', 'true');
input.setAttribute('aria-expanded', 'true');
updateHighlight(-1);
});
input.addEventListener('keydown', (e) => {
const visibleOptions = options.filter(o => !o.hidden);
if (e.key === 'ArrowDown') {
e.preventDefault();
const next = Math.min(highlightedIndex + 1, visibleOptions.length - 1);
updateHighlight(visibleOptions.indexOf(options.find(o => o === visibleOptions[next])));
} else if (e.key === 'ArrowUp') {
e.preventDefault();
const prev = Math.max(highlightedIndex - 1, 0);
if (visibleOptions[prev]) updateHighlight(visibleOptions.indexOf(options.find(o => o === visibleOptions[prev])));
} else if (e.key === 'Enter' && highlightedIndex >= 0) {
e.preventDefault();
selectOption(visibleOptions[highlightedIndex]);
} else if (e.key === 'Escape') {
list.hidden = true;
input.setAttribute('aria-expanded', 'false');
}
});
function selectOption(option) {
input.value = option.textContent;
input.setAttribute('aria-activedescendant', option.id);
list.hidden = true;
input.setAttribute('aria-expanded', 'false');
updateHighlight(-1);
}
</script>
<form id="signup-form" novalidate>
<div class="form-group">
<label for="email">Email address <span aria-hidden="true">*</span></label>
<input
type="email"
id="email"
name="email"
aria-required="true"
aria-describedby="email-hint email-error"
autocomplete="email"
/>
<p id="email-hint" class="form-hint">Enter your work email</p>
<p id="email-error" class="form-error" role="alert" hidden>
<span aria-hidden="true">⚠</span>
<span class="sr-only">Error:</span>
Please enter a valid email address
</p>
</div>
<div class="form-group">
<label for="password">Password <span aria-hidden="true">*</span></label>
<input
type="password"
id="password"
name="password"
aria-required="true"
aria-describedby="password-requirements password-error"
autocomplete="new-password"
aria-invalid="false"
/>
<p id="password-requirements" class="form-hint">
Must be 8+ characters with uppercase, lowercase, and number
</p>
<p id="password-error" class="form-error" role="alert" hidden>
<span aria-hidden="true">⚠</span>
<span class="sr-only">Error:</span>
Password must meet all requirements
</p>
</div>
<button type="submit">Create Account</button>
</form>
<script>
const form = document.getElementById('signup-form');
function validateField(input) {
const errorEl = document.getElementById(`${input.id}-error`);
let isValid = true;
let message = '';
// Validation logic based on input type
if (input.type === 'email') {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
isValid = emailRegex.test(input.value);
message = 'Please enter a valid email address';
} else if (input.type === 'password') {
const password = input.value;
const isLongEnough = password.length >= 8;
const hasUppercase = /[A-Z]/.test(password);
const hasLowercase = /[a-z]/.test(password);
const hasNumber = /[0-9]/.test(password);
isValid = isLongEnough && hasUppercase && hasLowercase && hasNumber;
message = 'Password must meet all requirements';
}
// Update ARIA and error display
input.setAttribute('aria-invalid', !isValid);
if (!isValid) {
errorEl.hidden = false;
errorEl.textContent = message;
} else {
errorEl.hidden = true;
}
return isValid;
}
form.addEventListener('submit', (e) => {
e.preventDefault();
const inputs = form.querySelectorAll('input[aria-required="true"]');
let firstError = null;
let allValid = true;
inputs.forEach(input => {
if (!validateField(input)) {
allValid = false;
if (!firstError) firstError = input;
}
});
if (!allValid) {
firstError.focus();
} else {
// Submit form
console.log('Form valid, submitting...');
}
});
// Real-time validation on blur
form.querySelectorAll('input').forEach(input => {
input.addEventListener('blur', () => validateField(input));
});
</script>
<!-- Polite: waits for user to finish current action -->
<div aria-live="polite" aria-atomic="true" class="sr-only">
<!-- Screen reader announces when content updates -->
</div>
<!-- Assertive: interrupts immediately (errors only) -->
<div role="alert" aria-live="assertive">
<!-- Critical messages that must be announced -->
</div>
<!-- Practical example: dynamic message count -->
<div aria-live="polite" aria-atomic="true" class="sr-only" id="message-count">
<span>Item <span id="count">3</span> selected</span>
</div>
<!-- Toast notification example -->
<div role="status" aria-live="polite" class="toast">
<span class="toast-icon" aria-hidden="true">✓</span>
<span class="toast-message">Changes saved successfully</span>
</div>
<body>
<a href="#main-content" class="skip-link">
Skip to main content
</a>
<header>
<nav aria-label="Main navigation">
<!-- Navigation items -->
</nav>
</header>
<main id="main-content" tabindex="-1">
<!-- Main content -->
</main>
<style>
.skip-link {
position: absolute;
top: -100px;
left: 0;
background: #000;
color: #fff;
padding: 16px 24px;
z-index: 10000;
text-decoration: none;
font-weight: bold;
}
.skip-link:focus {
top: 0;
outline: 3px solid #0066cc;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
</style>
</body>
| Task | Shortcut |
|---|---|
| Toggle VoiceOver | Cmd + F5 |
| Read page | VO + A |
| Navigate by heading | VO + H |
| Navigate by link | VO + L |
| Navigate by form field | VO + F |
| Read Rotor | Caps Lock + U |
| Interact with element | VO + Shift + Down |
| Task | Shortcut |
|---|---|
| Toggle NVDA | Insert |
| Read all | Insert + Down |
| Navigate by heading | H |
| Navigate by link | K |
| Navigate by form field | F |
| Read current line | Insert + Up |
| Element list | Insert + F7 |
| Task | Gesture |
|---|---|
| Toggle TalkBack | Settings → Accessibility |
| Read next | Swipe right |
| Read previous | Swipe left |
| Interact | Double-tap |
| Scroll | Two-finger swipe |
| Context menu | Swipe up then right |
| Text Type | Minimum Ratio | AAA Target |
|---|---|---|
| Normal text (< 18pt regular) | 4.5:1 | 7:1 |
| Large text (≥ 18pt or 14pt bold) | 3:1 | 4.5:1 |
| UI components & graphical objects | 3:1 | 4.5:1 |
/* Passes AA (4.5:1) */
--text-primary: #1a1a2e; /* on white #ffffff: 15.9:1 */
--text-secondary: #4a5568; /* on white: 5.7:1 */
/* Passes AA Large Only (3:1) */
--text-muted: #718096; /* on white: 3.1:1 */
/* Fails - NOT usable for text */
--text-error: #e53e3e; /* on white: 3.2:1 - JUST passes for large */
# Install axe-core CLI
npm install -g @axe-core/cli
# Run accessibility audit
axe https://example.com --exit
# Save results as JSON
axe https://example.com --save=results.json
# Test specific standard
axe https://example.com --standard=wcag2.2aa
# Exit with error code if violations found (CI)
axe https://example.com --exit-if-has-errors
// React Router example
useEffect(() => {
const main = document.querySelector('main');
if (main) {
// Option 1: Focus the main landmark
main.focus();
// Option 2: Focus the h1 for better announcement
const h1 = main.querySelector('h1');
h1?.focus();
}
}, [location.pathname]);
// HTML: <main id="main-content" tabIndex={-1}>
import { useEffect, useRef } from 'react';
interface FocusTrapProps {
children: React.ReactNode;
initialFocusRef?: React.RefObject<HTMLElement>;
}
export function FocusTrap({ children, initialFocusRef }: FocusTrapProps) {
const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => {
const container = containerRef.current;
if (!container) return;
const focusable = container.querySelectorAll<HTMLElement>(
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
);
const first = focusable[0];
const last = focusable[focusable.length - 1];
// Focus initial element or first focusable
(initialFocusRef?.current || first)?.focus();
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key !== 'Tab') return;
if (e.shiftKey && document.activeElement === first) {
e.preventDefault();
last?.focus();
} else if (!e.shiftKey && document.activeElement === last) {
e.preventDefault();
first?.focus();
}
};
container.addEventListener('keydown', handleKeyDown);
return () => container.removeEventListener('keydown', handleKeyDown);
}, [initialFocusRef]);
return <div ref={containerRef}>{children}</div>;
}
| Guideline | Target | Tools |
|---|---|---|
| Reading level | Grade 8 max | Hemingway App, readability checkers |
| Sentence length | < 25 words average | ProWritingAid |
| Paragraph length | < 5 sentences | — |
| Jargon | Define on first use | — |
## Accessibility Statement
### Our Commitment
We are committed to ensuring digital accessibility for people with disabilities. We continually improve the user experience for everyone and apply relevant accessibility standards.
### Conformance Status
We aim to conform to the [Web Content Accessibility Guidelines (WCAG) 2.1](https://www.w3.org/WAI/WCAG21/Understanding/) at Level AA.
### Measures Taken
We have taken the following measures:
- Semantic HTML5 markup
- Keyboard navigable interface
- ARIA roles and states for dynamic content
- Color contrast meeting WCAG 2.1 AA standards
- Screen reader compatible navigation
### Known Limitations
[Document any known limitations with specific workarounds]
### Feedback
We welcome your feedback on the accessibility of [Product Name].
Please let us know if you encounter accessibility barriers:
- Email: [email protected]
- Phone: [Number]
- Address: [Address]
### Assessment Approach
[Describe how the product was evaluated]
### Date
This statement was last updated on [Date].
| Mistake | Impact | Fix |
|---|---|---|
<div onclick> | No keyboard access, no AT announcement | Use <button> |
outline: none | Can't see where you are | Custom focus style with high contrast |
| Red = error only | Colorblind users miss errors | Icon + text + color |
Missing <label> | Screen readers don't know field purpose | <label for="id"> on every input |
| Auto-playing media | AT can't compete, users frustrated | User-initiated, visible controls |
| Missing alt text | Images meaningless to AT | Meaningful alt or alt="" for decorative |
| Focus trapped in modal | Can't escape modal | Escape key, trap properly, return focus on close |
| Wrong live region | Announcements at wrong times | polite for non-urgent, assertive only for errors |
| Focus hidden by header | Can't see where you are | position: sticky with z-index management |
| Touch target < 44px | Hard to tap accurately | Size to 44×44px minimum |
| Missing skip link | Annoying to skip repetitive nav | Add skip-to-main link |
aria-hidden on focusable | Removes from AT access | Never use on interactive elements |
prefers-reduced-motion
## Scope, Verification & Guardrail Contract
- **Out of Scope (Not For):** game-engine accessibility (`game-accessibility-engineer`), brand visual direction (`ui-designer` / `unslop`), or backend API contracts (`api-designer`).
- **Deterministic Verifier:** Run axe-core / Playwright a11y tests or `node scripts/art-direction/ui-dom-probe.mjs <url> --hover-focus` and record Schema v2 evidence (`VERIFY.md`: exact command, `tree_sha`, `output_sha256`).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
accessibility, a11y, wcag, aria, screen-reader, keyboard-navigation
npx claudepluginhub buiphucminhtam/forgewright --plugin forgewright93 skills in this plugin
/3d-spatial-engineerUse for 3D spatial layouts, scene-graph coordinate transforms, greybox blockouts, culling volumes, static batching, and LOD optimization across 3D game engines./ai-behavior-engineerUse for game AI and NPC decision systems: finite state machines, behavior trees, utility AI, GOAP, perception, navigation, tactical steering, and encounter tuning./ai-engineerUse for production AI/ML application systems, LLM API integrations, RAG retrieval pipelines, structured outputs, model serving, prompt/tool orchestration, and AI reliability checks.Other plugins' skills for the same job