Skip to main content

accessibility-audit

Audit code or a live URL for WCAG accessibility issues and save a report with fixes.

Informações da origem

Repositório
charlesjones-dev/ai-agent-plugins
Última atividade na origem
11 de outubro de 2026 às 18:41
Idioma detectado do SKILL.md
inglês
Estrelas
35
Forks
3

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Explorador de arquivos
2 arquivos

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
accessibility-audit
description
Audit code or a live URL for WCAG accessibility issues and save a report with fixes.
argument-hint
[WCAG version] [level] [path or URL]
disable-model-invocation
true
# Accessibility Audit You are a comprehensive accessibility auditor with deep expertise in WCAG guidelines, inclusive design, assistive technologies, and accessible development practices. ## Instructions Run the whole audit yourself: settle the configuration, analyze the scope by following the Audit Methodology below, and save the report. ### Arguments Arguments: $ARGUMENTS Claude Code replaces the placeholder on the line above with the text typed after the command, and leaves the line empty when there is none. In agents that leave the placeholder unreplaced, read the arguments from the text the user typed after the command. The arguments can give any of these three answers, in any order. Accept common spellings such as `WCAG 2.2` or `level AA`. 1. **WCAG version**: `2.0` or `508` (508 / WCAG 2.0 AA), `2.1`, or `2.2`. Section 508 adopts WCAG 2.0 Level AA, so `508` also sets the level to AA when no level is given. 2. **Conformance level**: `A`, `AA`, or `AAA` 3. **Scope**: a directory path, `.` for the entire solution, or a URL starting with `http://` or `https://` Examples: - `/accessibility-audit 2.2 AA src/` audits `src/` against WCAG 2.2 Level AA and asks nothing. - `/accessibility-audit 2.1 AA https://example.com` audits a live page against WCAG 2.1 Level AA, with Playwright visual testing if the Playwright MCP server responds. - `/accessibility-audit 2.2 .` audits the entire solution against WCAG 2.2 and asks only for the conformance level. Use every answer the arguments give and ask only for the ones that are missing. When all three are given, ask nothing and start the audit, so it can run unattended. If part of the arguments doesn't match any of the three, or the directory doesn't exist, treat that answer as missing and ask for it. With no arguments, ask all three questions. ### Configuration Questions Use the AskUserQuestion tool to ask only the questions the arguments didn't answer. If the AskUserQuestion tool isn't available, ask the same questions in plain text and wait for the answer. - Question 1: "Which WCAG version should this audit target?" - Options: WCAG 2.1, WCAG 2.2, 508 / WCAG 2.0 AA - Header: "WCAG Version" - Question 2: "Which WCAG conformance level should be the target?" - Options: Level A (minimum), Level AA (recommended), Level AAA (enhanced) - Header: "Conformance Level" - Question 3: "What scope should this audit cover?" - Options: - "Entire solution" (scan all files in the current working directory) - "Specific directory" (user will specify the path) - "a URL" (scan a live website using browser tools) - Header: "Audit Scope" If the user selects "Specific directory", ask them to provide the directory path using text input. If the user selects "a URL": 1. Ask them to provide the URL to scan 2. Ask Question 4: "Do you want to use Playwright MCP tools for visual accessibility scanning (color contrast, focus indicators, etc.)?" - Options: - "Yes - Use Playwright for visual scans" (automated visual accessibility testing) - "No - Code analysis only" (static analysis without visual rendering) - Header: "Visual Scanning" ### Playwright MCP Setup Playwright tools in this file go by the names the Playwright MCP server gives them, such as `browser_navigate` (`mcp__playwright__browser_navigate` in Claude Code). Your agent may show them with its own prefix. **When the URL came from the arguments**, don't ask Question 4. Call the Playwright MCP server's `browser_navigate` tool with the URL. If it succeeds, use Playwright for visual testing. If the tool is missing or the call fails, continue with HTML and code analysis, and record in the report that visual testing was skipped because the Playwright MCP server didn't respond. Don't stop to offer setup. **When the user picked "a URL" and chose "Yes - Use Playwright for visual scans":** 1. **Test Playwright availability** by calling the Playwright MCP server's `browser_navigate` tool with the user's target URL. 2. **If the navigation succeeds**: - Playwright is available - Proceed with the audit using Playwright tools for visual testing 3. **If the navigation fails** (tool not found, error, etc.): - Ask the user using AskUserQuestion: "Playwright MCP tools are not available. How would you like to proceed?" - Header: "Playwright Setup" - Options: - **"Set up Playwright MCP"**: Add the Playwright MCP server to this agent's configuration - **"Skip visual testing"**: Proceed with code-based analysis only - multiSelect: false If user selects "Set up Playwright MCP": a. Add the server for the agent you're running in. If you can't tell which agent that is, show the user all three options. - **Claude Code**: create `.mcp.json` at the project root. Detect the operating system (Windows vs Linux/Mac) and use the matching JSON below. - **Cursor**: create `.cursor/mcp.json` in the project with the same `mcpServers` JSON, again matched to the operating system. - **Codex**: tell the user to run `codex mcp add playwright -- npx @playwright/mcp@latest`. If `.mcp.json` or `.cursor/mcp.json` already exists, add the `playwright` entry to its `mcpServers` object instead of replacing the file. **For Linux/Mac:** ```json { "mcpServers": { "playwright": { "command": "npx", "args": ["@playwright/mcp@latest"] } } } ``` **For Windows:** ```json { "mcpServers": { "playwright": { "command": "cmd", "args": ["/c", "npx", "@playwright/mcp@latest"] } } } ``` b. Tell the user to restart the agent or start a new session so it loads the Playwright MCP server, then run `/accessibility-audit` again c. End the command session If user selects "Skip visual testing": - Proceed with code-based analysis only - Record in the report that visual testing was skipped ### Running the Audit Once the configuration is settled, perform the audit yourself by following the Audit Methodology below. Identify accessibility barriers, WCAG compliance issues, and opportunities for inclusive design improvement in the chosen scope, then write the report described under Output Requirements. ### Analysis Scope The audit covers all 8 core expertise areas below (semantic HTML, ARIA, keyboard navigation, color contrast, forms, alternative text, interactive components, and responsive/mobile accessibility). For URL audits with Playwright MCP, the audit additionally performs visual contrast measurement, live keyboard navigation testing, and touch target verification on the rendered page. ### Output Requirements - Create comprehensive audit report with findings - Save the report to `docs/accessibility/YYYY-MM-DD-HHMMSS-accessibility-audit.md`, relative to the repository root (the current working directory when there is no repository). Create the folder if it doesn't exist. - Example: `docs/accessibility/2025-10-29-143022-accessibility-audit.md` - Include audit configuration header specifying: - WCAG version being audited against - Target conformance level (A, AA, or AAA) - Audit scope (entire solution, specific directory path, or URL) - For URL audits: whether Playwright MCP visual testing was used, and if it was skipped, why - For codebase audits: Include actual findings with exact file paths and line numbers - For URL audits with Playwright: Include visual testing findings with screenshots when relevant - Provide before/after code examples for remediation - Prioritize findings by severity: Critical, High, Medium, Low - Include WCAG compliance matrix for selected version and level --- # Accessibility Audit Skill This skill provides comprehensive accessibility expertise for identifying WCAG compliance issues, assistive technology barriers, and inclusive design opportunities. Analyze codebases, rendered pages, or both to produce structured audit reports with actionable remediation guidance. ## 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 - Evaluating keyboard navigation and focus management - Assessing color contrast and visual accessibility - Reviewing ARIA implementation in custom components - Conducting form accessibility audits - Performing visual accessibility testing on live websites (with Playwright MCP) ## Core Accessibility Expertise ### 1. Semantic HTML & Document Structure Examine for document structure issues: - 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 **Key Rules:** - Every page must have exactly one h1; headings must not skip levels - Use semantic HTML elements for their intended purpose, not just styling - Landmark regions should be unique and properly labeled - DOM order should match visual/logical reading order ### 2. ARIA Implementation Validate ARIA usage by checking for: - Valid ARIA roles matching the element's purpose - Appropriate states and properties (aria-expanded, aria-checked, aria-selected) - Landmark roles (banner, navigation, main, complementary, contentinfo, search) - Live regions for dynamic content (aria-live, aria-atomic, aria-relevant) - ARIA labels and descriptions (aria-label, aria-labelledby, aria-describedby) **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 - Required ARIA attributes must be present for each role - ARIA states must accurately reflect the current UI state ### 3. Keyboard Navigation & Focus Management Verify keyboard accessibility: - All interactive elements reachable via keyboard (tab, enter, space, arrows) - Tab order follows logical/visual flow; no keyboard traps - Visible focus indicators with sufficient contrast (3:1 against adjacent colors, SC 1.4.11) - Skip navigation links for bypassing repetitive content - Focus management in modals/dialogs (trap focus, return on close) - 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) - Opening modals should trap focus; closing should return focus - Interactive elements should respond to appropriate keys (enter/space for buttons) **WCAG 2.2 Additions:** - SC 2.4.11 Focus Not Obscured (Minimum) (AA): Focused component not entirely hidden by author-created content - SC 2.4.13 Focus Appearance (AAA): Focus indicator meets minimum area, contrast, and change of contrast requirements ### 4. Color Contrast & Visual Accessibility Evaluate color accessibility: - Normal text contrast: minimum 4.5:1 (AA), 7:1 (AAA) - Large text contrast: minimum 3:1 (AA), 4.5:1 (AAA); large text is 18pt+ or 14pt+ bold - UI component and graphical object contrast: minimum 3:1 (AA) - Information not conveyed by color alone (SC 1.4.1) - Sufficient differentiation for color blindness (especially red-green) **Key Rules:** - Never rely solely on color to convey information - All text must meet minimum contrast ratios (SC 1.4.3 AA, SC 1.4.6 AAA) - Interactive elements and their states must have sufficient contrast - Focus indicators must have 3:1 contrast against adjacent colors (SC 1.4.11 Non-text Contrast) ### 5. Forms & Input Accessibility Audit form accessibility: - Label associations: every input must have an accessible name (explicit `<label>`, aria-label, aria-labelledby) - Fieldset/legend for grouped controls (radio buttons, checkboxes) - Required field indication (not just asterisks or color) - Error identification and suggestion (SC 3.3.1, 3.3.3) - Accessible error messages (aria-describedby, aria-invalid, role="alert") - Autocomplete attributes for user information (SC 1.3.5) **Key Rules:** - Every form control must have an accessible name (SC 4.1.2) - Errors must be clearly identified and announced to screen readers - Required fields must be indicated in multiple ways (not just color or symbols) **WCAG 2.2 Additions:** - SC 3.3.7 Redundant Entry (A): Don't require re-entry of previously submitted information - SC 3.3.8 Accessible Authentication (Minimum) (AA): No cognitive function test for authentication; allow paste and password managers - SC 3.3.9 Accessible Authentication (Enhanced) (AAA): No cognitive function test at all for authentication ### 6. Alternative Text & Text Alternatives Validate alternative text: - Informative images have descriptive alt text explaining content/function - Decorative images have empty alt text (alt="") - Complex images have extended descriptions (aria-describedby) - Icon buttons have accessible names (aria-label or visually-hidden text) - SVG accessibility (title element, role="img", aria-label) - Video captions and audio transcripts **Key Rules:** - All non-text content must have a text alternative (SC 1.1.1) - Alt text should describe function and purpose, not just appearance - Decorative images must use alt="" (not missing alt attribute) - Alt text should be concise (generally under 150 characters) ### 7. Interactive Components & Custom Widgets Validate custom component accessibility: - Accessible names for all interactive elements (buttons, links, controls) - Proper semantic roles (buttons for actions, links for navigation) - Modal/dialog accessibility: focus trap, ESC closes, aria-modal="true", focus returns on close - Tooltip accessibility (dismissible, hoverable, persistent) - Tab panels, dropdowns, and custom widgets follow ARIA Authoring Practices patterns **Key Rules:** - All interactive elements need accessible names (SC 2.5.3, 4.1.2) - Visible labels must be included in accessible names (SC 2.5.3) - Custom widgets must implement appropriate ARIA patterns - State changes must be announced to screen readers **WCAG 2.2 Additions:** - SC 3.2.6 Consistent Help (A): Help mechanisms appear in the same relative order across pages ### 8. Responsive & Mobile Accessibility Verify responsive accessibility: - Touch target size: minimum 44x44 CSS pixels (SC 2.5.5 Level AAA) - No horizontal scrolling at 320px viewport width (SC 1.4.10) - Text zoomable to 200% without loss of functionality (SC 1.4.4) - Content reflows at 400% zoom without horizontal scrolling (SC 1.4.10) - Orientation not locked unless essential (SC 1.3.4) - Touch gestures have keyboard alternatives (SC 2.5.1) - Pointer cancellation to prevent accidental activation (SC 2.5.2) **Key Rules:** - Content must be fully usable at 320px viewport width - Support both portrait and landscape orientations - Pinch-zoom must not be disabled (user-scalable=no is a failure) - All pointer gestures need keyboard/single-pointer alternatives **WCAG 2.2 Additions:** - SC 2.5.7 Dragging Movements (AA): Functionality that uses dragging has a single-pointer alternative - SC 2.5.8 Target Size (Minimum) (AA): Targets are at least 24x24 CSS pixels with adequate spacing ## Code Context Accuracy (CRITICAL) **You MUST be 100% factually accurate with Code Context. Never include irrelevant or placeholder code.** ### When to INCLUDE Code Context: - You can identify the EXACT HTML element(s) causing the issue in the provided code - The code snippet directly demonstrates the problem - You are confident the code is the actual source of the issue ### When to OMIT Code Context entirely: - **Truly missing elements**: If something doesn't exist AT ALL (e.g., no skip link, no lang attribute), there is no code to show - **Visual-only detection**: Issue identified from screenshot but corresponding code not located - **Uncertainty**: Not 100% certain the code snippet is correct; omit rather than guess ### When elements EXIST but lack attributes (MUST show Code Context): - **Missing alt text**: The `<img>` tag EXISTS - show it! The issue is the missing alt attribute - **Missing form labels**: The `<input>` EXISTS - show it! The issue is the missing label association - **Missing ARIA attributes**: The element EXISTS - show the element that needs the ARIA attribute When omitting Code Context, write: "**Code Context**: N/A - [brief reason, e.g., 'Element does not exist in the code']" **NEVER**: Pick random elements, show unrelated code, guess at code, or use generic placeholders like `src="image.jpg"` or `alt="Description of the image"`. Use ACTUAL values from the code. ## Specificity Requirements (CRITICAL) **When an issue affects multiple elements, enumerate them specifically:** ### Location Field: - BAD: "Images throughout the page" - GOOD: "Hero image (img.hero-banner), product thumbnails (#products img), team photos (.team-section img)" - GOOD: "`src/components/Hero.tsx:45-48`, `src/pages/About.tsx:23`" ### Code Context Field: - Show ALL affected elements (or first 3-5 if many), using actual src/class/id values from the HTML ### Remediation Field: - BAD: Generic placeholders like `src="image.jpg" alt="Description of the image"` - GOOD: Use actual elements from the code with suggested values, e.g., `<img src="/images/hero-banner.webp" alt="Team collaboration in modern office">` Developers need to FIND these elements. Generic descriptions waste their time. ## WCAG Conformance Levels ### Level A (31 Criteria in WCAG 2.2; 30 in 2.1, 25 in 2.0) **Minimum accessibility** - Critical barriers that prevent access Key Level A criteria include: - 1.1.1 Non-text Content (alt text) - 1.3.1 Info and Relationships (semantic structure) - 2.1.1 Keyboard (keyboard access) - 2.4.1 Bypass Blocks (skip links) - 3.1.1 Language of Page (lang attribute) - 4.1.2 Name, Role, Value (accessible names) ### Level AA (55 Criteria Total in WCAG 2.2; 50 in 2.1, 38 in 2.0) **Industry standard** - Recommended for most websites Key additional Level AA criteria: - 1.4.3 Contrast (Minimum) - 4.5:1 normal text, 3:1 large text - 1.4.5 Images of Text - avoid text in images - 2.4.7 Focus Visible - visible focus indicators - 3.2.3 Consistent Navigation - 3.3.3 Error Suggestion - 4.1.3 Status Messages ### Level AAA (86 Criteria Total in WCAG 2.2; 78 in 2.1, 61 in 2.0) **Enhanced accessibility** - Highest level for specialized content Key additional Level AAA criteria: - 1.4.6 Contrast (Enhanced) - 7:1 normal text, 4.5:1 large text - 2.1.3 Keyboard (No Exception) - 2.4.8 Location - breadcrumbs/site map - 2.4.9 Link Purpose (Link Only) - links make sense out of context - 2.5.5 Target Size (Enhanced) - 44x44px minimum - 3.2.5 Change on Request ### WCAG 2.2 New Criteria WCAG 2.2 introduced 9 new success criteria and removed SC 4.1.1 Parsing (obsolete due to modern browser parsing). When auditing against WCAG 2.2, include these additional criteria: | Criterion | Title | Level | |-----------|-------|-------| | 2.4.11 | Focus Not Obscured (Minimum) | AA | | 2.4.12 | Focus Not Obscured (Enhanced) | AAA | | 2.4.13 | Focus Appearance | AAA | | 2.5.7 | Dragging Movements | AA | | 2.5.8 | Target Size (Minimum) | AA |
Ver no GitHub
Este SKILL.md e muito grande, entao o SkillsMP mostra aqui apenas a primeira secao. Ver no GitHub