AgentSkillsCN

a11y-axe

通过浏览器注入使用axe-core进行无障碍性审计

SKILL.md
--- frontmatter
name: a11y-axe
description: "Accessibility audit with axe-core via browser injection"

Accessibility Audit (axe-core)

Use the bash tool with npx to run accessibility audits.

Setup

Node.js (required for npx):

  • macOS: brew install node
  • Ubuntu: sudo apt install nodejs npm

Use npx @axe-core/cli (no global install needed), or npm install -g @axe-core/cli for global install.

Quick Audit

bash
npx @axe-core/cli <URL> --stdout 2>/dev/null | head -100

With Specific Rules

bash
npx @axe-core/cli <URL> --tags wcag2a,wcag2aa --stdout 2>/dev/null

Specific Element

bash
npx @axe-core/cli <URL> --include "#main-content" --stdout 2>/dev/null

WCAG Levels

TagStandard
wcag2aWCAG 2.0 Level A
wcag2aaWCAG 2.0 Level AA
wcag21aWCAG 2.1 Level A
wcag21aaWCAG 2.1 Level AA
best-practiceBest practices

Tips

  • Focus on critical and serious violations first
  • Use --include to scope audit to specific sections
  • Run against localhost dev server for fastest results
  • Combine with color-contrast skill for detailed contrast checks