home / skills / fusengine / agents / validating-accessibility

This skill validates accessibility compliance across WCAG 2.2 AA, color contrast, keyboard navigation, ARIA, and semantic structure in code.

npx playbooks add skill fusengine/agents --skill validating-accessibility

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
3.3 KB
---
name: validating-accessibility
description: Use when checking accessibility, color contrast, keyboard navigation, ARIA, or WCAG compliance. Covers WCAG 2.2 Level AA requirements.
versions:
  wcag: "2.2"
user-invocable: true
allowed-tools: Read, Edit, Glob, Grep
references: references/ux-nielsen.md, references/ux-laws.md, references/ux-wcag.md, references/ux-patterns.md, references/buttons-guide.md, references/forms-guide.md
related-skills: generating-components, interactive-states
---

# Validating Accessibility

## Agent Workflow (MANDATORY)

Before ANY accessibility validation, use `TeamCreate` to spawn 3 agents:

1. **fuse-ai-pilot:explore-codebase** - Find components to audit
2. **fuse-ai-pilot:research-expert** - Verify latest WCAG 2.2 requirements
3. Check existing ARIA patterns in codebase

After fixes, run **fuse-ai-pilot:sniper** for validation.

---

## Overview

| Feature | Description |
|---------|-------------|
| **WCAG 2.2 AA** | Minimum compliance level |
| **Color Contrast** | 4.5:1 text, 3:1 UI |
| **Keyboard** | Full navigation support |
| **ARIA** | Screen reader support |

---

## Critical Rules

1. **4.5:1 contrast** - Normal text minimum
2. **3:1 contrast** - Large text and UI components
3. **Focus visible** - All interactive elements
4. **Reduced motion** - Respect user preference
5. **Labels required** - All form inputs

---

## Quick Checklist

```
[ ] Color contrast: 4.5:1 (text), 3:1 (UI)
[ ] Keyboard: All elements focusable
[ ] Focus: Visible indicators (ring-2)
[ ] ARIA: Correct attributes
[ ] Motion: prefers-reduced-motion
[ ] Semantic: Proper heading hierarchy
[ ] Labels: All inputs labeled
[ ] Alt text: All images
```

---

## Reference Guide

### Concepts

| Topic | Reference | When to Consult |
|-------|-----------|-----------------|
| **Nielsen Heuristics** | [ux-nielsen.md](references/ux-nielsen.md) | 10 usability heuristics |
| **Laws of UX** | [ux-laws.md](references/ux-laws.md) | Cognitive psychology |
| **WCAG 2.2** | [ux-wcag.md](references/ux-wcag.md) | Accessibility standards |
| **UX Patterns** | [ux-patterns.md](references/ux-patterns.md) | Common UX patterns |
| **Buttons** | [buttons-guide.md](references/buttons-guide.md) | Touch targets, focus |
| **Forms** | [forms-guide.md](references/forms-guide.md) | Labels, validation |

---

## Quick Reference

### Color Contrast

```
Normal text (<18px):     4.5:1 minimum
Large text (≄18px):      3:1 minimum
UI components:           3:1 minimum
```

### Focus Indicator

```tsx
className="focus:outline-none focus-visible:ring-2 focus-visible:ring-primary"
```

### Reduced Motion

```tsx
import { useReducedMotion } from "framer-motion";

const shouldReduce = useReducedMotion();
<motion.div animate={shouldReduce ? {} : { y: 0 }} />
```

### ARIA Patterns

```tsx
// Icon button
<button aria-label="Close">
  <X className="h-4 w-4" />
</button>

// Form with description
<input aria-describedby="hint" />
<p id="hint">Must be 8+ characters</p>
```

→ See [ux-principles.md](references/ux-principles.md) for complete patterns

---

## Best Practices

### DO
- Test with keyboard only
- Use semantic HTML first
- Add aria-label to icon buttons
- Respect reduced motion
- Test with screen reader

### DON'T
- Skip focus indicators
- Use color alone for meaning
- Forget alt text on images
- Remove outline without replacement
- Ignore heading hierarchy

Overview

This skill validates UI accessibility against WCAG 2.2 Level AA and common best practices. It automates checks for color contrast, keyboard navigation, ARIA attributes, focus visibility, reduced motion, labels, and semantic structure. Use it to find accessibility regressions, guide fixes, and verify compliance after updates. The workflow includes targeted agents to explore code, confirm WCAG rules, and perform final validation.

How this skill works

The skill spawns a small agent team to locate components, verify the latest WCAG 2.2 requirements, and inspect existing ARIA patterns in the codebase. It runs automated contrast checks (4.5:1 for normal text, 3:1 for large text and UI), keyboard-focus verification, ARIA attribute audits, and reduced-motion detection. After fixes are applied, a validation agent re-runs checks and reports remaining issues with concrete remediation suggestions. Results map directly to actionable items developers can use to patch components.

When to use it

  • Before release to ensure WCAG 2.2 AA compliance
  • During accessibility audits or sprint QA passes
  • When adding or refactoring UI components (buttons, forms, dialogs)
  • After visual or interaction changes that might affect focus, contrast, or motion
  • When preparing documentation or bug reports for accessibility issues

Best practices

  • Test with keyboard only and confirm logical tab order
  • Use semantic HTML first; add ARIA only when necessary
  • Ensure 4.5:1 contrast for normal text and 3:1 for large text/UI controls
  • Provide visible focus indicators (e.g., focus-visible:ring-2) and do not remove outlines without replacement
  • Respect prefers-reduced-motion and provide motion-safe fallbacks

Example use cases

  • Audit a component library for color contrast and missing alt text
  • Validate modal dialogs and custom widgets for keyboard focus and ARIA roles
  • Scan forms to confirm labels, aria-describedby usage, and error messaging accessibility
  • Verify that icon-only buttons have aria-label or accessible names
  • Run a post-fix validation to confirm all reported issues are resolved

FAQ

Does this cover WCAG 2.2 Level AA fully?

The skill targets WCAG 2.2 Level AA requirements relevant to UI code (contrast, keyboard, ARIA, motion, labels). Some manual testing and context-specific checks are still recommended.

Will it change code automatically?

It does not rewrite code automatically. The skill highlights violations and provides concrete remediation steps; automated fixes can be applied by development agents if configured.