界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

fixing-accessibility

fixing-accessibility

【开发与工程】Audits and fixes WCAG 2.1 AA accessibility violations in Angular and Flutter — ARIA labels, keyboard navigation, focus management, color contrast, and form error patterns. Use when writing or reviewing UI components, or after completing any screen that has interactive elements.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: fixing-accessibility description: Audits and fixes WCAG 2.1 AA accessibility violations in Angular and Flutter — ARIA labels, keyboard navigation, focus management, color contrast, and form error patterns. Use when writing or reviewing UI components, or after completing any screen that has interactive elements. allowed-tools: Read, Grep, Glob, Bash, Agent agent: accessibility-auditor context: fork metadata: triggers: accessibility, a11y, WCAG, ARIA, keyboard nav, screen reader, color contrast, focus management, accessible name, fixing accessibility, accessibility audit related-skills: accessibility-audit, angular-spa, flutter-mobile domain: accessibility role: specialist scope: review output-format: report last-reviewed: "2026-03-16"

Iron Law: Fix only the violation — never refactor unrelated code during an accessibility audit, and prefer native HTML/widget semantics over ARIA role workarounds.

Fixing Accessibility

Audits and fixes WCAG 2.1 AA accessibility violations in Angular and Flutter. Produces targeted, minimal fixes — no collateral changes.

When to Use

  • After writing any UI screen with interactive elements
  • Before opening a PR that touches components
  • When a screen reader test reveals issues
  • As a pre-submission gate for App Store / Play Store

Platform Detection

File typeAudit approach
*.dartFlutter — Semantics widgets, touch targets (48dp), focus traversal
*.html, *.ts, *.scssAngular — ARIA, keyboard nav, touch targets (44px), aria-live
No argumentSession mode — apply constraints to all subsequent UI work

Priority Reference

PriorityCategoryWCAG Level
1Accessible names (button, icon, input)AA
2Keyboard access — all interactive elements reachableAA
3Focus management — dialogs trap focus, restore on closeAA
4Semantics — correct roles and structureAA
5Form errors — aria-invalid + aria-describedbyAA
6Announcements — aria-live for dynamic contentAA
7Contrast — 4.5:1 normal text, 3:1 large textAA

Fix Discipline

  • Fix only the violation — do not refactor unrelated code
  • Prefer native HTML elements over ARIA role workarounds
  • Do not add ARIA when native semantics already solve the problem

Output Format

## Accessibility Audit: [file or scope]

### Violations
| Priority | Rule | Line | Snippet | Fix |
|----------|------|------|---------|-----|
| CRITICAL | Accessible name missing | :42 | `<button><svg>...</svg></button>` | Add `aria-label="Close"` |

### Summary
- Critical: N | High: N | Medium: N | Low: N
- Status: PASS / FAIL
我的收藏