WCAG 2.2 Accessibility Audit Skill
When to Use This Skill
Use this skill when the user wants to:
- Perform accessibility testing or auditing on a live webpage
- Evaluate a page against WCAG 2.2 Success Criteria
- Identify accessibility barriers for keyboard and screen reader users
- Generate a structured accessibility audit report with evidence
Tool Usage Strategy (IMPORTANT)
This skill uses a hybrid approach combining structured accessibility tree analysis and visual inspection.
Priority Order
PRIMARY: Accessibility Tree (search_elements)
- Use
search_elements(tabId, query) to retrieve structured accessibility information
- This provides
role, name, value, checked, expanded, disabled, focused, etc.
- Best for: 1.1.1, 2.1.1, 4.1.2 and element identification for other SCs
SECONDARY: Visual Analysis (Screenshot + LLM)
- Use
capture_screenshot(sendToLLM=true) for visual inspection
- Essential for: 1.4.3, 1.4.11, 2.4.7 (contrast and focus visibility)
- Insert
[[screenshot:N]] placeholders in the report for evidence
KEYBOARD INTERACTION: computer tool
- Use
computer(action='key', text='Tab') for keyboard navigation testing
- Essential for: 2.1.1, 2.1.2, 2.4.3, 2.4.7
- Capture screenshots at key moments to document focus path
Workflow for Each Test
1. Identify scope (page/component/flow)
2. Collect evidence via search_elements and/or screenshot
3. Apply SC-specific judgment rules
4. Record Pass/Fail with evidence references
5. Provide actionable fix recommendations
Threat Context & Privacy Notes
IMPORTANT: This audit may capture sensitive information.
- Screenshots and accessibility tree dumps may contain: account names, order details, personal data, auth tokens, internal URLs.
- DO NOT include raw sensitive data in the final report.
- If a screenshot contains PII, note this and recommend masking before sharing.
- Contrast/visual judgments are estimates—always recommend verification with dedicated tools (e.g., WebAIM Contrast Checker, axe DevTools).
Pre-Audit Setup (Recommended)
Before starting the audit, confirm with the user:
- Target Scope: Full page, specific component, or user flow?
- Target Audience: Who are the primary users? (general public, internal staff, specific disability considerations)
- Priority SCs: Test all 8 SCs or focus on specific ones?
- Known Issues: Any existing accessibility issues to verify?
Success Criteria Test Procedures
SC 1.1.1 Non-text Content (Level A)
Goal: All non-text content (images, icons, controls) must have text alternatives.
Test Steps:
Find images and icons:
search_elements(tabId, "image | img")
search_elements(tabId, "button | link | menuitem | tab | switch")
Evaluate each element:
- Check if
name attribute exists and is meaningful
- FAIL conditions:
name is empty or missing
name is generic: "icon", "image", "button", "img", "graphic", file names (e.g., "logo.png")
name duplicates visible text unnecessarily (redundant)
- PASS conditions:
name accurately describes purpose or equivalent information
For decorative content:
- If truly decorative, element should have
role="presentation" or role="none", or name="" (explicitly empty)
Common Failures:
- Icon buttons with no accessible name (screen reader announces "button" only)
- Images with
alt="image" or alt="logo.png"
- SVG icons without
aria-label or visually hidden text
Fix Recommendations:
- Add meaningful
alt text to images
- Use
aria-label or aria-labelledby for icon buttons
- Use native semantic elements where possible (
<button> instead of <div>)
SC 1.4.3 Contrast (Minimum) (Level AA)
Goal: Text must have sufficient contrast against its background.
Requirements:
- Normal text: ≥ 4.5:1 contrast ratio
- Large text (≥24px regular or ≥18.66px bold): ≥ 3:1 contrast ratio
Test Steps:
Capture page states:
capture_screenshot(sendToLLM=true)
- Default state
- Hover/focus states (use
computer to trigger)
- Error/disabled states if applicable
Visual analysis prompt (for LLM):
"Analyze this screenshot for text contrast issues. Identify any text that appears to have low contrast against its background. Focus on:
- Small/body text that may be below 4.5:1
- Placeholder text in input fields
- Disabled state text
- Text overlaid on images or gradients
List suspicious elements with their approximate location."
Record findings:
- Note: Visual analysis provides estimates only
- Flag elements for manual verification with contrast checker tools
Common Failures:
- Light gray text on white backgrounds
- Placeholder text with insufficient contrast
- Text on image backgrounds without overlay
Fix Recommendations:
- Increase text color darkness or background lightness
- Add semi-transparent overlay behind text on images
- Use contrast checker tools to verify exact ratios
SC 1.4.11 Non-text Contrast (Level AA)
Goal: UI components and graphical objects must have ≥ 3:1 contrast.
Applies to:
- Input field borders
- Button borders
- Focus indicators
- Icons conveying information
- State indicators (checkboxes, toggles, radio buttons)
Test Steps:
Identify UI components:
search_elements(tabId, "textbox | combobox | checkbox | radio | switch | button | slider")
Capture states:
capture_screenshot(sendToLLM=true)
- Document default, hover, focus, active, disabled states
Visual analysis prompt:
"Analyze this screenshot for non-text contrast issues. Check if:
- Input field borders are clearly visible (≥3:1 against background)
- Button boundaries are distinguishable
- Icons are clearly visible
- Focus indicators have sufficient contrast
- Checkbox/radio/switch states are visually distinct
List any elements that appear to have insufficient contrast."
State coverage matrix:
Document which states were tested for each component type.
Common Failures:
- Light gray input borders on white backgrounds
- Focus rings with low contrast
- Icon-only buttons where icon color is too light
Fix Recommendations:
- Increase border thickness and/or darkness
- Ensure focus indicators have ≥3:1 contrast
- Test all interactive states, not just default
SC 2.1.1 Keyboard (Level A)
Goal: All functionality must be operable via keyboard.
Test Steps:
Identify key tasks: Ask user or determine primary interactive flows
Attempt keyboard-only completion:
computer(action='key', text='Tab') // Navigate forward
computer(action='key', text='shift+Tab') // Navigate backward
computer(action='key', text='Enter') // Activate buttons/links
computer(action='key', text='Space') // Activate buttons, toggle checkboxes
computer(action='key', text='Escape') // Close dialogs/menus
computer(action='key', text='ArrowDown') // Navigate within widgets
At each step:
- Verify focus is visible (relates to 2.4.7)
- Verify expected action occurs
- If blocked, capture screenshot and note the element
Cross-reference with accessibility tree:
search_elements(tabId, "*")
- Check if blocking element has appropriate
role
- Check if element is
focusable / disabled
Common Failures:
- Custom components using
<div> with onClick but no keyboard handler
- Drag-and-drop only interfaces without keyboard alternative
- Focus not reaching all interactive elements
Fix Recommendations:
- Use native interactive elements (
<button>, <a>, <input>)
- Add
tabindex="0" and keyboard event handlers to custom components
- Provide keyboard alternatives for mouse-only interactions
SC 2.1.2 No Keyboard Trap (Level A)
Goal: If focus can enter a component, it must be able to exit via keyboard.
Test Steps:
Identify potential trap components:
- Modals/dialogs
- Dropdown menus
- Rich text editors
- Embedded iframes
- Custom widgets
For each component:
- Tab into the component
- Attempt to Tab out (forward and backward)
- Attempt Escape to close (if applicable)
- Document entry point and exit behavior
Capture evidence:
capture_screenshot(sendToLLM=true)
- Screenshot when entering
- Screenshot showing focus location
- Note if any special keys are required and whether instructions are provided
Common Failures:
- Modal dialogs that don't close on Escape
- Focus getting "stuck" in embedded content
- Custom dropdown menus that don't release focus
Fix Recommendations:
- Implement focus trapping in modals with Escape to close
- Ensure all custom widgets have documented exit mechanism
- Provide visible instructions if non-standard keys are required
SC 2.4.3 Focus Order (Level A)
Goal: Focus order must preserve meaning and operability.
Test Steps:
Tab through the page:
computer(action='key', text='Tab')
- Document the sequence of focused elements
Compare with visual order:
capture_screenshot(sendToLLM=true)
- Focus sequence should match left-to-right, top-to-bottom reading order
- Related elements should be adjacent in focus order
Test dynamic content:
- Open a modal → focus should move to modal
- Close modal → focus should return to trigger or logical position
- Expand accordion → new content should be reachable
- Show error message → focus should move to or near error
Check for problematic patterns:
search_elements(tabId, "tabindex")
- Positive
tabindex values (>0) cause unpredictable order
Common Failures:
- Focus jumps to unrelated page sections
- Positive
tabindex values creating chaotic order
- Dynamic content inserted but not reachable in logical sequence
Fix Recommendations:
- Use DOM order to control focus order (avoid positive tabindex)
- Manage focus programmatically for dynamic content
- Return focus to logical position after dialog/overlay closes
SC 2.4.7 Focus Visible (Level AA)
Goal: Keyboard focus indicator must be visible.
Test Steps:
Ensure keyboard-only mode:
- Do not use mouse during this test
- Use Tab to navigate
At each focused element:
capture_screenshot(sendToLLM=true)
- Verify focus indicator is clearly visible
- Check various element types: buttons, links, inputs, custom controls
Visual analysis prompt:
"Is there a visible focus indicator on the currently focused element in this screenshot? The indicator should be clearly distinguishable (outline, border, background change, underline, or similar). Describe what you see and whether it provides sufficient visual distinction."
Cross-reference:
search_elements(tabId, "*focused*")
- Confirm which element has
focused state
Common Failures:
- Global
outline: none with no replacement style
- Focus style too subtle (e.g., 1px light gray)
- Focus style matches hover style (can't distinguish keyboard vs mouse)
Fix Recommendations:
- Never remove focus outline without providing alternative
- Ensure focus indicator has ≥3:1 contrast (links to 1.4.11)
- Use
:focus-visible for keyboard-only focus styling
SC 4.1.2 Name, Role, Value (Level A)
Goal: All UI components must expose name, role, and value to assistive technology.
Test Steps:
Extract interactive elements:
search_elements(tabId, "button | link | textbox | combobox | checkbox | radio | switch | tab | menuitem | slider | spinbutton | searchbox")
For each element, verify:
- Role: Is it correct for the component type?
- Name: Is there a meaningful accessible name?
- Value/State: For stateful controls, are states exposed?
checked for checkboxes/radios/switches
expanded for disclosure widgets
selected for tabs/options
pressed for toggle buttons
value for inputs/sliders
Test state changes:
- Toggle a checkbox → re-run
search_elements
- Expand an accordion → verify
expanded state updates
- Select a tab → verify
selected state updates
Common patterns to check:
- Custom checkboxes: must have
role="checkbox" and checked state
- Accordions: trigger must have
aria-expanded
- Tabs: must use
role="tab" with aria-selected
- Menus: proper
role="menu" and role="menuitem"
Common Failures:
<div> buttons without role="button" or accessible name
- Custom toggles without
checked state
- Visual "selected" state not reflected in accessibility tree
Fix Recommendations:
- Prefer native HTML elements (they have built-in semantics)
- Use ARIA roles and states correctly for custom components
- Ensure state changes are programmatically announced
Report Output Template
After completing the audit, generate a Markdown report with this structure:
# WCAG 2.2 Accessibility Audit Report
**Target**: [URL or Page Name]
**Date**: [Audit Date]
**Scope**: [Full page / Component / User flow]
**Auditor**: AIPex WCAG 2.2 A11y Audit Skill
---
## Executive Summary
[1-2 sentence overall assessment. Example: "The page has significant accessibility barriers, particularly in keyboard navigation and missing text alternatives for icon buttons. X of 8 Success Criteria tested have issues."]
---
## Scope & Assumptions
- **Pages/Components Tested**: [List]
- **Testing Method**: Accessibility tree inspection via search_elements + visual analysis via screenshots + keyboard navigation testing
- **Limitations**: Contrast assessments are visual estimates; recommend verification with dedicated tools.
- **Privacy Note**: Screenshots may have been captured; ensure sensitive data is masked before sharing this report.
---
## Results by Success Criterion
### 1.1.1 Non-text Content (Level A)
**Result**: [PASS / FAIL / PARTIAL]
**Evidence**:
- [Describe findings]
- [[screenshot:N]] (if applicable)
**Issues Found**:
| Element | Issue | Severity |
|---------|-------|----------|
| [element description] | [issue description] | [Critical/Serious/Moderate/Minor] |
**Recommendations**:
- [Specific fix recommendations]
---
### 1.4.3 Contrast (Minimum) (Level AA)
**Result**: [PASS / FAIL / PARTIAL / NEEDS VERIFICATION]
**Evidence**:
- [[screenshot:N]]
**Suspected Issues**:
| Element | Suspected Issue | Needs Verification |
|---------|-----------------|---------------------|
| [location/description] | [suspected contrast issue] | Yes |
**Recommendations**:
- Verify with contrast checker tool
- [Specific fixes if contrast is confirmed insufficient]
---
### 1.4.11 Non-text Contrast (Level AA)
**Result**: [PASS / FAIL / PARTIAL / NEEDS VERIFICATION]
**Evidence**:
- [[screenshot:N]]
**State Coverage**:
| Component Type | Default | Hover | Focus | Disabled |
|----------------|---------|-------|-------|----------|
| Input fields | ✓/✗ | ✓/✗ | ✓/✗ | ✓/✗ |
| Buttons | ✓/✗ | ✓/✗ | ✓/✗ | ✓/✗ |
**Issues Found**:
[List issues]
**Recommendations**:
[Fix recommendations]
---
### 2.1.1 Keyboard (Level A)
**Result**: [PASS / FAIL]
**Test Flow**: [Describe the task attempted]
**Evidence**:
- [[screenshot:N]]
- Accessibility tree excerpt: [relevant portion]
**Issues Found**:
| Step | Element | Issue |
|------|---------|-------|
| [step #] | [element] | [keyboard issue] |
**Recommendations**:
[Fix recommendations]
---
### 2.1.2 No Keyboard Trap (Level A)
**Result**: [PASS / FAIL / NOT APPLICABLE]
**Components Tested**:
| Component | Entry | Exit via Tab | Exit via Esc | Instructions |
|-----------|-------|--------------|--------------|--------------|
| [modal] | ✓ | ✓/✗ | ✓/✗ | ✓/✗ |
**Evidence**:
- [[screenshot:N]]
**Issues Found**:
[List issues]
**Recommendations**:
[Fix recommendations]
---
### 2.4.3 Focus Order (Level A)
**Result**: [PASS / FAIL]
**Evidence**:
- [[screenshot:N]]
- Focus sequence: [describe order]
**Issues Found**:
[List focus order problems]
**Recommendations**:
[Fix recommendations]
---
### 2.4.7 Focus Visible (Level AA)
**Result**: [PASS / FAIL / PARTIAL]
**Evidence**:
- [[screenshot:N]] showing focus on [element type]
**Issues Found**:
| Element Type | Focus Visible | Notes |
|--------------|---------------|-------|
| Buttons | ✓/✗ | [description] |
| Links | ✓/✗ | [description] |
| Inputs | ✓/✗ | [description] |
**Recommendations**:
[Fix recommendations]
---
### 4.1.2 Name, Role, Value (Level A)
**Result**: [PASS / FAIL / PARTIAL]
**Evidence**:
- Accessibility tree excerpt:
[relevant search_elements output]
**Issues Found**:
| Element | Role Issue | Name Issue | State Issue |
|---------|------------|------------|-------------|
| [element] | [issue] | [issue] | [issue] |
**Recommendations**:
[Fix recommendations]
---
## Issue Summary (by Severity)
### Critical
[List critical issues - prevent access entirely]
### Serious
[List serious issues - significant barriers]
### Moderate
[List moderate issues - degraded experience]
### Minor
[List minor issues - best practice violations]
---
## Next Steps
1. Address Critical and Serious issues first
2. Re-test after fixes using the same procedures
3. Consider automated testing tools for ongoing monitoring (axe, WAVE, Lighthouse)
4. Verify contrast issues with dedicated contrast checker tools
---
## Appendix: Screenshot Evidence
[Screenshots will be attached when exporting via download_current_chat_report_zip]
Report Export
After completing the audit report, ask the user:
"Would you like me to export this accessibility audit report as a ZIP file with all screenshots included?"
Upon confirmation, use download_current_chat_report_zip tool to package the report with all captured screenshots.
The ZIP will contain:
report.md — The full audit report with working image links
screenshots/ — All captured screenshots from the session
1---2name: wcag22-a11y-audit3description: WCAG 2.2 Accessibility Audit skill that systematically evaluates web pages against 8 core Success Criteria (1.1.1, 1.4.3, 1.4.11, 2.1.1, 2.1.2, 2.4.3, 2.4.7, 4.1.2) using accessibility tree inspection and visual analysis. Use this skill when you need to perform accessibility testing/auditing on a live webpage.4---5
6# WCAG 2.2 Accessibility Audit Skill
7
8## When to Use This Skill
9
10Use this skill when the user wants to:
11
12- Perform accessibility testing or auditing on a live webpage
13- Evaluate a page against WCAG 2.2 Success Criteria
14- Identify accessibility barriers for keyboard and screen reader users
15- Generate a structured accessibility audit report with evidence
16
17---
18
19## Tool Usage Strategy (IMPORTANT)
20
21**This skill uses a hybrid approach combining structured accessibility tree analysis and visual inspection.**
22
23### Priority Order
24
251. **PRIMARY: Accessibility Tree (search_elements)**
26 - Use `search_elements(tabId, query)` to retrieve structured accessibility information
27 - This provides `role`, `name`, `value`, `checked`, `expanded`, `disabled`, `focused`, etc.
28 - Best for: 1.1.1, 2.1.1, 4.1.2 and element identification for other SCs
29
302. **SECONDARY: Visual Analysis (Screenshot + LLM)**
31 - Use `capture_screenshot(sendToLLM=true)` for visual inspection
32 - Essential for: 1.4.3, 1.4.11, 2.4.7 (contrast and focus visibility)
33 - Insert `[[screenshot:N]]` placeholders in the report for evidence
34
353. **KEYBOARD INTERACTION: computer tool**
36 - Use `computer(action='key', text='Tab')` for keyboard navigation testing
37 - Essential for: 2.1.1, 2.1.2, 2.4.3, 2.4.7
38 - Capture screenshots at key moments to document focus path
39
40### Workflow for Each Test
41
42```
431. Identify scope (page/component/flow)
442. Collect evidence via search_elements and/or screenshot
453. Apply SC-specific judgment rules
464. Record Pass/Fail with evidence references
475. Provide actionable fix recommendations
48```
49
50---
51
52## Threat Context & Privacy Notes
53
54**IMPORTANT**: This audit may capture sensitive information.
55
56- Screenshots and accessibility tree dumps may contain: account names, order details, personal data, auth tokens, internal URLs.
57- **DO NOT** include raw sensitive data in the final report.
58- If a screenshot contains PII, note this and recommend masking before sharing.
59- Contrast/visual judgments are **estimates**—always recommend verification with dedicated tools (e.g., WebAIM Contrast Checker, axe DevTools).
60
61---
62
63## Pre-Audit Setup (Recommended)
64
65Before starting the audit, confirm with the user:
66
671. **Target Scope**: Full page, specific component, or user flow?
682. **Target Audience**: Who are the primary users? (general public, internal staff, specific disability considerations)
693. **Priority SCs**: Test all 8 SCs or focus on specific ones?
704. **Known Issues**: Any existing accessibility issues to verify?
71
72---
73
74## Success Criteria Test Procedures
75
76### SC 1.1.1 Non-text Content (Level A)
77
78**Goal**: All non-text content (images, icons, controls) must have text alternatives.
79
80**Test Steps**:
81
821. **Find images and icons**:
83 ```
84 search_elements(tabId, "image | img")
85 search_elements(tabId, "button | link | menuitem | tab | switch")
86 ```
87
882. **Evaluate each element**:
89 - Check if `name` attribute exists and is meaningful
90 - **FAIL** conditions:
91 - `name` is empty or missing
92 - `name` is generic: "icon", "image", "button", "img", "graphic", file names (e.g., "logo.png")
93 - `name` duplicates visible text unnecessarily (redundant)
94 - **PASS** conditions:
95 - `name` accurately describes purpose or equivalent information
96
973. **For decorative content**:
98 - If truly decorative, element should have `role="presentation"` or `role="none"`, or `name=""` (explicitly empty)
99
100**Common Failures**:
101- Icon buttons with no accessible name (screen reader announces "button" only)
102- Images with `alt="image"` or `alt="logo.png"`
103- SVG icons without `aria-label` or visually hidden text
104
105**Fix Recommendations**:
106- Add meaningful `alt` text to images
107- Use `aria-label` or `aria-labelledby` for icon buttons
108- Use native semantic elements where possible (`<button>` instead of `<div>`)
109
110---
111
112### SC 1.4.3 Contrast (Minimum) (Level AA)
113
114**Goal**: Text must have sufficient contrast against its background.
115
116**Requirements**:
117- Normal text: ≥ 4.5:1 contrast ratio
118- Large text (≥24px regular or ≥18.66px bold): ≥ 3:1 contrast ratio
119
120**Test Steps**:
121
1221. **Capture page states**:
123 ```
124 capture_screenshot(sendToLLM=true)
125 ```
126 - Default state
127 - Hover/focus states (use `computer` to trigger)
128 - Error/disabled states if applicable
129
1302. **Visual analysis prompt** (for LLM):
131 > "Analyze this screenshot for text contrast issues. Identify any text that appears to have low contrast against its background. Focus on:
132 > - Small/body text that may be below 4.5:1
133 > - Placeholder text in input fields
134 > - Disabled state text
135 > - Text overlaid on images or gradients
136 > List suspicious elements with their approximate location."
137
1383. **Record findings**:
139 - Note: Visual analysis provides **estimates only**
140 - Flag elements for manual verification with contrast checker tools
141
142**Common Failures**:
143- Light gray text on white backgrounds
144- Placeholder text with insufficient contrast
145- Text on image backgrounds without overlay
146
147**Fix Recommendations**:
148- Increase text color darkness or background lightness
149- Add semi-transparent overlay behind text on images
150- Use contrast checker tools to verify exact ratios
151
152---
153
154### SC 1.4.11 Non-text Contrast (Level AA)
155
156**Goal**: UI components and graphical objects must have ≥ 3:1 contrast.
157
158**Applies to**:
159- Input field borders
160- Button borders
161- Focus indicators
162- Icons conveying information
163- State indicators (checkboxes, toggles, radio buttons)
164
165**Test Steps**:
166
1671. **Identify UI components**:
168 ```
169 search_elements(tabId, "textbox | combobox | checkbox | radio | switch | button | slider")
170 ```
171
1722. **Capture states**:
173 ```
174 capture_screenshot(sendToLLM=true)
175 ```
176 - Document default, hover, focus, active, disabled states
177
1783. **Visual analysis prompt**:
179 > "Analyze this screenshot for non-text contrast issues. Check if:
180 > - Input field borders are clearly visible (≥3:1 against background)
181 > - Button boundaries are distinguishable
182 > - Icons are clearly visible
183 > - Focus indicators have sufficient contrast
184 > - Checkbox/radio/switch states are visually distinct
185 > List any elements that appear to have insufficient contrast."
186
1874. **State coverage matrix**:
188 Document which states were tested for each component type.
189
190**Common Failures**:
191- Light gray input borders on white backgrounds
192- Focus rings with low contrast
193- Icon-only buttons where icon color is too light
194
195**Fix Recommendations**:
196- Increase border thickness and/or darkness
197- Ensure focus indicators have ≥3:1 contrast
198- Test all interactive states, not just default
199
200---
201
202### SC 2.1.1 Keyboard (Level A)
203
204**Goal**: All functionality must be operable via keyboard.
205
206**Test Steps**:
207
2081. **Identify key tasks**: Ask user or determine primary interactive flows
209
2102. **Attempt keyboard-only completion**:
211 ```
212 computer(action='key', text='Tab') // Navigate forward
213 computer(action='key', text='shift+Tab') // Navigate backward
214 computer(action='key', text='Enter') // Activate buttons/links
215 computer(action='key', text='Space') // Activate buttons, toggle checkboxes
216 computer(action='key', text='Escape') // Close dialogs/menus
217 computer(action='key', text='ArrowDown') // Navigate within widgets
218 ```
219
2203. **At each step**:
221 - Verify focus is visible (relates to 2.4.7)
222 - Verify expected action occurs
223 - If blocked, capture screenshot and note the element
224
2254. **Cross-reference with accessibility tree**:
226 ```
227 search_elements(tabId, "*")
228 ```
229 - Check if blocking element has appropriate `role`
230 - Check if element is `focusable` / `disabled`
231
232**Common Failures**:
233- Custom components using `<div>` with `onClick` but no keyboard handler
234- Drag-and-drop only interfaces without keyboard alternative
235- Focus not reaching all interactive elements
236
237**Fix Recommendations**:
238- Use native interactive elements (`<button>`, `<a>`, `<input>`)
239- Add `tabindex="0"` and keyboard event handlers to custom components
240- Provide keyboard alternatives for mouse-only interactions
241
242---
243
244### SC 2.1.2 No Keyboard Trap (Level A)
245
246**Goal**: If focus can enter a component, it must be able to exit via keyboard.
247
248**Test Steps**:
249
2501. **Identify potential trap components**:
251 - Modals/dialogs
252 - Dropdown menus
253 - Rich text editors
254 - Embedded iframes
255 - Custom widgets
256
2572. **For each component**:
258 - Tab into the component
259 - Attempt to Tab out (forward and backward)
260 - Attempt Escape to close (if applicable)
261 - Document entry point and exit behavior
262
2633. **Capture evidence**:
264 ```
265 capture_screenshot(sendToLLM=true)
266 ```
267 - Screenshot when entering
268 - Screenshot showing focus location
269 - Note if any special keys are required and whether instructions are provided
270
271**Common Failures**:
272- Modal dialogs that don't close on Escape
273- Focus getting "stuck" in embedded content
274- Custom dropdown menus that don't release focus
275
276**Fix Recommendations**:
277- Implement focus trapping in modals with Escape to close
278- Ensure all custom widgets have documented exit mechanism
279- Provide visible instructions if non-standard keys are required
280
281---
282
283### SC 2.4.3 Focus Order (Level A)
284
285**Goal**: Focus order must preserve meaning and operability.
286
287**Test Steps**:
288
2891. **Tab through the page**:
290 ```
291 computer(action='key', text='Tab')
292 ```
293 - Document the sequence of focused elements
294
2952. **Compare with visual order**:
296 ```
297 capture_screenshot(sendToLLM=true)
298 ```
299 - Focus sequence should match left-to-right, top-to-bottom reading order
300 - Related elements should be adjacent in focus order
301
3023. **Test dynamic content**:
303 - Open a modal → focus should move to modal
304 - Close modal → focus should return to trigger or logical position
305 - Expand accordion → new content should be reachable
306 - Show error message → focus should move to or near error
307
3084. **Check for problematic patterns**:
309 ```
310 search_elements(tabId, "tabindex")
311 ```
312 - Positive `tabindex` values (>0) cause unpredictable order
313
314**Common Failures**:
315- Focus jumps to unrelated page sections
316- Positive `tabindex` values creating chaotic order
317- Dynamic content inserted but not reachable in logical sequence
318
319**Fix Recommendations**:
320- Use DOM order to control focus order (avoid positive tabindex)
321- Manage focus programmatically for dynamic content
322- Return focus to logical position after dialog/overlay closes
323
324---
325
326### SC 2.4.7 Focus Visible (Level AA)
327
328**Goal**: Keyboard focus indicator must be visible.
329
330**Test Steps**:
331
3321. **Ensure keyboard-only mode**:
333 - Do not use mouse during this test
334 - Use Tab to navigate
335
3362. **At each focused element**:
337 ```
338 capture_screenshot(sendToLLM=true)
339 ```
340 - Verify focus indicator is clearly visible
341 - Check various element types: buttons, links, inputs, custom controls
342
3433. **Visual analysis prompt**:
344 > "Is there a visible focus indicator on the currently focused element in this screenshot? The indicator should be clearly distinguishable (outline, border, background change, underline, or similar). Describe what you see and whether it provides sufficient visual distinction."
345
3464. **Cross-reference**:
347 ```
348 search_elements(tabId, "*focused*")
349 ```
350 - Confirm which element has `focused` state
351
352**Common Failures**:
353- Global `outline: none` with no replacement style
354- Focus style too subtle (e.g., 1px light gray)
355- Focus style matches hover style (can't distinguish keyboard vs mouse)
356
357**Fix Recommendations**:
358- Never remove focus outline without providing alternative
359- Ensure focus indicator has ≥3:1 contrast (links to 1.4.11)
360- Use `:focus-visible` for keyboard-only focus styling
361
362---
363
364### SC 4.1.2 Name, Role, Value (Level A)
365
366**Goal**: All UI components must expose name, role, and value to assistive technology.
367
368**Test Steps**:
369
3701. **Extract interactive elements**:
371 ```
372 search_elements(tabId, "button | link | textbox | combobox | checkbox | radio | switch | tab | menuitem | slider | spinbutton | searchbox")
373 ```
374
3752. **For each element, verify**:
376 - **Role**: Is it correct for the component type?
377 - **Name**: Is there a meaningful accessible name?
378 - **Value/State**: For stateful controls, are states exposed?
379 - `checked` for checkboxes/radios/switches
380 - `expanded` for disclosure widgets
381 - `selected` for tabs/options
382 - `pressed` for toggle buttons
383 - `value` for inputs/sliders
384
3853. **Test state changes**:
386 - Toggle a checkbox → re-run `search_elements`
387 - Expand an accordion → verify `expanded` state updates
388 - Select a tab → verify `selected` state updates
389
3904. **Common patterns to check**:
391 - Custom checkboxes: must have `role="checkbox"` and `checked` state
392 - Accordions: trigger must have `aria-expanded`
393 - Tabs: must use `role="tab"` with `aria-selected`
394 - Menus: proper `role="menu"` and `role="menuitem"`
395
396**Common Failures**:
397- `<div>` buttons without `role="button"` or accessible name
398- Custom toggles without `checked` state
399- Visual "selected" state not reflected in accessibility tree
400
401**Fix Recommendations**:
402- Prefer native HTML elements (they have built-in semantics)
403- Use ARIA roles and states correctly for custom components
404- Ensure state changes are programmatically announced
405
406---
407
408## Report Output Template
409
410After completing the audit, generate a Markdown report with this structure:
411
412```markdown
413# WCAG 2.2 Accessibility Audit Report
414
415**Target**: [URL or Page Name]
416**Date**: [Audit Date]
417**Scope**: [Full page / Component / User flow]
418**Auditor**: AIPex WCAG 2.2 A11y Audit Skill
419
420---
421
422## Executive Summary
423
424[1-2 sentence overall assessment. Example: "The page has significant accessibility barriers, particularly in keyboard navigation and missing text alternatives for icon buttons. X of 8 Success Criteria tested have issues."]
425
426---
427
428## Scope & Assumptions
429
430- **Pages/Components Tested**: [List]
431- **Testing Method**: Accessibility tree inspection via search_elements + visual analysis via screenshots + keyboard navigation testing
432- **Limitations**: Contrast assessments are visual estimates; recommend verification with dedicated tools.
433- **Privacy Note**: Screenshots may have been captured; ensure sensitive data is masked before sharing this report.
434
435---
436
437## Results by Success Criterion
438
439### 1.1.1 Non-text Content (Level A)
440
441**Result**: [PASS / FAIL / PARTIAL]
442
443**Evidence**:
444- [Describe findings]
445- [[screenshot:N]] (if applicable)
446
447**Issues Found**:
448| Element | Issue | Severity |
449|---------|-------|----------|
450| [element description] | [issue description] | [Critical/Serious/Moderate/Minor] |
451
452**Recommendations**:
453- [Specific fix recommendations]
454
455---
456
457### 1.4.3 Contrast (Minimum) (Level AA)
458
459**Result**: [PASS / FAIL / PARTIAL / NEEDS VERIFICATION]
460
461**Evidence**:
462- [[screenshot:N]]
463
464**Suspected Issues**:
465| Element | Suspected Issue | Needs Verification |
466|---------|-----------------|---------------------|
467| [location/description] | [suspected contrast issue] | Yes |
468
469**Recommendations**:
470- Verify with contrast checker tool
471- [Specific fixes if contrast is confirmed insufficient]
472
473---
474
475### 1.4.11 Non-text Contrast (Level AA)
476
477**Result**: [PASS / FAIL / PARTIAL / NEEDS VERIFICATION]
478
479**Evidence**:
480- [[screenshot:N]]
481
482**State Coverage**:
483| Component Type | Default | Hover | Focus | Disabled |
484|----------------|---------|-------|-------|----------|
485| Input fields | ✓/✗ | ✓/✗ | ✓/✗ | ✓/✗ |
486| Buttons | ✓/✗ | ✓/✗ | ✓/✗ | ✓/✗ |
487
488**Issues Found**:
489[List issues]
490
491**Recommendations**:
492[Fix recommendations]
493
494---
495
496### 2.1.1 Keyboard (Level A)
497
498**Result**: [PASS / FAIL]
499
500**Test Flow**: [Describe the task attempted]
501
502**Evidence**:
503- [[screenshot:N]]
504- Accessibility tree excerpt: [relevant portion]
505
506**Issues Found**:
507| Step | Element | Issue |
508|------|---------|-------|
509| [step #] | [element] | [keyboard issue] |
510
511**Recommendations**:
512[Fix recommendations]
513
514---
515
516### 2.1.2 No Keyboard Trap (Level A)
517
518**Result**: [PASS / FAIL / NOT APPLICABLE]
519
520**Components Tested**:
521| Component | Entry | Exit via Tab | Exit via Esc | Instructions |
522|-----------|-------|--------------|--------------|--------------|
523| [modal] | ✓ | ✓/✗ | ✓/✗ | ✓/✗ |
524
525**Evidence**:
526- [[screenshot:N]]
527
528**Issues Found**:
529[List issues]
530
531**Recommendations**:
532[Fix recommendations]
533
534---
535
536### 2.4.3 Focus Order (Level A)
537
538**Result**: [PASS / FAIL]
539
540**Evidence**:
541- [[screenshot:N]]
542- Focus sequence: [describe order]
543
544**Issues Found**:
545[List focus order problems]
546
547**Recommendations**:
548[Fix recommendations]
549
550---
551
552### 2.4.7 Focus Visible (Level AA)
553
554**Result**: [PASS / FAIL / PARTIAL]
555
556**Evidence**:
557- [[screenshot:N]] showing focus on [element type]
558
559**Issues Found**:
560| Element Type | Focus Visible | Notes |
561|--------------|---------------|-------|
562| Buttons | ✓/✗ | [description] |
563| Links | ✓/✗ | [description] |
564| Inputs | ✓/✗ | [description] |
565
566**Recommendations**:
567[Fix recommendations]
568
569---
570
571### 4.1.2 Name, Role, Value (Level A)
572
573**Result**: [PASS / FAIL / PARTIAL]
574
575**Evidence**:
576- Accessibility tree excerpt:
577 ```
578 [relevant search_elements output]
579 ```
580
581**Issues Found**:
582| Element | Role Issue | Name Issue | State Issue |
583|---------|------------|------------|-------------|
584| [element] | [issue] | [issue] | [issue] |
585
586**Recommendations**:
587[Fix recommendations]
588
589---
590
591## Issue Summary (by Severity)
592
593### Critical
594[List critical issues - prevent access entirely]
595
596### Serious
597[List serious issues - significant barriers]
598
599### Moderate
600[List moderate issues - degraded experience]
601
602### Minor
603[List minor issues - best practice violations]
604
605---
606
607## Next Steps
608
6091. Address Critical and Serious issues first
6102. Re-test after fixes using the same procedures
6113. Consider automated testing tools for ongoing monitoring (axe, WAVE, Lighthouse)
6124. Verify contrast issues with dedicated contrast checker tools
613
614---
615
616## Appendix: Screenshot Evidence
617
618[Screenshots will be attached when exporting via download_current_chat_report_zip]
619```
620
621---
622
623## Report Export
624
625After completing the audit report, ask the user:
626
627> "Would you like me to export this accessibility audit report as a ZIP file with all screenshots included?"
628
629Upon confirmation, use `download_current_chat_report_zip` tool to package the report with all captured screenshots.
630
631The ZIP will contain:
632- `report.md` — The full audit report with working image links
633- `screenshots/` — All captured screenshots from the session