
A11y Debugging
Run ready-made accessibility checks in the live page via evaluate_script—orphaned inputs, tap targets, and contrast against WCAG AA thresholds.
Overview
a11y-debugging is an agent skill most often used in Ship (also Build, Launch) that runs in-page JavaScript snippets to find labeling gaps, small tap targets, and contrast issues via Chrome DevTools MCP.
Install
npx skills add https://github.com/chromedevtools/chrome-devtools-mcp --skill a11y-debuggingWhat is this skill?
- Three JavaScript snippets designed for evaluate_script in Chrome DevTools MCP
- Finds form inputs missing label, aria-label, aria-labelledby, or wrapping label
- Measures element bounding box width and height for tap target sizing
- Approximates text/background contrast ratio against WCAG AA (4.5:1 normal, 3:1 large)
- Notes axe-core for production-grade audits when simplified contrast is insufficient
- Three accessibility debugging snippets for evaluate_script
- WCAG AA thresholds cited: 4.5:1 normal text and 3:1 large text
Adoption & trust: 947 installs on skills.sh; 43.1k GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+200% hot-view momentum).
What problem does it solve?
You are about to ship a UI and need quick, page-real accessibility signals beyond static component linting.
Who is it for?
Solo builders validating forms, mobile tap targets, and contrast on real pages before release or ASO screenshots.
Skip if: Full legal compliance audits, native app VoiceOver-only testing, or teams that already run continuous axe-core in CI with no gap.
When should I use this skill?
You need to debug accessibility on a loaded page using Chrome DevTools MCP evaluate_script snippets.
What do I get? / Deliverables
You get structured findings from three evaluate_script checks and guidance to escalate to axe-core when contrast or complexity demands it.
- Lists of unlabeled form controls
- Tap target width/height measurements
- Approximate contrast ratio results against AA thresholds
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Accessibility debugging belongs on ship review as a pre-release quality gate for customer-facing UIs. Review subphase matches manual and scripted audits before you sign off on forms, touch targets, and readable contrast.
Where it fits
Audit signup fields for missing labels before merging the release branch.
Verify mobile nav buttons meet minimum touch dimensions on a preview build.
Check marketing page contrast on hero text before publishing for broader discoverability.
How it compares
Use for live-DOM spot checks via MCP evaluate_script instead of relying only on source-level accessibility rules.
Common Questions / FAQ
Who is a11y-debugging for?
Indie frontend builders using Chrome DevTools MCP who need fast labeling, target-size, and contrast diagnostics on deployed or preview URLs.
When should I use a11y-debugging?
During ship review on staging; during build when fixing forms; during launch when polishing landing or signup pages for broader reach and SEO-adjacent quality.
Is a11y-debugging safe to install?
Review the Security Audits panel on this page; snippets only read DOM state but run in your browser context—use trusted pages and sessions.
SKILL.md
READMESKILL.md - A11y Debugging
# Accessibility Debugging Snippets Use these JavaScript snippets with the `evaluate_script` tool. ## 1. Find Orphaned Form Inputs Finds form inputs that lack an associated label (no `label[for]`, `aria-label`, `aria-labelledby`, or wrapping `<label>`). ```js () => Array.from(document.querySelectorAll('input, select, textarea')) .filter(i => { const hasId = i.id && document.querySelector(`label[for="${i.id}"]`); const hasAria = i.getAttribute('aria-label') || i.getAttribute('aria-labelledby'); return !hasId && !hasAria && !i.closest('label'); }) .map(i => ({ tag: i.tagName, id: i.id, name: i.name, placeholder: i.placeholder, })); ``` ## 2. Measure Tap Target Size Returns the bounding box dimensions of an element. Pass the element's `uid` from the snapshot as an argument to `evaluate_script`. ```js el => { const rect = el.getBoundingClientRect(); return {width: rect.width, height: rect.height}; }; ``` ## 3. Check Color Contrast 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). **Note**: This uses a simplified algorithm and may not account for transparency, gradients, or background images. For production-grade auditing, consider injecting `axe-core`. ```js el => { function getRGB(colorStr) { const match = colorStr.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/); return match ? [parseInt(match[1]), parseInt(match[2]), parseInt(match[3])] : [255, 255, 255]; } function luminance(r, g, b) { const a = [r, g, b].map(function (v) { v /= 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); }); return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722; } const style = window.getComputedStyle(el); const fg = getRGB(style.color); let bg = getRGB(style.backgroundColor); const l1 = luminance(fg[0], fg[1], fg[2]); const l2 = luminance(bg[0], bg[1], bg[2]); const ratio = (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05); return { color: style.color, bg: style.backgroundColor, contrastRatio: ratio.toFixed(2), }; }; ``` ## 4. Global Page Checks Checks document-level accessibility settings often missed in component testing. ```js () => ({ lang: document.documentElement.lang || 'MISSING - Screen readers need this for pronunciation', title: document.title || 'MISSING - Required for context', viewport: document.querySelector('meta[name="viewport"]')?.content || 'MISSING - Check for user-scalable=no (bad practice)', reducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'Enabled' : 'Disabled', }); ``` --- name: a11y-debugging description: Uses Chrome DevTools MCP for accessibility (a11y) debugging and auditing based on web.dev guidelines. Use when testing semantic HTML, ARIA labels, focus states, keyboard navigation, tap targets, and color contrast. --- ## Core Concepts **Accessibility Tree vs DOM**: Visually hiding an element (e.g., `CSS opacity: 0`) behaves differently for screen readers than `display: none` or `aria-hidden="true"`. The `take_snapshot` tool returns the accessibility tree of the page, which represents what assistive technologies "see", making it the most reliable source of truth for semantic structure. **Reading web.dev documentation**: If you need to research specific accessibility guidelines (like `https://web.dev/articles/accessible-tap-targets`), you can append `.md.txt` to the URL (e.g., `https://web.dev/articles/accessible-tap-targets.md.txt`) to fetch the clean, raw markdown version. This is much easier to read! ## Workflow Patterns ### 1. Automated Audit (Lighthouse) Start by running a Lighthouse accessibility audit to get a comprehensive baseline. This tool provides a high-level score and lists specific failing elements with remediation advice. 1. Run th