accessibility-test-axe
Эксперт по a11y тестированию. Используй для axe-core, automated testing и accessibility audits.
Best use case
accessibility-test-axe is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Эксперт по a11y тестированию. Используй для axe-core, automated testing и accessibility audits.
Teams using accessibility-test-axe should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/accessibility-test-axe/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How accessibility-test-axe Compares
| Feature / Agent | accessibility-test-axe | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Эксперт по a11y тестированию. Используй для axe-core, automated testing и accessibility audits.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Axe-Core Accessibility Testing Expert
Эксперт по автоматизированному тестированию доступности с использованием axe-core — индустриального стандарта для проверки соответствия WCAG.
## Основная философия
Используйте **shift-left подход** — интегрируйте проверки доступности на ранних этапах разработки, а не после релиза. Комбинируйте автоматизированное сканирование axe-core с ручным тестированием.
## Настройка axe-core
### Установка
```bash
npm install axe-core @axe-core/playwright @axe-core/react
```
### Базовое использование в браузере
```javascript
import axe from 'axe-core';
async function runAccessibilityAudit(element = document) {
try {
const results = await axe.run(element, {
runOnly: {
type: 'tag',
values: ['wcag2a', 'wcag2aa', 'wcag21aa']
}
});
return {
violations: results.violations,
passes: results.passes,
incomplete: results.incomplete,
inapplicable: results.inapplicable
};
} catch (error) {
console.error('Accessibility audit failed:', error);
throw error;
}
}
```
## Интеграция с Playwright
```javascript
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
test.describe('Accessibility Tests', () => {
test('should not have accessibility violations', async ({ page }) => {
await page.goto('/');
const accessibilityScanResults = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21aa'])
.analyze();
expect(accessibilityScanResults.violations).toEqual([]);
});
test('specific component accessibility', async ({ page }) => {
await page.goto('/components/modal');
const results = await new AxeBuilder({ page })
.include('#modal-component')
.exclude('.decorative-element')
.analyze();
expect(results.violations).toEqual([]);
});
});
```
## Интеграция со Storybook
```javascript
// .storybook/test-runner.js
const { injectAxe, checkA11y } = require('axe-playwright');
module.exports = {
async preRender(page) {
await injectAxe(page);
},
async postRender(page) {
await checkA11y(page, '#storybook-root', {
detailedReport: true,
detailedReportOptions: {
html: true
}
});
}
};
```
## CI/CD интеграция (GitHub Actions)
```yaml
name: Accessibility Tests
on: [push, pull_request]
jobs:
a11y:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run accessibility tests
run: npm run test:a11y
- name: Upload results
if: failure()
uses: actions/upload-artifact@v3
with:
name: a11y-report
path: a11y-results.json
```
## Обработка результатов
```javascript
function processViolations(violations) {
const report = {
critical: [],
serious: [],
moderate: [],
minor: []
};
violations.forEach(violation => {
const issue = {
id: violation.id,
impact: violation.impact,
description: violation.description,
help: violation.help,
helpUrl: violation.helpUrl,
nodes: violation.nodes.map(node => ({
html: node.html,
target: node.target,
failureSummary: node.failureSummary
}))
};
report[violation.impact].push(issue);
});
return report;
}
```
## Конфигурация правил
```javascript
const axeConfig = {
rules: [
// Отключение правил для декоративных элементов
{ id: 'image-alt', enabled: true },
{ id: 'color-contrast', enabled: true },
{ id: 'label', enabled: true },
// Исключения для специфичных случаев
{
id: 'button-name',
selector: 'button:not(.icon-only)'
}
],
// Исключение областей
exclude: [
'.third-party-widget',
'#ads-container'
]
};
```
## React интеграция
```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import axe from '@axe-core/react';
if (process.env.NODE_ENV !== 'production') {
axe(React, ReactDOM, 1000);
}
// Компонент отчёта
function AccessibilityReport({ violations }) {
if (!violations.length) {
return <div className="a11y-pass">No accessibility violations found</div>;
}
return (
<div className="a11y-violations" role="alert">
<h2>Accessibility Issues Found: {violations.length}</h2>
<ul>
{violations.map(violation => (
<li key={violation.id}>
<strong>{violation.impact}</strong>: {violation.description}
<a href={violation.helpUrl} target="_blank" rel="noopener">
Learn more
</a>
</li>
))}
</ul>
</div>
);
}
```
## Типичные нарушения и исправления
### Недостаточный контраст цвета
```css
/* Плохо */
.text-light {
color: #999;
background: #fff;
}
/* Хорошо - соотношение 4.5:1 */
.text-light {
color: #767676;
background: #fff;
}
```
### Отсутствие label у формы
```html
<!-- Плохо -->
<input type="email" placeholder="Email">
<!-- Хорошо -->
<label for="email">Email</label>
<input type="email" id="email" placeholder="email@example.com">
```
### Кнопка без текста
```html
<!-- Плохо -->
<button><svg>...</svg></button>
<!-- Хорошо -->
<button aria-label="Close menu">
<svg aria-hidden="true">...</svg>
</button>
```
## Мониторинг и отчётность
```javascript
class AccessibilityMonitor {
constructor() {
this.history = [];
}
async audit(url) {
const results = await runAccessibilityAudit();
this.history.push({
timestamp: new Date().toISOString(),
url,
violationCount: results.violations.length,
violations: results.violations
});
return this.generateTrend();
}
generateTrend() {
const recent = this.history.slice(-10);
return {
current: recent[recent.length - 1]?.violationCount || 0,
trend: this.calculateTrend(recent),
history: recent
};
}
}
```
## Лучшие практики
1. **Интегрируйте в CI/CD** — блокируйте merge при critical нарушениях
2. **Тестируйте рано** — используйте в dev режиме React/Vue
3. **Комбинируйте методы** — автоматические тесты + ручное тестирование
4. **Документируйте исключения** — объясняйте почему правило отключено
5. **Отслеживайте тренды** — мониторьте количество нарушений во времениRelated Skills
add-unit-tests
Guide for adding unit tests to AReaL. Use when user wants to add tests for new functionality or increase test coverage.
add-test
Add unit tests for component or function: $ARGUMENTS
add-test-whatifwedigdeeper-application-tracker
Add unit tests for a component or function
add-test-coverage
Analyze recent changes and add test coverage for HEAD commit
add-backend-testing
Add backend integration testing with Vitest to an existing app. Sets up isolated test database schema and writes tests for tRPC routers.
adb-device-testing
Use when testing Android apps on ADB-connected devices/emulators - UI automation, screenshots, location spoofing, navigation, app management. Triggers on ADB, emulator, Android testing, location mock, UI test, screenshot walkthrough.
act-local-testing
Use when testing GitHub Actions workflows locally with act. Covers act CLI usage, Docker configuration, debugging workflows, and troubleshooting common issues when running workflows on your local machine.
accessibility
Build WCAG 2.1 AA compliant websites with semantic HTML, proper ARIA, focus management, and screen reader support. Includes color contrast (4.5:1 text), keyboard navigation, form labels, and live regions. Use when implementing accessible interfaces, fixing screen reader issues, keyboard navigation, or troubleshooting "focus outline missing", "aria-label required", "insufficient contrast".
accessibility-wcag
Build accessible web applications following WCAG 2.1/2.2 guidelines with proper semantic HTML, ARIA attributes, keyboard navigation, screen reader support, and inclusive design. Use when implementing ARIA labels and roles, ensuring keyboard navigation, supporting screen readers, providing text alternatives for images, managing focus, creating accessible forms, building inclusive UI components, testing with accessibility tools, meeting WCAG compliance levels, or designing for users with disabilities.
accessibility-validation
Validate digital outputs for compliance with accessibility standards (e.g., WCAG, Section 508). Use when reviewing reports, dashboards, documents, or interfaces from pilot projects to identify and remediate accessibility barriers.
accessibility-ux-audit
Audit and enhance accessibility and UX across all pages and components.
accessibility-testing
WCAG 2.2 compliance testing, screen reader validation, and inclusive design verification. Use when ensuring legal compliance (ADA, Section 508), testing for disabilities, or building accessible applications for 1 billion disabled users globally.