Patterns for building accessible web applications following WCAG guidelines
View on GitHubplugins/aai-dev-frontend/skills/accessibility-patterns/SKILL.md
February 1, 2026
Select agents to install to:
npx add-skill https://github.com/the-answerai/alphaagent-team/blob/main/plugins/aai-dev-frontend/skills/accessibility-patterns/SKILL.md -a claude-code --skill accessibility-patternsInstallation paths:
.claude/skills/accessibility-patterns/# Accessibility Patterns Skill
Patterns for building accessible web applications that work for all users.
## Core Principles (POUR)
- **Perceivable**: Content can be perceived by all senses
- **Operable**: Interface can be operated by all users
- **Understandable**: Content and operation are clear
- **Robust**: Works with current and future technologies
## Semantic HTML
### Use Appropriate Elements
```html
<!-- Bad: Div soup -->
<div class="header">
<div class="nav">
<div class="link">Home</div>
</div>
</div>
<!-- Good: Semantic elements -->
<header>
<nav aria-label="Main navigation">
<a href="/">Home</a>
</nav>
</header>
```
### Heading Hierarchy
```html
<!-- Maintain proper heading order -->
<h1>Page Title</h1>
<h2>Section</h2>
<h3>Subsection</h3>
<h2>Another Section</h2>
<h3>Subsection</h3>
<!-- Never skip levels -->
<!-- Bad: h1 → h3 -->
<!-- Good: h1 → h2 → h3 -->
```
### Landmarks
```html
<header role="banner">
<nav role="navigation" aria-label="Main">...</nav>
</header>
<main role="main">
<article>...</article>
<aside role="complementary">...</aside>
</main>
<footer role="contentinfo">...</footer>
```
## Keyboard Navigation
### Focus Management
```typescript
function Modal({ isOpen, onClose, children }) {
const modalRef = useRef<HTMLDivElement>(null);
const previousFocus = useRef<HTMLElement | null>(null);
useEffect(() => {
if (isOpen) {
// Store current focus
previousFocus.current = document.activeElement as HTMLElement;
// Focus modal
modalRef.current?.focus();
} else {
// Restore focus on close
previousFocus.current?.focus();
}
}, [isOpen]);
// Trap focus inside modal
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === 'Escape') {
onClose();
}
if (e.key === 'Tab') {
// Focus trap logic
}
};
return (
<div
ref={modalRef}
role="dialog"
aria-modal="true"
tabIndex={-1}
onKeyDo