agentleFS
catesandrewcatesandrew/skills/skills/chrome-inspect-a11y/SKILL.md

chrome-inspect-a11y

Skill1 starsChanged 6 days agoMITView on GitHub

Use when you need a live accessibility snapshot of a running page or specific element via Chrome DevTools MCP — checks roles, names, relationships, keyboard focus, and contrast.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If filePath is omitted, auto-name: ./tmp/a11y-<sanitized-scope>.png

    line 20
  2. Very specific:

    If ${input:scope} is a selector: find uid for the element.

    line 32
  3. Very specific:

    If page: work at the document root.

    line 33
  4. Very specific:

    If not, does it have tabindex="0"?

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

chrome-inspect-a11y

DOM snapshot + targeted evaluation to produce a focused accessibility report for a page or element. Use for live runtime a11y checks (for static source-code review, use audit-a11y-code).

Requires: Chrome DevTools MCP server running and connected.

Inputs

VariableDescriptionExample
${input:scope}Target scopepage or a selector like #save-button, .modal
${input:filePath}Screenshot save path (optional)/tmp/a11y-modal.png

If filePath is omitted, auto-name: ./tmp/a11y-<sanitized-scope>.png

sanitize(x): lowercase; keep a–z 0–9 - _; replace other chars with -.

Procedure

1. Snapshot

mcp__chrome__take_snapshot: { "includeAccessibility": true, "includeAttributes": true, "includeFrames": true }

2. Resolve target

  • If ${input:scope} is a selector: find uid for the element.
  • If page: work at the document root.

3. Collect a11y data via mcp__chrome__evaluate_script

Role, name, relationships:

(() => {
  const el = /* resolved element or document.body */;
  return {
    role: el.getAttribute('role') || el.tagName.toLowerCase(),
    ariaLabel: el.getAttribute('aria-label'),
    labelledby: el.getAttribute('aria-labelledby'),
    describedby: el.getAttribute('aria-describedby'),
    ariaModal: el.getAttribute('aria-modal'),
    ariaRequired: el.getAttribute('aria-required'),
    ariaExpanded: el.getAttribute('aria-expanded'),
    ariaDisabled: el.getAttribute('aria-disabled'),
    tabIndex: el.tabIndex,
    focusable: el.matches('a,button,input,select,textarea,[tabindex]'),
  };
})()

Contrast check (text elements):

(() => {
  const s = getComputedStyle(element);
  return { color: s.color, background: s.backgroundColor, fontSize: s.fontSize };
})()

Flag if color vs background contrast appears below 4.5:1 (WCAG AA for normal text) or 3:1 (large text ≥18pt / 14pt bold). This is a best-effort approximation from computed values.

Dialog/modal check (when scope is a dialog):

(() => ({
  role: element.getAttribute('role'),
  ariaModal: element.getAttribute('aria-modal'),
  labelledby: element.getAttribute('aria-labelledby'),
  labelText: document.getElementById(element.getAttribute('aria-labelledby'))?.textContent?.trim(),
}))()

4. Keyboard checks (static inference)

  • Is the element naturally focusable? (a, button, input, select, textarea)
  • If not, does it have tabindex="0"?
  • Does it have tabindex="-1" (programmatically focusable only)?
  • Note any missing keyboard attributes.

5. Screenshot to filePath

Resolve to absolute path, create parent dirs, call mcp__chrome__take_screenshot.

Output Format

♿ Accessibility Summary

  • Scope: ${input:scope}
  • role / name / labelledby / describedby / aria-modal / focusable / tabIndex

⚠️ Issues

Bullet list — missing label, dialog lacks aria-modal, insufficient contrast, non-focusable interactive element, etc. Include WCAG criterion reference where applicable (e.g., WCAG 2.1 SC 1.4.3, 4.1.2).

✅ Passes

Elements/attributes that are correctly implemented.

🖼 Screenshot

Saved: <absolute path>

WCAG Quick Reference

CheckThreshold
Normal text contrast≥ 4.5:1
Large text (≥18pt or 14pt bold)≥ 3:1
Focus visibleMust be visible
Interactive elementMust have accessible name
DialogNeeds role="dialog", aria-modal="true", aria-labelledby
Required fieldaria-required="true" + visible indicator

Common Mistakes

  • Not using includeFrames: true — misses elements in iframes (Storybook, embedded widgets).
  • Checking wrapper instead of native control — role/tabIndex on the wrapper may differ from the inner <input>.
  • Contrast approximation only — computed color values may not account for opacity layering; use a dedicated contrast tool for final verification.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.