/harness-claude:test-accessibility-testingfrom harness-claude
Automates WCAG accessibility checks using axe-core with Playwright and jest-axe. Includes keyboard navigation and ARIA testing patterns.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:test-accessibility-testing still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Automate WCAG accessibility checks using axe-core with Playwright and jest-axe
npm install -D @axe-core/playwright
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
test('homepage has no accessibility violations', async ({ page }) => {
await page.goto('/');
const results = await new AxeBuilder({ page }).analyze();
expect(results.violations).toEqual([]);
});
test('login form is accessible', async ({ page }) => {
await page.goto('/login');
const results = await new AxeBuilder({ page }).include('#login-form').analyze();
expect(results.violations).toEqual([]);
});
const results = await new AxeBuilder({ page })
.exclude('#legacy-widget') // Known issue, tracked in JIRA-123
.disableRules(['color-contrast']) // Temporarily disable specific rules
.analyze();
npm install -D jest-axe @types/jest-axe
import { render } from '@testing-library/react';
import { axe, toHaveNoViolations } from 'jest-axe';
expect.extend(toHaveNoViolations);
it('Button component has no a11y violations', async () => {
const { container } = render(
<Button onClick={() => {}}>Click me</Button>
);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
test('tab order follows visual layout', async ({ page }) => {
await page.goto('/form');
await page.keyboard.press('Tab');
await expect(page.getByLabel('Name')).toBeFocused();
await page.keyboard.press('Tab');
await expect(page.getByLabel('Email')).toBeFocused();
await page.keyboard.press('Tab');
await expect(page.getByRole('button', { name: 'Submit' })).toBeFocused();
});
test('dropdown opens with Enter and navigates with arrow keys', async ({ page }) => {
await page.goto('/select');
const select = page.getByRole('combobox', { name: 'Country' });
await select.focus();
await page.keyboard.press('Enter');
await expect(page.getByRole('listbox')).toBeVisible();
await page.keyboard.press('ArrowDown');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('Enter');
await expect(select).toHaveValue('Canada');
});
test('error messages are associated with inputs', async ({ page }) => {
await page.goto('/form');
// Submit empty form to trigger validation
await page.getByRole('button', { name: 'Submit' }).click();
const emailInput = page.getByLabel('Email');
const errorId = await emailInput.getAttribute('aria-describedby');
expect(errorId).toBeTruthy();
const errorMessage = page.locator(`#${errorId}`);
await expect(errorMessage).toHaveText('Email is required');
await expect(emailInput).toHaveAttribute('aria-invalid', 'true');
});
const pages = ['/', '/about', '/contact', '/products', '/login'];
for (const path of pages) {
test(`${path} has no a11y violations`, async ({ page }) => {
await page.goto(path);
const results = await new AxeBuilder({ page }).analyze();
expect(results.violations).toEqual([]);
});
}
Automated accessibility testing catches approximately 30-50% of WCAG violations. The remaining violations require manual testing (screen reader behavior, cognitive load, content clarity).
What axe-core catches:
What axe-core cannot catch:
WCAG conformance levels:
axe-core rule tags: Filter by conformance level with .withTags(['wcag2a', 'wcag2aa', 'best-practice']).
Trade-offs:
https://playwright.dev/docs/accessibility-testing
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job