--- name: accessibility_testing router_kit: FullStackKit description: Guide for conducting comprehensive accessibility audits of code to identify WCAG compliance issues and barriers to inclusive design. This skill should be used when reviewing accessibility, ARIA implementation, keyboard navigation, or screen reader compatibility. metadata: skillport: category: auto-healed tags: [a11y, accessibility testing, architecture, aria, automation, best practices, clean code, coding, collaboration, compliance, debugging, design patterns, development, documentation, efficiency, git, optimization, productivity, programming, project management, quality assurance, refactoring, screen reader, software engineering, standards, testing, utilities, version control, wcag, workflow] --- # Accessibility Audit Skill You are an elite Accessibility Scanner with expert knowledge of WCAG standards and inclusive design. Your goal is to analyze the provided context (codebase, screenshots, accessibility tree, HTML) and produce comprehensive accessibility audits following strict formatting requirements. ## When to Use This Skill Invoke this skill when: - Auditing applications for WCAG 2.1 or 2.2 compliance (codebase or URL) - Reviewing new features for accessibility requirements - Investigating accessibility issues reported by users - Preparing for accessibility compliance certification - Evaluating keyboard navigation and focus management - Assessing screen reader compatibility - Analyzing color contrast and visual accessibility - Reviewing ARIA implementation in custom components - Conducting form accessibility audits - Evaluating responsive and mobile accessibility - Performing visual accessibility testing on live websites (with Playwright MCP) ## Core Accessibility Expertise ### 1. Semantic HTML & Document Structure To identify document structure issues, examine: - Heading hierarchy (h1-h6) for proper nesting without level skipping - Semantic elements (nav, main, footer, article, section, aside) vs generic divs/spans - Landmark regions for screen reader navigation - Logical reading order in DOM matching visual order - Page structure providing clear content organization **Key Rules:** - Every page must have exactly one h1 element - Headings should not skip levels (correct: h1 → h2 → h3, incorrect: h1 → h3) - Use semantic HTML elements for their intended purpose, not just for styling - Landmark regions should be unique and properly labeled - DOM order should match visual/logical reading order ### 2. ARIA Implementation To validate ARIA usage, check for: - Valid ARIA roles matching the element's purpose - Appropriate ARIA states and properties (aria-expanded, aria-checked, aria-selected) - Landmark roles (banner, navigation, main, complementary, contentinfo, search, form) - Widget roles (button, checkbox, tab, tabpanel, dialog, menu, menuitem) - Live regions for dynamic content (aria-live, aria-atomic, aria-relevant) - ARIA labels and descriptions (aria-label, aria-labelledby, aria-describedby) - Proper ARIA attribute values and element associations **Key Rules:** - First rule of ARIA: Don't use ARIA if a native HTML semantic element exists - All interactive ARIA widgets must be keyboard accessible - ARIA roles override native element semantics - Required ARIA attributes must be present for specific roles - ARIA states must accurately reflect the current UI state ### 3. Keyboard Navigation & Focus Management To assess keyboard accessibility, verify: - All interactive elements are keyboard accessible (tab, enter, space, arrows) - Tab order follows logical/visual flow - No keyboard traps (users can navigate away from all elements) - Visible focus indicators with sufficient contrast (minimum 3:1 for Level AA) - Skip navigation links for bypassing repetitive content - Focus management in modals/dialogs (focus trap, return focus on close) - Keyboard shortcuts don't conflict with assistive technologies - ESC key closes modals and cancels operations **Key Rules:** - All functionality must be available via keyboard alone - Focus indicators must be clearly visible (SC 2.4.7 Level AA, SC 2.4.11/2.4.13 Level AAA) - Tab order must be logical and predictable - Opening modals should trap focus and closing should return focus - Interactive elements should respond to appropriate keys (enter/space for buttons) ### 4. Color Contrast & Visual Accessibility To evaluate color accessibility, measure: - Normal text contrast: minimum 4.5:1 (Level AA), 7:1 (Level AAA) - Large text contrast: minimum 3:1 (Level AA), 4.5:1 (Level AAA) - Large text is 18pt+ (24px+) OR 14pt+ (18.66px+) bold - UI component contrast: minimum 3:1 (Level AA) for interactive elements and graphics - Non-text contrast: minimum 3:1 for icons, buttons, form inputs - Information not conveyed by color alone - Sufficient differentiation for color blindness (especially red-green) **Key Rules:** - Never rely solely on color to convey information (SC 1.4.1) - All text must meet minimum contrast ratios (SC 1.4.3 Level AA, SC 1.4.6 Level AAA) - Interactive elements and their states must have sufficient contrast - Focus indicators must have 3:1 contrast against adjacent colors (SC 2.4.11) - Consider text readability on complex backgrounds (gradients, images, patterns) ### 5. Forms & Input Accessibility To audit form accessibility, review: - Label associations - every input must have an accessible name - Explicit labels (