AgentSkillsCN

aria

遵循 WAI-ARIA 与 WCAG 2.1 标准,审查并落实 UI 组件的无障碍设计模式。适用于对代码进行无障碍性审计、实现无障碍控件、添加 ARIA 属性、修复键盘导航问题、优化焦点管理、构建屏幕阅读器支持,或实施媒体播放器的无障碍功能时。触发短语包括:“无障碍性审查”、“a11y”、“ARIA”、“键盘导航”、“屏幕阅读器”、“焦点管理”、“WCAG”、“字幕”、“实时区域”。

SKILL.md
--- frontmatter
name: aria
description: Review and implement accessibility patterns for UI components following WAI-ARIA and WCAG 2.1. Use when auditing code for a11y issues, implementing accessible controls, adding ARIA attributes, fixing keyboard navigation, handling focus management, building screen reader support, or implementing media player accessibility. Triggers on "accessibility review", "a11y", "ARIA", "keyboard navigation", "screen reader", "focus management", "WCAG", "captions", "live region".

ARIA Skill

References

PatternReference
Keyboard Navigationkeyboard.md
Focus Managementfocus.md
ARIA Roles & Statesaria.md
React Patternsreact.md
Media Playersmedia.md
Anti-Patternsanti-patterns.md

Review

For structured accessibility reviews, load the review workflow:

FileContents
workflow.mdReview process and severity
checklist.mdComprehensive checklist
templates.mdIssue and report formats

Core Principles

  1. Semantic HTML first — Use native elements before ARIA
  2. Keyboard accessible — All interactions work without a mouse
  3. Focus visible — Clear indication of current focus
  4. Name, Role, Value — Every control has accessible name, correct role, exposed state
  5. Announce changes — Dynamic content updates reach screen readers

Common Issues (Quick Fixes)

IssueFix
Icon button no nameAdd aria-label
Custom control no roleAdd appropriate role attribute
Focus outline removedUse focus-visible instead
Toggle state unclearUse aria-pressed or aria-expanded
Dynamic content silentAdd live region with aria-live
Click-only handlerAdd keydown for Enter/Space

Anti-Patterns

Never do these:

  • Remove focus outlines without replacement
  • Use tabindex > 0
  • Rely solely on color to convey information
  • Auto-focus without user intent
  • Trap focus unintentionally
  • Use ARIA where native HTML suffices
  • Change aria-label to convey state (use aria-pressed)

Next Steps

Related Skills

NeedUse
Building UI componentscomponent skill
API design principlesapi skill
Documentationdocs skill