/pf-a11y:pf-a11y-test-genfrom pf-a11y
Generates accessibility test files for any frontend framework, covering ARIA attributes, keyboard interaction, and focus management. Detects framework, test library, and project conventions automatically.
Ships in pf-a11y. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate dedicated accessibility test files for UI components. Framework-agnostic — works with any frontend setup. Produces persistent test artifacts that run in CI. Complements pf-test-gen (general unit tests), pf-a11y-audit (static code analysis), and pf-a11y-keyboard (live browser testing).
| Source | Required | Description |
|---|---|---|
| Component/module file | Yes | Path to the component or UI module to generate a11y tests for |
| Focus area | No | Specific a11y category to prioritize: aria, keyboard, focus, or axe |
Read the component source before generating tests.
Determine the frontend framework from the component source and project dependencies. The framework determines the test rendering approach. If it cannot be determined, ask the user.
Determine if the codebase is a PatternFly org repo or a consumer/standalone project.
PatternFly developer (signals: @patternfly in package name, packages/ with PF component source, patternfly GitHub org) — test that ARIA attributes are correctly wired to component props, components expose the right a11y API surface, and default accessible names are sensible.
Consumer/standalone — test that accessible names are explicitly provided, multiple instances have unique labels, and live regions are used for dynamic content.
Scan the nearest package.json for testing libraries in devDependencies and dependencies. Look for unit/component testing libraries, test runners, integration/E2E libraries (Cypress, Playwright), and axe-core integrations. Also check for test runner config files.
Find existing test files near the component. Analyze file naming, test structure, a11y test organization (separate files vs. inline describe blocks), query patterns, and setup conventions. Mirror all detected conventions in generated tests.
Load $CLAUDE_SKILL_DIR/references/test-library-matrix.md and apply its decision rules to assign a11y test categories to detected libraries.
If only one library is available, all applicable tests go to that library with coverage limitations noted in the gap report.
Load sibling reference files from $CLAUDE_SKILL_DIR selectively based on what the component needs:
../pf-a11y-audit/references/aria-attributes.md — ARIA attribute reference (always load)../pf-a11y-audit/references/pf-gotchas.md — PF-specific pitfalls (always load)../pf-a11y-keyboard/references/keyboard-criteria.md — keyboard criteria (load when interactive elements detected)../pf-a11y-keyboard/references/component-specifics.md — component-specific keyboard behaviors (load only when matching components found)Load $CLAUDE_SKILL_DIR/references/a11y-test-patterns.md for canonical test code patterns.
Cross-reference aria-attributes.md. Test that semantic roles are correct, interactive elements have accessible names, state attributes (aria-expanded, aria-selected, aria-checked, aria-pressed) have correct values and toggle on interaction, required/invalid states are set on form fields, relationship attributes point to existing IDs, decorative elements are hidden, and live regions are used for dynamic content.
Cross-reference keyboard-criteria.md. Test activation keys per role (Enter/Space for buttons, Enter for links, Space for checkboxes), tab order, Escape to close, and arrow key navigation in menus/tabs/trees/grids. Apply component-specific behaviors from component-specifics.md when matching components are found.
Cross-reference keyboard-criteria.md Criteria 6, 7, and 8. Test focus shift on open, focus return on close, focus trapping within modals, and focus bridging for portaled content. When generating unit tests only (no Cypress/Playwright), note in the gap report that focus trap testing is partial.
Render the component in multiple states (default + at least one interactive/error state) and run axe scans. Only disable axe rules for documented false positives.
aria-hidden="true" as issues (verify they ARE hidden)Do NOT generate test files that would fail to run. Recommend appropriate testing libraries for the detected framework, provide the install command, and output the test file content marked as requiring installation first.
Follow detected repo convention:
.a11y.test infix and the appropriate file extension.When generating for multiple libraries, output each file separately with a clear header.
After the test file(s), output a coverage gap report listing what was generated (category, library, count) and what was NOT covered (gap, reason, recommended action). Include recommendations for missing test libraries or component-specific notes.
pf-test-gen — General unit tests (rendering, interactions, props, async)pf-a11y-audit — Static code analysis for WCAG/ARIA violationspf-a11y-keyboard — Live browser keyboard accessibility testingeval/cases/convention-following/ActionMenu.test.tsx (opens in a new tab)eval/cases/convention-following/ActionMenu.tsx (opens in a new tab)eval/cases/convention-following/annotations.yaml (opens in a new tab)eval/cases/convention-following/input.yaml (opens in a new tab)eval/cases/convention-following/package.json (opens in a new tab)eval/cases/jest-axe-available/LoginForm.tsx (opens in a new tab)eval/cases/jest-axe-available/annotations.yaml (opens in a new tab)eval/cases/jest-axe-available/input.yaml (opens in a new tab)eval/cases/jest-axe-available/package.json (opens in a new tab)eval/cases/multi-library-modal/ConfirmationModal.tsx (opens in a new tab)eval/cases/multi-library-modal/annotations.yaml (opens in a new tab)eval/cases/multi-library-modal/input.yaml (opens in a new tab)eval/cases/multi-library-modal/package.json (opens in a new tab)eval/cases/no-test-library/StatusBanner.tsx (opens in a new tab)eval/cases/no-test-library/annotations.yaml (opens in a new tab)eval/cases/no-test-library/input.yaml (opens in a new tab)eval/cases/no-test-library/package.json (opens in a new tab)eval/cases/rtl-only-aria/ExpandablePanel.tsx (opens in a new tab)eval/cases/rtl-only-aria/annotations.yaml (opens in a new tab)eval/cases/rtl-only-aria/input.yaml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rh-uxd/ai-helpers --plugin pf-a11y3 skills in this plugin
/pf-a11y-auditAudit PatternFly components and pages against WCAG and ARIA best practices. Use when reviewing accessibility, fixing screen reader issues, or validating ARIA usage in PatternFly-based applications./pf-a11y-keyboardTest keyboard accessibility of PatternFly UIs via live browser interaction. Use when validating keyboard navigation, focus management, or interaction patterns in a running application.Other plugins' skills for the same job