跳到正文
Skillpedia
网站与界面(前端)48k · #4629

fixing-accessibility

它能做什么

这个工具可以帮你查找并修复 HTML 代码中的无障碍问题。它会检查按钮、表单等元素是否方便所有人使用,包括残障人士,并确保所有功能都可以通过键盘操作,同时颜色对比度良好。

适用场景

  • ✓当你添加可交互的按钮或表单时。
  • ✓当你想检查网站是否符合无障碍规范(WCAG)时。
  • ✓当你希望确保只用键盘的人也能顺利浏览页面时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fixing-accessibility/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fixing-accessibility/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请检查我的 HTML 代码并修复无障碍问题,尤其是按钮和表单部分。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会分析你的 HTML 代码,查找常见的无障碍缺陷,比如图标按钮缺少文字说明,或者键盘导航出现问题。然后它会给出直接的修改建议,让你的网站更加包容。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

fixing-accessibility

When to Use

Use this skill when you need audit and fix HTML accessibility issues including ARIA labels, keyboard navigation, focus management, color contrast, and form errors. Use when adding interactive controls, forms, dialogs, or reviewing WCAG compliance.

Fix accessibility issues.

how to use

  • /fixing-accessibility Apply these constraints to any UI work in this conversation.

  • /fixing-accessibility <file> Review the file against all rules below and report:

    • violations (quote the exact line or snippet)
    • why it matters (one short sentence)
    • a concrete fix (code-level suggestion)

Do not rewrite large parts of the UI. Prefer minimal, targeted fixes.

when to apply

Reference these guidelines when:

  • adding or changing buttons, links, inputs, menus, dialogs, tabs, dropdowns
  • building forms, validation, error states, helper text
  • implementing keyboard shortcuts or custom interactions
  • working on focus states, focus trapping, or modal behavior
  • rendering icon-only controls
  • adding hover-only interactions or hidden content

rule categories by priority

priority category impact
1 accessible names critical
2 keyboard access critical
3 focus and dialogs critical
4 semantics high
5 forms and errors high
6 announcements medium-high
7 contrast and states medium
8 media and motion low-medium
9 tool boundaries critical

quick reference

1. accessible names (critical)

  • every interactive control must have an accessible name
  • icon-only buttons must have aria-label or aria-labelledby
  • every input, select, and textarea must be labeled
  • links must have meaningful text (no “click here”)
  • decorative icons must be aria-hidden

2. keyboard access (critical)

  • do not use div or span as buttons without full keyboard support
  • all interactive elements must be reachable by Tab
  • focus must be visible for keyboard users
  • do not use tabindex greater than 0
  • Escape must close dialogs or overlays when applicable

3. focus and dialogs (critical)

  • modals must trap focus while open
  • restore focus to the trigger on close
  • set initial focus inside dialogs
  • opening a dialog should not scroll the page unexpectedly

4. semantics (high)

  • prefer native elements (button, a, input) over role-based hacks
  • if a role is used, required aria attributes must be present
  • lists must use ul or ol with li
  • do not skip heading levels
  • tables must use th for headers when applicable

5. forms and errors (high)

  • errors must be linked to fields using aria-describedby
  • required fields must be announced
  • invalid fields must set aria-invalid
  • helper text must be associated with inputs
  • disabled submit actions must explain why

6. announcements (medium-high)

  • critical form errors should use aria-live
  • loading states should use aria-busy or status text
  • toasts must not be the only way to convey critical information
  • expandable controls must use aria-expanded and aria-controls

7. contrast and states (medium)

  • ensure sufficient contrast for text and icons
  • hover-only interactions must have keyboard equivalents
  • disabled states must not rely on color alone
  • do not remove focus outlines without a visible replacement

8. media and motion (low-medium)

  • images must have correct alt text (meaningful or empty)
  • videos with speech should provide captions when relevant
  • respect prefers-reduced-motion for non-essential motion
  • avoid autoplaying media with sound

9. tool boundaries (critical)

  • prefer minimal changes, do not refactor unrelated code
  • do not add aria when native semantics already solve the problem
  • do not migrate UI libraries unless requested

common fixes

<!-- icon-only button: add aria-label -->
<!-- before --> <button><svg>...</svg></button>
<!-- after -->  <button aria-label="Close"><svg aria-hidden="true">...</svg></button>

<!-- div as button: use native element -->
<!-- before --> <div onclick="save()">Save</div>
<!-- after -->  <button onclick="save()">Save</button>

<!-- form error: link with aria-describedby -->
<!-- before --> <input id="email" /> <span>Invalid email</span>
<!-- after -->  <input id="email" aria-describedby="email-err" aria-invalid="true" /> <span id="email-err">Invalid email</span>

review guidance

  • fix critical issues first (names, keyboard, focus, tool boundaries)

…

常见问题

什么是 ARIA 标签?

它们是额外添加的标签,帮助屏幕阅读器更好地理解页面元素,比如只有图标的按钮。

为什么键盘导航很重要?

有些人不使用鼠标,只依赖键盘浏览网页。这个工具会确保所有元素都能通过 Tab 键和其他按键访问和操作。

什么是颜色对比度?

指文字和背景之间的明暗差异。良好的对比度能让大多数人(包括视力较弱的人)轻松阅读文字。

详情

作者的原始描述

Audit and fix HTML accessibility issues including ARIA labels, keyboard navigation, focus management, color contrast, and form errors. Use when adding interactive controls, forms, dialogs, or reviewing WCAG compliance.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4629
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能