You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: repair broken markdown and extract snippets in a11y-debugging skill (#1096)
## Summary
- Fix broken markdown fences in `skills/a11y-debugging/SKILL.md` — a
stray quadruple-backtick on line 72 broke the numbered list
continuation, and a mismatched fence on line 95 disrupted rendering
- Extract verbose JS snippets (orphaned inputs, tap targets, color
contrast, global checks) into `references/a11y-snippets.md`, keeping
SKILL.md scannable and following the same `references/` pattern used by
`debug-optimize-lcp`
## Test plan
- [x] Verify SKILL.md renders correctly in GitHub markdown preview (no
broken fences or orphaned code blocks)
- [x] Verify `references/a11y-snippets.md` renders correctly and all 4
snippets are present
- [x] Confirm the relative links from SKILL.md to
`references/a11y-snippets.md` resolve correctly on GitHub
Copy file name to clipboardExpand all lines: skills/a11y-debugging/SKILL.md
+5-84Lines changed: 5 additions & 84 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,26 +51,7 @@ The accessibility tree exposes the heading hierarchy and semantic landmarks.
51
51
52
52
1. Locate buttons, inputs, and images in the `take_snapshot` output.
53
53
2. Ensure interactive elements have an accessible name (e.g., a button should not just say `""`if it only contains an icon).
54
-
3. **Orphaned Inputs**: Verify that all form inputs have associated labels. Use `evaluate_script` to check for inputs missing `id` (for `label[for]`) or `aria-label`:
3. **Orphaned Inputs**: Verify that all form inputs have associated labels. Use `evaluate_script` with the **"Find Orphaned Form Inputs" snippet** found in [references/a11y-snippets.md](references/a11y-snippets.md).
74
55
4. Check images for`alt` text.
75
56
76
57
### 5. Focus & Keyboard Navigation
@@ -84,15 +65,7 @@ Testing "keyboard traps" and proper focus management without visual feedback rel
84
65
85
66
### 6. Tap Targets and Visuals
86
67
87
-
According to web.dev, tap targets should be at least 48x48 pixels with sufficient spacing. Since the accessibility tree doesn't show sizes, use `evaluate_script`:
88
-
89
-
```js
90
-
// Usage in console: copy, paste, and call with element: fn(element)
91
-
el => {
92
-
const rect = el.getBoundingClientRect();
93
-
return {width: rect.width, height: rect.height};
94
-
};
95
-
````
68
+
According to web.dev, tap targets should be at least 48x48 pixels with sufficient spacing. Since the accessibility tree doesn't show sizes, use `evaluate_script` with the **"Measure Tap Target Size" snippet** found in [references/a11y-snippets.md](references/a11y-snippets.md).
96
69
97
70
_Pass the element's `uid` from the snapshot as an argument to `evaluate_script`._
98
71
@@ -103,66 +76,14 @@ To verify color contrast ratios, start by checking for native accessibility issu
103
76
1. Call `list_console_messages` with `types: ["issue"]`.
104
77
2. Look for"Low Contrast" issuesin the output.
105
78
106
-
If native audits do not report issues (which may happen in some headless environments) or if you need to check a specific element manually, you can use the following script as a fallback approximation.
107
-
108
-
**Note**: This script uses a simplified algorithm and may not account for transparency, gradients, or background images. For production-grade auditing, consider injecting `axe-core`.
109
-
110
-
```js
111
-
el => {
112
-
functiongetRGB(colorStr) {
113
-
const match = colorStr.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
_Pass the element's `uid` to test the contrast against WCAG AA (4.5:1 for normal text, 3:1 for large text)._
79
+
If native audits do not report issues (which may happen in some headless environments) or if you need to check a specific element manually, use `evaluate_script` with the **"Check Color Contrast" snippet** found in [references/a11y-snippets.md](references/a11y-snippets.md).
144
80
145
81
### 8. Global Page Checks
146
82
147
-
Verify document-level accessibility settings often missed in component testing:
148
-
149
-
```js
150
-
() => ({
151
-
lang:
152
-
document.documentElement.lang ||
153
-
'MISSING - Screen readers need this for pronunciation',
154
-
title: document.title || 'MISSING - Required for context',
Verify document-level accessibility settings often missed in component testing using the **"Global Page Checks" snippet** found in [references/a11y-snippets.md](references/a11y-snippets.md).
163
84
164
85
## Troubleshooting
165
86
166
87
If standard a11y queries fail or the `evaluate_script` snippets return unexpected results:
167
88
168
-
-**Visual Inspection**: If automated scripts cannot determine contrast (e.g., text over gradient images or complex backgrounds), use `take_screenshot` to capture the element. While models cannot measure exact contrast ratios from images, they can visually assess legibility and identifying obvious issues.
89
+
- **Visual Inspection**: If automated scripts cannot determine contrast (e.g., text over gradient images or complex backgrounds), use `take_screenshot` to capture the element. While models cannot measure exact contrast ratios from images, they can visually assess legibility and identify obvious issues.
Returns the bounding box dimensions of an element. Pass the element's `uid` from the snapshot as an argument to `evaluate_script`.
29
+
30
+
```js
31
+
el=> {
32
+
constrect=el.getBoundingClientRect();
33
+
return {width:rect.width, height:rect.height};
34
+
};
35
+
```
36
+
37
+
## 3. Check Color Contrast
38
+
39
+
Approximates the contrast ratio between an element's text color and background color. Pass the element's `uid` to test against WCAG AA (4.5:1 for normal text, 3:1 for large text).
40
+
41
+
**Note**: This uses a simplified algorithm and may not account for transparency, gradients, or background images. For production-grade auditing, consider injecting `axe-core`.
0 commit comments