Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

axe-a11y

БесплатноБез исполняемых скриптовНе проверен

Use for any request to check accessibility automatically, including adding a scan to an existing Playwright, Cypress or unit test, or stopping missing labels…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

axe-a11y

Overview

axe-core is "an accessibility testing engine for websites and other HTML-based user interfaces" maintained by Deque (axe-core). It identifies approximately 57% of WCAG issues automatically and flags items requiring human review as "incomplete" (axe-core).

The integration shape: load the engine into a page (via test fixture, browser extension, or framework adapter), call axe.run(), and parse the violations[] array.

When to use

  • The project ships JavaScript / TypeScript UI tests (Playwright / Cypress / Jest / Vitest).
  • Automated a11y coverage on every PR is a goal.
  • The team values WCAG SC tagging - axe rules map cleanly to WCAG 2.0 / 2.1 / 2.2 SCs.
  • Pair with a11y-violation-gate for the ratchet pattern over baseline.

If axe-core's direct integration doesn't fit, route to the other scanners below.

Other scanners

axe-core is the primary engine; four alternatives live in references/, each with verified install / CLI / API / CI patterns:

Scanner Reach for it when Reference
pa11y (htmlcs + axe engines) Scriptable CLI scans without a test framework; multi-URL batching via pa11y-ci. references/pa11y.md
Lighthouse a11y The project already runs Lighthouse CI and wants a11y in the same pipeline. references/lighthouse-a11y.md
WAVE WebAIM-branded reports, visual overlay for designers, or third-party-site audits. references/wave.md
IBM Equal Access US Section 508 procurement or IBM-branded enterprise compliance. references/ibm-equal-access.md

All five emit JSON that a11y-violation-gate normalizes and ratchets.

Install

npm install --save-dev axe-core

(Per axe-core.)

For framework integration (preferred over raw axe.run()):

Package When to use
@axe-core/playwright Playwright tests.
@axe-core/react React-component scans during rendering.
@axe-core/cli Headless CLI for arbitrary URLs.
axe-core/api/install (raw) Custom integrations.

Authoring scans

Raw axe.run() API

import axe from 'axe-core';

axe.run()
  .then(results => {
    if (results.violations.length) {
      console.error('a11y violations:', results.violations);
    }
  })
  .catch(err => {
    console.error('axe error:', err.message);
  });

(Adapted from axe-core.)

For test environments where loading axe via <script> is easier:

<script src="node_modules/axe-core/axe.min.js"></script>

Playwright integration

import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';

test('checkout page passes axe scan', async ({ page }) => {
  await page.goto('/checkout');

  const accessibilityScanResults = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa'])   // WCAG 2.2 A + AA
    .analyze();

  expect(accessibilityScanResults.violations).toEqual([]);
});

Traps that silently shrink a scan

A green axe test can mean "axe looked at less than you think". Check these before trusting one.

AxeBuilder calls overwrite each other (from the @axe-core/playwright source):

  • withTags() and withRules() both set runOnly; the last call wins, so .withTags([...]).withRules(['region']) runs only region.
  • disableRules() starts a fresh rules map on every call, so calling it in a loop keeps only the last rule disabled.
  • options(obj) replaces the whole options object, wiping every withTags, withRules and disableRules call made before it.

To scan a tag set plus extra rules minus skipped ones, build one options object. Per the axe API, "By combining runOnly with type: tags and the rules option, a modified set can be defined":

const results = await new AxeBuilder({ page })
  .options({
    runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa', 'wcag22aa'] },
    rules: {
      region: { enabled: true },             // best-practice rules added on top
      'frame-tested': { enabled: true },
      'color-contrast': { enabled: false },  // skipped: reason + review date
    },
  })
  .analyze();

Guard the helper itself:

Полный SKILL.md на GitHub

Установить axe-a11y в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonevals/axe-builder-chain-order/criteria.jsonevals/axe-builder-chain-order/task.mdevals/axe-iframe-review-report/criteria.jsonevals/axe-iframe-review-report/task.mdevals/axe-incomplete-states/criteria.jsonevals/axe-incomplete-states/task.mdevals/axe-tags-impact/criteria.jsonevals/axe-tags-impact/task.mdevals/cypress-axe/criteria.jsonevals/cypress-axe/task.mdevals/dialog-fix-signed-off-by-a-green-run/criteria.jsonevals/dialog-fix-signed-off-by-a-green-run/task.mdevals/pr-bot-has-said-no-issues-for-four-months/criteria.jsonevals/pr-bot-has-said-no-issues-for-four-months/task.mdevals/three-scanners-one-number-for-the-board/criteria.jsonevals/three-scanners-one-number-for-the-board/task.mdevals/two-symptoms-since-we-added-accessibility/criteria.jsonevals/two-symptoms-since-we-added-accessibility/task.mdevals/zero-tolerance-announced-for-monday/criteria.jsonevals/zero-tolerance-announced-for-monday/task.mdreferences/ibm-equal-access.mdreferences/lighthouse-a11y.mdreferences/pa11y.mdreferences/results-and-config.mdreferences/wave.md

FAQ

Что делает скилл axe-a11y?

Use for any request to check accessibility automatically, including adding a scan to an existing Playwright, Cypress or unit test, or stopping missing labels and contrast errors from shipping: axe-core via axe.run(), @axe-core/playwright or the CLI on every PR, rule configuration and CI-gateable results, plus pa11y, Lighthouse CI, WAVE and IBM Equal Access in its references.

Как установить скилл axe-a11y?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл axe-a11y запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить axe-a11y с