Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

a11ya11y 自动化

Agent Skill

用于辅助无障碍访问检查、页面可用性审计和前端可访问性改进。它适合让 Agent 检查语义标签、键盘操作、颜色对比、ARIA 属性和自动化检测结果。使用时需要结合真实页面和浏览器验证,不应只依赖静态文本判断;涉及修复建议时,应兼顾设计系统、组件复用和 WCAG 等通用无障碍规范。

总安装

245

周安装

10

GitHub Stars

4

下载量

79
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:a11y(a11y 自动化)
来源仓库:https://github.com/joabgonzalez/ai-agents-framework
仓库路径:skills/a11y
安装命令:
npx skills add https://github.com/joabgonzalez/ai-agents-framework --skill a11y
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/joabgonzalez/ai-agents-framework --skill a11y

简介

a11y 用于辅助无障碍访问检查、页面可用性审计和前端可访问性改进,适合审查语义标签和 ARIA 属性。

  • 适用于结合真实页面和浏览器验证,兼顾 WCAG 规范和组件复用。
  • 通过 npx skills add 命令从 GitHub 仓库安装并使用该技能。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件操作。
  • a11y 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Accessibility (a11y)

Ensures WCAG 2.1/2.2 Level AA compliance: semantic structure, ARIA, contrast, keyboard nav.

When to Use

  • Building UI components with interactive elements
  • Implementing forms, modals, or custom widgets
  • Adding dynamic content or live regions
  • Ensuring keyboard navigation or reviewing accessibility compliance

Don't use for:

  • Tech-specific implementation (react, html skills)
  • Backend logic (no UI)

Critical Patterns

✅ REQUIRED: Document Language — SC 3.1.1 · Level A

<!-- SC 3.1.1 Level A — required for screen reader pronunciation -->
<html lang="en">
<html lang="es-MX">

Rule: Always set lang on <html>. Missing lang causes screen readers to mispronounce all content.

✅ REQUIRED: Semantic HTML Elements — SC 1.3.1 · Level A

<!-- ✅ CORRECT: Nav with list structure (SC 1.3.1) -->
<nav aria-label="Primary navigation">
  <ul>
    <li><a href="/home">Home</a></li>
    <li><a href="/about">About</a></li>
  </ul>
</nav>
<main>
  <article>Content</article>
</main>
<button onClick="{action}">Submit</button>

<!-- ❌ WRONG: Non-semantic divs -->
<div class="nav">
  <div onClick="{navigate}">Home</div>
</div>

✅ REQUIRED: Keyboard Accessibility — SC 2.1.1 · Level A

// ✅ CORRECT: Keyboard events
<button onClick={handleClick} onKeyDown={(e) => e.key === 'Enter' && handleClick()}>

// ❌ WRONG: Mouse-only events
<div onClick={handleClick}> // Not keyboard accessible

✅ REQUIRED: Form Labels — SC 1.3.1, SC 3.3.2 · Level A

<!-- ✅ CORRECT: Associated label -->
<label htmlFor="email">Email Address</label>
<input id="email" type="email" />

<!-- ❌ WRONG: No label association -->
<div>Email Address</div>
<input type="email" />

✅ REQUIRED: Alt Text for Images — SC 1.1.1 · Level A

<!-- ✅ Informative image -->
<img src="chart.png" alt="Sales increased 25% in Q4" />

<!-- ✅ Decorative image -->
<img src="border.png" alt="" />

<!-- ❌ WRONG: Missing alt -->
<img src="chart.png" />

✅ REQUIRED: SVG Accessibility — SC 1.1.1 · Level A

SVG loaded as <img> respects alt. SVG inline or via SVGR (React) does not — use role and aria-label directly.

<!-- Informative SVG -->
<svg role="img" aria-label="Company logo" focusable="false">
  <title>Company logo</title>
</svg>

<!-- Decorative SVG -->
<svg aria-hidden="true" focusable="false">...</svg>

// ❌ WRONG: alt is ignored by SVGR
<Logo alt="Company logo" />

// ✅ CORRECT: use role + aria-label on SVGR component
<Logo role="img" aria-label="Company logo" focusable="false" />

✅ REQUIRED: Disclosure Pattern (Accordion / Expandable) — SC 4.1.2 · Level A

// ✅ CORRECT
<button aria-expanded={isOpen} aria-controls="panel-id">
  Details  {/* Accessible name must NOT change with state */}
</button>
<div id="panel-id" hidden={!isOpen}>Panel content</div>

Rules: aria-controls must match the panel id. Do not change the button's accessible name based on open/closed state.

✅ REQUIRED: Form Validation Errors — SC 3.3.1 Level A · SC 3.3.3 Level AA

<!-- ✅ Error linked to field; announced via role="alert" -->
<label for="email">Email <span aria-hidden="true">*</span></label>
<input id="email" type="email" aria-required="true" aria-invalid="true"
       aria-describedby="email-error" />
<span id="email-error" role="alert">
  Enter a valid email address (e.g. user@example.com)
</span>

<!-- Error summary on multi-field submit — move focus here -->
<div role="alert" tabindex="-1" id="error-summary">
  <h2>3 errors prevented submission:</h2>
  <ul><li><a href="#email">Email: Enter a valid address</a></li></ul>
</div>

Rules: aria-invalid="true" on the input (not the error span). On submit with errors, move focus to error summary (element.focus(), needs tabindex="-1").

✅ REQUIRED: Dynamic Page / SPA Navigation — SC 2.4.2/2.4.3 Level A · SC 4.1.3 Level AA

// On every route change — framework-agnostic:
document.title = `${pageTitle} | My App`;  // 1. Update title
announcer.textContent = '';                // 2. Clear announcer
announcer.textContent = pageTitle;         // 3. Re-set triggers announcement
document.querySelector('main')?.focus();   // 4. Move focus to main
<!-- Persistent live region — render once in app root -->
<div aria-live="polite" aria-atomic="true" class="sr-only" id="route-announcer"></div>
<main id="main-content" tabindex="-1">...</main>

Rules: <main> needs tabindex="-1" to be programmatically focusable. Do NOT move focus to <body>.


Conventions

Framework-Native First

Before implementing accessibility patterns manually, check if your framework or UI library already provides them. Most production stacks (Tailwind, MUI, Radix UI, React Aria, Headless UI) ship accessible primitives that handle ARIA, focus, and keyboard contracts automatically. Use them — avoid duplicating CSS or markup that diverges from the design system.

Semantic HTML

  • Semantic elements (<nav>, <main>, <article>, <aside>, <footer>)
  • Heading hierarchy (h1 → h2 → h3, no skipping)
  • <button> for actions, <a> for navigation; labels associated with inputs

ARIA

  • Only when semantic HTML insufficient; prefer native elements
  • Common: aria-label, aria-labelledby, aria-describedby
  • Dynamic content: aria-live, aria-atomic
  • Active navigation: aria-current="page" on current link, aria-current="step" in wizards

Keyboard Navigation

  • All interactive elements keyboard accessible; logical tab order
  • Visible focus indicators; Escape closes modals/dropdowns

Color and Contrast

  • Text 4.5:1 min (7:1 AAA), large text 3:1 min; UI components 3:1; focus indicators 3:1 (WCAG 2.2)
  • Don't rely on color alone

Touch Targets

  • 24×24px min (WCAG 2.2), 44×44px recommended; adequate spacing between targets

Decision Tree

Interactive element (button, link)?
  → Ensure keyboard accessible (Tab, Enter/Space)
  → Visible focus indicator, proper role and semantic element

Form field?
  → Associate <label> with input (htmlFor/id)
  → Mark required: aria-required="true" (or native required)
  → Field error: aria-invalid="true" + aria-describedby → error span + role="alert"
  → Submit errors: move focus to error summary (tabindex="-1") + role="alert"

SPA / route change?
  → Update document.title to reflect new page (SC 2.4.2)
  → Announce new page via persistent aria-live="polite" region
  → Move focus to <main tabindex="-1"> or <h1 tabindex="-1"> (not <body>)

Dynamic content change?
  → Non-urgent: aria-live="polite"
  → Critical alerts: aria-live="assertive"
  → Whole region: aria-atomic="true"

Custom widget (dropdown, modal, tabs)?
  → Follow WAI-ARIA Authoring Practices patterns
  → Implement keyboard navigation (Arrow keys, Escape, Enter)
  → See references/wai-aria-patterns.md for full widget patterns

Image?
  → <img>: decorative → alt="", informative → descriptive alt text
  → Inline SVG / SVGR: decorative → aria-hidden="true", informative → role="img" aria-label="..."

Color conveys meaning?
  → Add text label, icon, or pattern; verify 4.5:1 for text, 3:1 for UI

Modal or overlay?
  → Trap focus inside modal, restore focus on close
  → Allow Escape to dismiss; use aria-modal="true" and role="dialog"

Example

Accessible modal dialog: focus trap, ARIA labels, and keyboard navigation applied together.

function ConfirmDeleteModal({ isOpen, onClose, onConfirm }: ModalProps) {
  const firstFocusRef = useRef<HTMLButtonElement>(null);

  useEffect(() => {
    if (isOpen) firstFocusRef.current?.focus();
  }, [isOpen]);

  if (!isOpen) return null;
  return (
    <div role="dialog" aria-modal="true" aria-labelledby="modal-title"
         onKeyDown={(e) => e.key === 'Escape' && onClose()}>
      <h2 id="modal-title">Delete this item?</h2>
      <p id="modal-desc">This action cannot be undone.</p>
      <button ref={firstFocusRef} aria-describedby="modal-desc"
              onClick={onConfirm}>Confirm Delete</button>
      <button onClick={onClose}>Cancel</button>
    </div>
  );
}

Patterns applied: role="dialog", aria-modal, aria-labelledby, aria-describedby, focus on open, Escape to dismiss.


Edge Cases

WCAG 2.2 updates: 24×24px min target size; focus indicators 3:1 contrast; provide pointer alternatives for drag; CAPTCHAs need alternatives (no cognitive function tests).

Skip links: First focusable element, visually hidden, revealed on focus.

<a href="#main-content" class="skip-link">Skip to main content</a>
<main id="main-content">...</main>

Apply .skip-link:focus {position: fixed; top: 0; clip: auto; padding: 0.5rem 1rem;} to reveal visually.

sr-only pattern: Visually hidden but screen-reader accessible. Use for icon-button labels and status announcements. Standard CSS: position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;

ARIA live regions throttling: Rapid updates may be throttled. Debounce or use aria-atomic="true".

Focus trap issues: Libraries like React may interfere with focus management. Test focus trap explicitly in modals.

Custom controls: For complex widgets (datepickers, sliders, menus, tabs), follow WAI-ARIA Authoring Practices. See references/wai-aria-patterns.md.


Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.62%
按下载量换算29

Claude

30.98%
按下载量换算24

Cursor

18.33%
按下载量换算14

Gemini CLI

9.3%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills