Skip to content

Commit 7636dfa

Browse files
authored
feat: add a11y skills agent (#1387)
* feat(accessibility): add Accessibility Change Audit guideline document - Introduced a new SKILL.md file outlining the Accessibility Change Audit process. - The document provides an overview, usage scenarios, a checklist for auditing UI changes, and minimal fix patterns to enhance accessibility in UI components. - Aimed at improving semantic structure, catching accessibility regressions, and increasing test reliability. * refactor(accessibility): update Accessibility Change Audit guidelines - Enhanced the description to include accessibility audits and flaky UI tests. - Clarified prerequisites and instructions for conducting audits. - Introduced a diff-first approach for evaluating UI changes. - Expanded the audit checklist and output format for better clarity and usability. * feat(accessibility): introduce new a11y-audit skills and update existing guidelines - Added new SKILL.md files for `claude-a11y-audit` and `codex-a11y-audit`, providing detailed descriptions for accessibility audits. - Updated the existing `accessibility-change-audit` SKILL.md to rename it to `a11y-audit` for consistency and clarity. - Adjusted .gitignore to exclude specific settings files. * feat(a11y): add codex-a11y-audit skill documentation - Introduced a new SKILL.md file for `codex-a11y-audit`, detailing its use for reviewing UI diffs, accessibility audits, and identifying a11y regressions. - The document includes a link to the canonical skill for consistency in accessibility auditing practices. * feat(a11y): update a11y-audit skill documentation and introduce new file - Updated the SKILL.md files for `claude-a11y-audit` and `codex-a11y-audit` to link to the new `a11y-audit` documentation. - Introduced a comprehensive SKILL.md file for `a11y-audit`, detailing its purpose, prerequisites, instructions, and a checklist for conducting accessibility audits. - Enhanced the document to provide clear guidelines for identifying accessibility regressions and proposing minimal fixes.
1 parent 9c5c58e commit 7636dfa

4 files changed

Lines changed: 149 additions & 1 deletion

File tree

.claude/skills/a11y-audit/SKILL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: claude-a11y-audit
3+
description: Use when reviewing UI diffs, accessibility audits, or flaky UI tests to catch a11y regressions, semantic issues, keyboard/focus problems, and to recommend minimal fixes plus role-based test selectors.
4+
---
5+
6+
This skill is shared. Read the canonical skill at:
7+
../../../skills/a11y-audit/SKILL.md

.codex/skills/a11y-audit/SKILL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: codex-a11y-audit
3+
description: Use when reviewing UI diffs, accessibility audits, or flaky UI tests to catch a11y regressions, semantic issues, keyboard/focus problems, and to recommend minimal fixes plus role-based test selectors.
4+
---
5+
6+
This skill is shared. Read the canonical skill at:
7+
../../../skills/a11y-audit/SKILL.md

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ packages/**/yarn.lock
1919
# DIRS #
2020
########
2121
# root
22-
.claude/
22+
.claude/settings.local.json
2323
.cursor/
2424
.idea/
2525
.mcp.json

skills/a11y-audit/SKILL.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
name: a11y-audit
3+
description: Use when reviewing UI diffs, accessibility audits, or flaky UI tests to catch a11y regressions, semantic issues, keyboard/focus problems, and to recommend minimal fixes plus role-based test selectors.
4+
---
5+
6+
# Accessibility Change Audit
7+
8+
Brief purpose: review UI changes for accessibility regressions and missing improvements, then propose minimal fixes tied to the diff.
9+
10+
## Overview
11+
12+
This skill audits UI diffs for semantics, keyboard access, focus management, ARIA correctness, contrast, and testability. It is diff-first: only evaluate changed lines and their immediate context.
13+
14+
## Prerequisites
15+
16+
- A diff, PR, or change list that includes relevant UI files.
17+
- Optional: a screenshot or description of the changed UI state.
18+
19+
## Instructions
20+
21+
### Step 1: Scope the audit to the diff
22+
23+
Identify changed UI elements, interactions, and styles. Ignore unrelated files.
24+
25+
### Step 2: Run the diff-first checklist
26+
27+
Focus on changes that alter semantics, interaction, or visual affordances.
28+
29+
### Step 3: Produce findings and minimal fixes
30+
31+
Tie each issue to a specific change and propose the smallest reasonable fix.
32+
33+
### Step 4: Improve test reliability
34+
35+
Recommend role- and name-based queries for tests instead of data or class selectors.
36+
37+
## Audit Checklist (Diff-First)
38+
39+
Semantics and structure
40+
41+
- Headings follow order and are not skipped.
42+
- Interactive elements are buttons/links, not divs/spans.
43+
- Landmarks are present for new regions (main, nav, header, footer, aside).
44+
- Lists and tables use correct elements (ul/ol/li, th/thead/tbody).
45+
46+
Labels and names
47+
48+
- Inputs have labels or aria-label/aria-labelledby.
49+
- Icon-only controls have accessible names.
50+
- Helper text ties to inputs via aria-describedby.
51+
52+
Keyboard and focus
53+
54+
- All interactive elements are keyboard reachable and operable.
55+
- Focus order follows DOM order (avoid tabIndex > 0).
56+
- Dialogs/menus trap focus and return focus to trigger.
57+
58+
ARIA correctness
59+
60+
- ARIA only when native semantics are insufficient.
61+
- aria-expanded/controls/pressed reflect actual state.
62+
- role is correct and not redundant.
63+
64+
Visual and motion
65+
66+
- Text and focus indicators meet contrast requirements.
67+
- Color is not the only indicator.
68+
- Motion respects reduced-motion preferences.
69+
70+
Media and imagery
71+
72+
- Images have meaningful alt or empty alt for decorative.
73+
- Media controls are accessible and labeled.
74+
75+
Testing reliability
76+
77+
- New elements can be found by role and accessible name.
78+
- Interaction tests use user flows and semantic queries.
79+
80+
## Minimal Fix Patterns
81+
82+
1. Icon-only button
83+
84+
- Add visible text or aria-label.
85+
86+
2. Clickable non-button
87+
88+
- Convert to <button> or add role="button", tabIndex=0, and Enter/Space handling.
89+
90+
3. Form label
91+
92+
- Add <label htmlFor> or aria-labelledby and connect helper text with aria-describedby.
93+
94+
4. Disclosure
95+
96+
- Toggle uses aria-expanded and aria-controls; update on state change.
97+
98+
5. Dialog
99+
100+
- Use role="dialog", aria-modal, label by heading, and return focus on close.
101+
102+
## Output Format
103+
104+
Findings (ordered by severity):
105+
106+
- [severity] path:line - problem and impact
107+
Fix: minimal change suggestion
108+
109+
Tests:
110+
111+
- Recommend updates that use role/name queries and user-driven events.
112+
113+
UX/Speed Note:
114+
115+
- Call out any change that impacts perceived speed (layout shifts, heavy DOM, over-rendering).
116+
117+
Severity scale: blocker, high, medium, low.
118+
119+
## Example Review Output
120+
121+
Findings:
122+
123+
- high `packages/web/src/views/Example.tsx:42` - Clickable div lacks keyboard support; keyboard users cannot activate it.
124+
Fix: convert to <button type="button"> or add role, tabIndex, and Enter/Space handlers.
125+
- medium `packages/web/src/views/Example.tsx:60` - Icon-only control has no accessible name.
126+
Fix: add aria-label="Add event".
127+
128+
Tests:
129+
130+
- Add a role-based query: getByRole("button", { name: /add event/i }).
131+
132+
UX/Speed Note:
133+
134+
- No layout shift detected; DOM complexity unchanged.

0 commit comments

Comments
 (0)