Skill

From diegopacheco/ai-playground · View interactive version

Skill is an AI agent skill from the GitHub repository diegopacheco/ai-playground. Audits a running web page for WCAG accessibility issues, captures a screenshot and annotates it with a numbered box over every problem, then renders a self-contained light-theme website with the score, the annotated screenshot, and a fix for each finding. Use when the user runs /accessibility-audito

How to use this skill

Skill file

Accessibility Auditor

When invoked, you load a real web page in a headless Chromium, run a set of WCAG 2.1 AA checks against the live DOM and computed styles, take a full-page screenshot, and produce a light-theme report that overlays a numbered box on the screenshot for every issue and lists the fix for each. Every finding is read from the running page — nothing is estimated.

Global Context

What it checks

Images without alt (1.1.1), form controls with no label (4.1.2), buttons and links with no accessible name (4.1.2), text below the AA contrast minimum (1.4.3), heading levels that skip (1.3.1), missing <main> landmark (1.3.1), missing page lang (3.1.1), empty document title (2.4.2), missing <h1> (2.4.6), positive tabindex (2.4.3), role="button" that is not keyboard focusable (2.1.1), vague link text (2.4.4), and duplicate ids (4.1.1).

Rules

Step 1 — Decide the target URL

Read $ARGUMENTS:

Step 2 — Start the project if you only have a path

If you do not already have a running URL, start the project's dev server in the background and wait for it to answer:

cd <project> && (npm run dev >/tmp/a11y-dev.log 2>&1 &) ; for i in $(seq 1 60); do curl -sf http://localhost:5188 >/dev/null && break; sleep 1; done

Read the project's vite.config/package.json for the real port if it is not 5188. If dependencies are missing, run npm --prefix <project> install first.

Step 3 — Run the audit engine

Invoke the engine by its installed absolute path. It writes a11y-report/ into the current working directory:

node "$HOME/.claude/skills/accessibility-auditor/scripts/audit.mjs" <url> a11y-report

The engine loads the page, runs the checks, scores the page 0-100 (A–F), captures the screenshot, computes each issue's box as a percentage of the image, and writes the report. It prints a summary to stdout. If the page cannot be loaded it says so — relay that instead of producing an empty report.

Step 4 — Report back

Relay the stdout summary in your own words: the score and grade, how many issues by severity, and the worst offenders by WCAG criterion. Name the highest-impact fixes (missing alt text, unlabeled inputs, low contrast). Point the user at the site:

a11y-report/index.html

Offer to open it. The page is self-contained — a score gauge and grade, severity cards, the annotated screenshot with a clickable numbered box per issue, a by-principle breakdown (Perceivable / Operable / Understandable / Robust), and a filterable card per finding with its WCAG criterion, the element selector and snippet, and the fix. No server or network needed.

What the numbers mean

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.