accessibilitytesting

依据 WCAG 2.1 AA/AAA 标准审计 Web 界面,识别无障碍违规项并生成包含代码修复建议的可操作整改报告。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "accessibilitytesting":https://skillpi.com/zh/skills/deepskill-f9b8785034620773075ac347451e82461cac8581cb6b004aaf32a1d5d0629c37。安装前核对上游来源和版本:https://skillhub.cn/skills/user_3c6cb52e/accessibility-testing。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

依据 WCAG 2.1 AA/AAA 标准审计 Web 界面,识别无障碍违规项并生成包含代码修复建议的可操作整改报告。

0 下载

介绍来源: third_party · user_3c6cb52e · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
来源文档未说明。
输入和输出
来源文档未说明。
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: Accessibility Testing
slug: "accessibility-testing"
version: "1.0.0"
displayName: "Accessibility Testing"
summary: "Audit web interfaces against WCAG 2.1 AA/AAA standards, identify violations, and produce actionable remediation reports with code fixes."
description: Audit web interfaces against WCAG 2.1 AA/AAA standards, identify violations, and produce actionable remediation reports with code fixes.
license: MIT
metadata:
  author: AI Agent Skills Community
  version: 1.0.0

Accessibility Testing

This skill enables the agent to perform thorough accessibility audits of web pages and components against the Web Content Accessibility Guidelines (WCAG) 2.1 at AA and AAA conformance levels. The agent identifies violations across four principles — Perceivable, Operable, Understandable, Robust — and generates structured compliance reports with specific code fixes. It covers automated checks (color contrast, missing alt text, ARIA misuse), semi-automated checks (keyboard navigation flows, focus management), and manual check guidance (screen reader announcements, cognitive load).

Workflow

  1. Define Audit Scope and Conformance Target: Determine which pages, components, or user flows to audit, and whether the target is WCAG 2.1 AA (most common legal requirement) or AAA (highest conformance). Identify the assistive technologies to consider: screen readers (NVDA on Windows, VoiceOver on macOS/iOS, TalkBack on Android), keyboard-only navigation, and magnification tools.

  2. Run Automated Scans: Execute automated accessibility analysis using axe-core or Lighthouse. These tools detect approximately 30-40% of WCAG violations automatically, including missing alt attributes, insufficient color contrast ratios, missing form labels, duplicate IDs, invalid ARIA roles, and missing document language. Capture each violation with its WCAG criterion reference (e.g., 1.4.3 Contrast Minimum), severity (critical, serious, moderate, minor), the affected HTML element, and the CSS selector path.

  3. Perform Keyboard Navigation Testing: Manually trace every interactive flow using only Tab, Shift+Tab, Enter, Space, Escape, and arrow keys. Verify that focus order matches visual order, that focus indicators are visible (minimum 2px outline with 3:1 contrast), that modal dialogs trap focus correctly, and that no keyboard traps exist. Document any flow where a keyboard user cannot complete a task that a mouse user can.

  4. Test with Screen Readers: Navigate the page with at least one screen reader to verify that all content is announced correctly. Confirm that images have meaningful alt text (or alt="" for decorative images), that headings form a logical hierarchy (no skipped levels), that landmarks (<nav>, <main>, <aside>) are present, and that dynamic content updates are announced via aria-live regions.

  5. Generate the Compliance Report: Produce a structured report organized by WCAG principle and criterion. For each violation, include: the criterion number and name, the severity level, the affected element's HTML snippet, an explanation of why it fails, and the specific code fix. Include a summary table with pass/fail counts per principle and an overall conformance statement.

  6. Provide Remediation Code: For every violation, supply a concrete before-and-after code snippet showing the exact fix. Group fixes by component or page region so developers can address them systematically rather than one element at a time.

Usage

Provide the agent with a URL, a block of HTML, or a React/Vue component. Specify the target conformance level (AA or AAA) and any assistive technology requirements. The agent will audit the content and return a structured report with code fixes.

Examples

Example 1: WCAG Compliance Audit Report

User Request: "Audit this login form for WCAG 2.1 AA compliance."

<div class="login">
  <img src="logo.png">
  <input type="text" placeholder="Username">
  <input type="password" placeholder="Password">
  <div class="btn" onclick="login()">Sign In</div>
  <p style="color: #aaa; font-size: 12px;">Forgot your password?</p>
</div>

Agent Response — Accessibility Audit Report:

# Criterion Severity Element Issue
1 1.1.1 Non-text Content Critical <img src="logo.png"> Image has no alt attribute. Screen readers cannot describe it.
2 1.3.1 Info and Relationships Critical <input placeholder="Username"> Input has no associated <label>. Placeholder text is not a substitute for a label.
3 1.3.1 Info and Relationships Critical <input placeholder="Password"> Same label issue as above.
4 1.4.3 Contrast Minimum Serious <p style="color: #aaa"> Text color #aaa on white background has a contrast ratio of 2.32:1. AA requires 4.5:1 for text this size.
5 2.1.1 Keyboard Critical <div class="btn" onclick> A <div> is not focusable via keyboard. Users cannot Tab to or activate this button.
6 4.1.2 Name, Role, Value Critical <div class="btn" onclick> Element has no semantic role. Screen readers announce it as generic text, not as a button.

Remediation — Fixed Code:

<form class="login" onsubmit="login(event)">
  <img src="logo.png" alt="Acme Corp logo">

  <label for="username">Username</label>
  <input id="username" type="text" autocomplete="username" required>

  <label for="password">Password</label>
  <input id="password" type="password" autocomplete="current-password" required>

  <button type="submit" class="btn">Sign In</button>

  <a href="/forgot-password" style="color: #595959; font-size: 14px;">
    Forgot your password?
  </a>
</form>

Changes made: added alt to the image, replaced placeholder-only inputs with explicit <label> elements, replaced the <div> with a semantic <button>, changed the link color from #aaa (2.32:1) to #595959 (7.0:1), wrapped the form in a <form> element for proper submit handling, and added autocomplete attributes.

Example 2: Fixing a React Component

User Request: "Fix accessibility issues in this React notification component."

Before (inaccessible):

function Notification({ message, onClose }) {
  return (
    <div className="notification">
      <span>{message}</span>
      <span className="close-x" onClick={onClose}>✕</span>
    </div>
  );
}

After (accessible):

function Notification({ message, onClose }) {
  return (
    <div role="alert" aria-live="assertive" className="notification">
      <p>{message}</p>
      <button
        type="button"
        onClick={onClose}
        aria-label="Dismiss notification"
        className="close-btn"
      >
        ✕
      </button>
    </div>
  );
}

Fixes applied: (1) Added role="alert" and aria-live="assertive" so screen readers announce the notification immediately when it appears. (2) Replaced the <span onClick> with a <button> so it is keyboard-focusable and announced as an interactive control. (3) Added aria-label="Dismiss notification" because the "✕" character alone does not convey the button's purpose to screen reader users. (4) Changed the inner <span> to a <p> for proper text semantics.

Best Practices

  • Run automated tools first, but never rely on them alone: axe-core catches roughly 30-40% of WCAG issues. The remaining 60-70% require manual keyboard testing, screen reader verification, and cognitive review.
  • Test with real screen readers, not just ARIA validators: An element may have correct ARIA markup but still produce confusing announcements. VoiceOver and NVDA sometimes interpret the same markup differently.
  • Fix critical and serious issues before moderate ones: Prioritize violations that completely block access (missing keyboard operability, no alt text on functional images) over cosmetic issues (minor contrast shortfalls on decorative elements).
  • Use semantic HTML before reaching for ARIA: A <button> needs no role="button". A <nav> needs no role="navigation". ARIA is a repair tool for situations where semantic HTML is not sufficient, not a replacement for it.
  • Include accessibility checks in CI pipelines: Run axe-core or pa11y in automated tests so new violations are caught before they reach production. Fail the build on critical violations.
  • Document accessibility decisions: When a component intentionally deviates from a guideline (e.g., a custom combobox pattern), document the rationale and the alternative approach used to maintain equivalent access.

Edge Cases

  • Single-page applications with client-side routing: Page navigation does not trigger a browser page load, so screen readers are not notified of the new content. Use an aria-live="polite" region to announce route changes, or programmatically move focus to the new page's <h1>.
  • Dynamic content loaded after initial render: Content injected via JavaScript after page load is invisible to screen readers unless wrapped in an aria-live region or focus is explicitly managed. For toast notifications use aria-live="assertive"; for feed updates use aria-live="polite".
  • Complex data tables: Tables with merged cells, nested headers, or sortable columns require explicit scope, headers, and aria-sort attributes. Test that a screen reader user can understand which header applies to each data cell.
  • Custom interactive widgets (sliders, date pickers, comboboxes): These have no native HTML equivalent. Follow the WAI-ARIA Authoring Practices 1.2 patterns exactly, implementing the full keyboard interaction model specified for each widget type.
  • Third-party embedded content (iframes, widgets): You cannot fix accessibility inside a third-party iframe. Document the issue, add a descriptive title attribute to the <iframe>, and provide an accessible alternative when the embedded content is critical to the user flow.

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 提供完整的WCAG 2.1 AA/AAA标准审计流程,覆盖自动化扫描、键盘导航测试、屏幕阅读器测试等关键环节
  • 生成包含具体代码修复建议的可操作整改报告,极大提升开发效率
  • 适用于政府、教育、金融等对无障碍合规要求严格的行业场景
触发精准90/100

亮点

  • description清晰准确地描述了Skill的核心功能:WCAG标准审计、违规识别、代码修复建议生成
  • 触发词覆盖完整,包括'WCAG 2.1 AA/AAA'、'Web界面审计'、'违规项识别'、'代码修复建议'等关键要素
结构规范95/100

亮点

  • 文档结构清晰,包含完整的6步审计流程,每个步骤都有详细说明
  • 提供了两个完整的端到端示例,展示HTML和React组件的无障碍修复过程
  • frontmatter完整,包含name、slug、version、displayName、summary、description、license等必要字段
执行可靠90/100

亮点

  • 明确指定了使用的工具(axe-core、Lighthouse),参数和检查项具体明确
  • 提供了详细的修复代码示例,包含before/after对比,开发者可直接应用
  • 覆盖了主要异常情况和边缘案例,如单页应用、动态内容、第三方嵌入内容等
证据可验 (前四项均值)93/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。