A11y validate

From softspark/ai-toolkit · View interactive version

A11y validate is an AI agent skill from the GitHub repository softspark/ai-toolkit. Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. Triggers: a11y, accessibility, WCAG, EAA, ARIA, contrast, keyboard, screen reader.

How to use this skill

Skill file

/a11y-validate — Accessibility & EAA Compliance Scanner

$ARGUMENTS

Scan a codebase for accessibility issues using pattern-matching heuristics. Detects violations of WCAG 2.1 Level AA, EN 301 549 (the EU harmonized accessibility standard), and the European Accessibility Act (Directive (EU) 2019/882, "EAA", in force since 28 June 2025). Read-only — never modifies files.

Complements /seo-validate (which only covers SEO-a11y overlap shallowly). Use this skill when the concern is legal accessibility compliance, not search engine ranking.

Standards basis:

Usage

/a11y-validate                                # Scan full project, auto-detect framework
/a11y-validate src/                           # Scan specific path
/a11y-validate --scope keyboard               # Only keyboard + focus checks
/a11y-validate --scope media                  # Only captions/transcripts/autoplay
/a11y-validate --scope docs                   # Only EAA accessibility-statement check
/a11y-validate --scope mobile                 # Only React Native + Flutter patterns
/a11y-validate --standard eaa                 # Activate EAA documentation category
/a11y-validate --standard wcag-2.2-aa         # Add WCAG 2.2 criteria
/a11y-validate --severity high                # Filter to HIGH findings
/a11y-validate --framework react-native       # Force framework
/a11y-validate --output json                  # Structured JSON for CI integration

Scopes:

Standards:

Severity filtering: --severity high shows only HIGH, --severity warn shows HIGH+WARN, --severity info shows all. Default: all.

What This Command Does

  1. Detect framework from package.json, pubspec.yaml, and entry HTML.
  2. Run the scanner script for a deterministic baseline over 13 WCAG success criteria.
  3. Extend the scan by hand using Grep / Glob / Read against framework-aware patterns for everything the script does not cover.
  4. Interpret findings with specific fixes tied to the detected framework.
  5. Report findings sorted by severity with WCAG / EN 301 549 citations.

Steps

Step 1: Detect Framework

Run detection before scanning. Same logic as /seo-validate plus mobile entries:

| Deps / files contain | Framework | Notes |

|---|---|---|

| next | next | App Router uses metadata export |

| nuxt | nuxt | useHead() / definePageMeta |

| astro | astro | islands model; client:only affects a11y |

| gatsby | gatsby | Head API + react-helmet |

| @sveltejs/kit | sveltekit | <svelte:head> |

| @remix-run/* | remix | MetaFunction |

| @angular/core | angular | CDK a11y module expected |

| vue (no nuxt) | vue | a11y plugins optional |

| react + vite (no next/remix) | react-spa | — |

| react-scripts | cra | — |

| react-native | react-native | mobile — AccessibilityInfo API |

| pubspec.yaml with Flutter SDK | flutter | mobile — Semantics() widget |

| no framework deps | static | raw HTML |

Also detect a11y libraries: @react-aria/*, @reach/*, @angular/cdk/a11y, vue-a11y, svelte-a11y, react-axe, axe-core. Their presence is INFO.

Step 2: Run the Scanner Script

python3 ${CLAUDE_SKILL_DIR}/scripts/a11y-scanner.py [path] [--severity high|warn|info|all] [--output json|text]

Deterministic regex checks over 13 WCAG success criteria — images, headings,

language, forms, keyboard, focus, colour contrast, media, ARIA and target size.

No framework awareness and no heuristics: what it reports is real, what it misses

is Step 3's job. Exit code is non-zero when HIGH findings exist.

Step 3: Extend the Scan by Hand

Read reference/scanner-categories.md in full,

then work every category in --scope with Grep + Read, skipping only the

success criteria Step 2 already reported. Patterns adapt to the detected framework.

The coverage table under Scanner Reference says which criteria

Step 2 handles per category. Everything else in the category is yours.

Step 4: Interpret and Enrich

For each finding:

  1. Read the flagged file/lines to confirm the match.
  2. Add a framework-specific fix (e.g., "use @react-aria/button" vs "add aria-label").
  3. Mark confidence — definitive for regex matches, heuristic for co-occurrence / absence / target-size estimation.
  4. Skip false positives when context shows the concern is addressed (e.g., aria-label set via intl translation key).

Step 5: Report

Present findings sorted by severity (HIGH → WARN → INFO), then file path.

State which findings came from the script and which from the manual pass — a reader

needs to know how much of the result is deterministic.


Scanner Reference

scripts/a11y-scanner.py gives a deterministic baseline over 13 WCAG success

criteria. Everything else in each category is a manual pass, and the full pattern

tables for it live in

reference/scanner-categories.md.

| # | Category | Covered by the script | Manual pass |

|---|----------|----------------------|-------------|

| 1 | Semantic Structure & Landmarks | 1.3.1, 3.1.1 | rest of the category |

| 2 | Text Alternatives & Non-Text Content | 1.1.1 | rest of the category |

| 3 | Keyboard & Focus | 2.1.1, 2.4.3, 2.4.7 | rest of the category |

| 4 | Color, Contrast & Visual Cues | 1.4.3 | rest of the category |

| 5 | Forms, Labels & Errors | 3.3.2 | rest of the category |

| 6 | Media (Audio, Video, Embeds) | 1.2.1, 1.2.2, 1.4.2 | rest of the category |

| 7 | ARIA, Live Regions & Dynamic Content | 4.1.2 | rest of the category |

| 8 | Motion, Target Size, Mobile & EAA Docs | 2.5.8 | rest of the category |

The script never covers a whole category. Treat its output as the floor, not the

result: a run that reports only script findings has skipped most of WCAG 2.1 AA.

Output Format

## Accessibility Validation Report

### Summary
| Metric | Value |
|--------|-------|
| Standard | wcag-2.1-aa / wcag-2.2-aa / en-301-549 / eaa |
| Scope | full / keyboard / contrast / forms / media / aria / motion / mobile / docs |
| Framework detected | next / nuxt / astro / ... / react-native / flutter / static |
| Files scanned | N |
| Public routes scanned | N |
| Accessibility statement | found / not-found |
| Findings: HIGH | N |
| Findings: WARN | N |
| Findings: INFO | N |

### Findings

#### [HIGH] src/components/VideoPlayer.tsx:42
Category: Media
Confidence: definitive
Pattern: `<video>` without `<track kind="captions">`
WCAG: 1.2.2 (Captions — Prerecorded, Level AA)
EAA: Article 4 (product/service accessibility requirements)
Fix: Add `<track kind="captions" src="/captions/en.vtt" srclang="en" label="English" default>`. If captions are unavailable, provide a transcript link.
See: reference/wcag-2-1-aa.md#guideline-12-time-based-media

#### [HIGH] public/index.html:8
Category: Viewport & Zoom
Confidence: definitive
Pattern: `<meta name="viewport" content="..., user-scalable=no">`
WCAG: 1.4.4 (Resize Text, Level AA)
Fix: Remove `user-scalable=no` and `maximum-scale=1` from the viewport meta — users must be able to zoom to 200%.
See: reference/wcag-2-1-aa.md#144-resize-text

#### [HIGH] src/routes.tsx:15
Category: EAA Accessibility Documentation
Confidence: heuristic
Pattern: No `/accessibility` / `/accessibility-statement` route detected; footer contains no a11y link
Standard: EAA Article 14 (mandatory accessibility statement)
Fix: Publish an accessibility statement conforming to your member-state template. Link it from the footer of every public page. See reference/eaa-compliance.md for template structure.

Confidence values:

Exit codes (when --output json):

Out of Scope (Static Analysis Cannot Detect)

The skill explicitly does NOT verify the following — pair with runtime tools:

For these, use: axe-core, pa11y, Lighthouse accessibility audit, manual assistive-tech testing, and user research with disabled participants.

Rules

Gotchas

When NOT to Use

Reference Documents

Related Skills

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.