con un clic
frontend-accessibility-validator
// Validate WCAG 2.2 compliance (A/AA/AAA) with ARIA, color contrast, keyboard navigation, screen readers, and automated testing via axe-core/Pa11y.
// Validate WCAG 2.2 compliance (A/AA/AAA) with ARIA, color contrast, keyboard navigation, screen readers, and automated testing via axe-core/Pa11y.
| name | Frontend Accessibility Validator |
| slug | frontend-accessibility-validator |
| description | Validate WCAG 2.2 compliance (A/AA/AAA) with ARIA, color contrast, keyboard navigation, screen readers, and automated testing via axe-core/Pa11y. |
| capabilities | ["WCAG 2.2 compliance validation (Level A, AA, AAA with 9 new success criteria)","ARIA attributes and roles verification (landmarks, widgets, live regions)","Color contrast analysis (4.5:1 for AA, 7:1 for AAA)","Keyboard navigation testing (focus management, skip links, tab order)","Screen reader compatibility (NVDA, JAWS, VoiceOver, ORCA)","Semantic HTML validation (proper heading hierarchy, form labels)","Focus indicator visibility and contrast (WCAG 2.4.11, 2.4.13)","Automated testing integration (axe-core, Pa11y, Lighthouse)","Alternative text and image accessibility","Form accessibility (labels, fieldsets, error messages, autocomplete)",{"Touch target sizing (WCAG 2.5.8":"24×24 CSS pixels minimum)"},"Accessible authentication (WCAG 3.3.7, 3.3.8)"] |
| inputs | {"web_pages":{"type":"array","description":"URLs or HTML files to validate","required":true},"wcag_level":{"type":"string","description":"Target WCAG level (A, AA, AAA)","required":false},"automated_tools":{"type":"array","description":"Tools to use (axe-core, Pa11y, Lighthouse)","required":false},"manual_checks":{"type":"boolean","description":"Include manual testing checklist","required":false},"screen_readers":{"type":"array","description":"Screen readers to test (NVDA, JAWS, VoiceOver)","required":false}} |
| outputs | {"wcag_compliance_report":{"type":"object","description":"WCAG 2.2 compliance status by success criterion"},"violations":{"type":"array","description":"List of accessibility violations with severity and remediation"},"automated_test_results":{"type":"object","description":"Results from axe-core, Pa11y, Lighthouse (% of issues detected)"},"manual_test_checklist":{"type":"array","description":"Manual testing items (keyboard nav, screen reader, contrast)"},"aria_issues":{"type":"array","description":"ARIA attribute and role violations"},"color_contrast_report":{"type":"object","description":"Contrast ratios for text, focus indicators, UI components"}} |
| keywords | ["accessibility","a11y","wcag","wcag-2.2","aria","screen-reader","keyboard-navigation","color-contrast","semantic-html","axe-core","pa11y","lighthouse","ada-compliance","section-508"] |
| version | 1.0.0 |
| owner | cognitive-toolworks |
| license | Apache-2.0 |
| security | {"secrets":"N/A","compliance":"WCAG 2.2 (Oct 2023), ADA, Section 508, ARIA 1.3, EN 301 549"} |
| links | [{"title":"WCAG 2.2 - What's New","url":"https://www.w3.org/WAI/standards-guidelines/wcag/new-in-22/","accessed":"2025-10-26"},{"title":"ARIA 1.3 Specification","url":"https://w3c.github.io/aria/","accessed":"2025-10-26"},{"title":"axe-core GitHub","url":"https://github.com/dequelabs/axe-core","accessed":"2025-10-26"},{"title":"Pa11y Documentation","url":"https://pa11y.org/","accessed":"2025-10-26"},{"title":"WebAIM: Contrast and Color Accessibility","url":"https://webaim.org/articles/contrast/","accessed":"2025-10-26"}] |
Purpose: Validate web application accessibility against WCAG 2.2 standards (released October 2023) using automated testing (axe-core, Pa11y, Lighthouse) and manual verification for keyboard navigation, screen reader compatibility, color contrast (4.5:1 for AA, 7:1 for AAA), ARIA attributes, semantic HTML, and the 9 new WCAG 2.2 success criteria (focus visibility, target sizing, accessible authentication, redundant entry).
When to Use:
Complements:
frontend-designsystem-validator: Validates design tokens, component consistency; this validates runtime accessibility.testing-accessibility-automation: Integrates axe-core/Pa11y into CI/CD; this provides audit reports and recommendations.frontend-performance-optimizer: Validates Core Web Vitals; this validates a11y (both are Lighthouse metrics).Mandatory Inputs:
web_pages: At least one URL or HTML file to validate.Validation Steps:
Goal: Run automated accessibility testing on a single page using axe-core to detect ~57% of issues with zero false positives.
Steps:
npx axe-core <URL>
# Or use browser extension: Axe DevTools in Chrome/Firefox
Token Budget: ≤2k tokens (single page, automated scan only).
Goal: Validate multiple pages against WCAG 2.2 Level AA with automated testing (axe-core + Pa11y) and manual checks for keyboard navigation, screen reader, and new WCAG 2.2 criteria.
Steps:
npx @axe-core/cli <URL> (57% detection, zero false positives).npx pa11y <URL> (uses axe-core or HTML_CodeSniffer engine).lighthouse <URL> --only-categories=accessibility (uses axe-core, provides 0-100 score).outline: 0), ≥3:1 contrast, size adequate.<main>, <nav>, <aside>, <header>, <footer> or role="main", role="navigation".role="button", role="tab", role="dialog" with required states (aria-expanded, aria-selected).aria-live="polite" for status messages, aria-live="assertive" for errors.aria-label or aria-labelledby for all interactive elements without visible labels.<button> instead of <div role="button">).<input>, <textarea>, <select> has <label for="id"> or aria-label.<img> have alt attribute (empty alt="" for decorative images).<th scope="col|row"> for data tables, <caption> for table description.Token Budget: ≤6k tokens (multi-page, multi-tool, manual checks, WCAG 2.2 new criteria).
Goal: Perform a full enterprise accessibility audit across multiple pages/templates with automated testing in CI/CD, manual testing across screen readers/browsers, and a prioritized remediation roadmap.
Steps:
import { axe, toHaveNoViolations } from 'jest-axe';
expect.extend(toHaveNoViolations);
it('should have no accessibility violations', async () => {
const { container } = render(<MyComponent />);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
{
"urls": ["http://localhost:3000", "http://localhost:3000/products"],
"defaults": {"timeout": 5000, "wait": 500, "runners": ["axe"]},
"threshold": 0
}
lhci autorun --collect.url=http://localhost:3000 --assert.assertions.accessibility=0.95
aria-expanded toggles, focus management.role="tablist", aria-selected, arrow key navigation.aria-live for auto-advance, pause button, keyboard nav.aria-sort, aria-rowcount, aria-colcount for virtualized tables.aria-live="polite", auto-dismiss with manual dismiss option.<label for> or aria-labelledby, not placeholder-only.<fieldset> + <legend> for radio/checkbox groups.aria-invalid="true", aria-describedby linking to error, inline + summary.required attribute + aria-required="true" + visual indicator (not color only).autocomplete attributes for user data (name, email, address).aria-describedby on Safari").Token Budget: ≤12k tokens (enterprise audit, CI/CD setup, full manual testing, remediation roadmap).
Ambiguity Resolution:
wcag_level not specified:
automated_tools not specified:
manual_checks not specified:
aria-label conflicts with visible text:
Stop Conditions:
Thresholds:
Required Fields:
{
wcag_compliance_report: {
level: "A" | "AA" | "AAA";
overall_status: "pass" | "fail" | "needs_review";
success_criteria: Array<{
id: string; // 1.1.1, 2.4.11, 3.3.7, etc.
name: string; // Non-text Content, Focus Not Obscured, Redundant Entry
level: "A" | "AA" | "AAA";
status: "pass" | "fail" | "not_applicable" | "needs_review";
automated: boolean; // True if automated tools can detect
evidence: string; // "axe-core passed", "Manual test: keyboard nav OK"
new_in_22: boolean; // True for 9 new WCAG 2.2 criteria
}>;
compliance_percentage: {
level_a: number; // % of Level A criteria passing
level_aa: number;
level_aaa: number;
};
};
violations: Array<{
id: string; // axe-rule-id or wcag-criterion
wcag_criterion: string; // 1.4.3 Contrast (Minimum)
level: "A" | "AA" | "AAA";
severity: "critical" | "serious" | "moderate" | "minor";
impact: string; // "Users with low vision cannot read text"
element: string; // CSS selector or HTML snippet
remediation: string; // "Increase contrast to 4.6:1 by darkening text"
page_url: string;
}>;
automated_test_results: {
axe_core: {
violations: number;
incomplete: number; // Needs manual review
passes: number;
detection_rate: "~57%"; // axe detects 57% of WCAG issues
};
pa11y?: {
errors: number;
warnings: number;
engine: "axe" | "htmlcs";
};
lighthouse?: {
score: number; // 0-100
audits_passed: number;
audits_failed: number;
};
};
manual_test_checklist: Array<{
category: "keyboard" | "screen_reader" | "color_contrast" | "aria" | "semantic_html" | "touch_targets";
item: string; // "Tab order is logical"
status: "pass" | "fail" | "not_tested";
notes?: string;
}>;
aria_issues: Array<{
element: string;
issue: string; // "Missing aria-label on button"
recommendation: string; // "Add aria-label='Close dialog'"
}>;
color_contrast_report: {
failures: Array<{
foreground: string; // #333333
background: string; // #CCCCCC
ratio: number; // 2.8
required: number; // 4.5 (for AA normal text)
element: string;
location: string; // "Homepage, product title"
}>;
summary: {
total_checks: number;
failures: number;
aa_compliant: boolean;
aaa_compliant: boolean;
};
};
}
Optional Fields:
screen_reader_results: Object with findings from NVDA, JAWS, VoiceOver testing.remediation_roadmap: Array of phases (Phase 1/2/3) with effort estimates and priorities.ci_cd_integration: Object with axe-core, Pa11y-ci, Lighthouse CI setup examples.accessibility_statement: Markdown template for public compliance statement.Format: JSON for structured data, Markdown for remediation plan and manual checklist.
Input:
web_pages:
- "https://example.com/checkout"
wcag_level: "AA"
automated_tools: ["axe-core", "Pa11y"]
manual_checks: true
Output (T2 Summary):
WCAG 2.2 Level AA Compliance: 78% (45/58 success criteria passing)
Automated Tests:
axe-core: 12 violations, 3 incomplete, 87 passes (57% detection rate)
Pa11y: 15 errors, 8 warnings (using axe engine)
Manual Tests:
Keyboard: ✅ Tab order logical, ⚠️ Focus indicator low contrast (2.2:1, need 3:1)
Screen Reader (NVDA): ⚠️ Error messages not announced (missing aria-live)
Top Violations:
1. Color Contrast (1.4.3, AA): 8 failures (text 3.1:1, need 4.5:1) - CRITICAL
2. Form Labels (3.3.2, A): 3 inputs missing labels - CRITICAL
3. Focus Visible (2.4.7, AA): Focus indicator contrast 2.2:1 (need 3:1) - SERIOUS
4. Accessible Auth (3.3.8, AA): CAPTCHA has no alternative - SERIOUS (NEW in 2.2)
5. Target Size (2.5.8, AA): "Edit" button 20×20px (need 24×24px) - MODERATE (NEW in 2.2)
Remediation Priority:
Phase 1 (7 days): Fix Level A violations (form labels, keyboard traps)
Phase 2 (14 days): Fix AA violations (contrast, focus indicators, CAPTCHA alternative)
Link to Full Example: See skills/frontend-accessibility-validator/examples/ecommerce-checkout-audit.txt
WCAG 2.2 New Success Criteria Status:
2.4.11 Focus Not Obscured (Minimum) - AA: ⚠️ FAIL
Issue: Sticky header hides focused button when tabbing
Fix: Adjust scroll position or reduce header height
2.5.8 Target Size (Minimum) - AA: ⚠️ FAIL
Issue: Mobile menu icons 18×18px (need 24×24px)
Fix: Increase touch targets to 24×24px minimum
3.3.7 Redundant Entry - A: ✅ PASS
Evidence: Shipping address auto-fills to billing address
3.3.8 Accessible Authentication (Minimum) - AA: ⚠️ FAIL
Issue: CAPTCHA with no alternative (audio, SMS, email)
Fix: Add audio CAPTCHA or SMS verification option
Token Budget Compliance:
Validation Checklist:
Safety & Auditability:
Determinism:
Official Standards:
Automated Testing Tools:
Color Contrast:
Screen Readers:
Complementary Skills:
frontend-designsystem-validator: Validates design tokens, component library consistency.testing-accessibility-automation: Integrates axe-core/Pa11y into CI/CD pipelines.frontend-performance-optimizer: Validates Core Web Vitals (LCP, FID, CLS) alongside accessibility.Analyzes and optimizes frontend performance using Core Web Vitals, bundle analysis, lazy loading, image optimization, and caching strategies
Design RESTful APIs with OpenAPI 3.1/3.2, resource modeling, HTTP semantics, versioning, pagination, HATEOAS, and OWASP API Security.
Design data pipelines with quality checks, orchestration, and governance using modern data stack patterns for robust ELT/ETL workflows.
Design Kafka architectures with exactly-once semantics, Kafka Streams, ksqlDB, Schema Registry (Avro/Protobuf), performance tuning, and KRaft.
Design RabbitMQ architectures with exchanges, quorum queues, routing patterns, clustering, dead letter exchanges, and AMQP best practices.
Configure Prometheus with alerting, recording rules, service discovery (K8s, Consul, EC2), federation, PromQL optimization, and Alertmanager.