better-accessibility

jakubkrehel/skills · Agent Skill

檢查和改善焦點狀態、鍵盤支援、ARIA、表單、螢幕閱讀器、觸擊區域和動作的無障礙功能。

前往安裝 ↓

總覽

發布者jakubkrehel社群
儲存庫jakubkrehel/skills ↗
技能資料夾better-accessibility
星8,643
分支330
附帶檔案8
授權MIT
最近更新2026年10月25日
連結技能原始碼 ↗ · 儲存庫 ↗

Mozgi 檢查

我們在技能檔案中發現的內容。詳細資訊需訂閱。

安全性
中等風險 · 發現 1 個需要注意的地方
相容性
僅含說明 — 適用於多數代理
相似技能
找到 31 個相似技能
訂閱另含

安裝

技能就是一個含 SKILL.md 的資料夾。選擇你的代理,在專案根目錄的終端機(macOS、Linux 或 Windows 的 Git Bash)執行指令。

把提示貼到 Claude、Codex 或其他助理:它會自行檢查並安裝技能。

Install the “better-accessibility” skill from mozgi.io (https://mozgi.io/skills/jakubkrehel-better-accessibility/) for me.

1. Download the archive: https://mozgi.io/skills/jakubkrehel-better-accessibility/download
   If it fails, take the skill folder from the source: https://github.com/jakubkrehel/skills/tree/main/skills/better-accessibility
2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me.
3. Put the “better-accessibility” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.).
4. Make sure <skills folder>/better-accessibility/SKILL.md exists.
5. Briefly tell me what this skill does and offer to try it on my task.

If you cannot do a step yourself, tell me what to click or type.

技能檔案

8 個檔案 下載 ZIP

安裝前請先檢視 SKILL.md 與相關檔案。點擊檔案即可預覽。

SKILL.md 內容

作者原文 · 唯讀

Accessibility

This skill reviews and fixes semantics, keyboard and focus behavior, accessible names, forms, announcements, motion and zoom. It reports each failure against the WCAG criterion it breaks and writes the fix in the project's styling system.

Reviewing means two walks. Keyboard-only, where every flow completes without a mouse. Then screen-reader, where every control announces a name, a role and its state. When unsure, take the platform default over a custom rebuild, and remove ARIA rather than add it.

Contrast measurement and color fixes belong to better-colors. Text sizing, iOS input zoom and language metadata belong to better-typography. Spacing between targets and spatial RTL belong to better-layout. Label, error and alt-text wording belong to better-writing. Animation recipes, hover styling and scroll containment belong to better-ui.

Criteria, not conventions

A finding cites a WCAG 2.2 Level A or AA criterion by number, or a concrete task an assistive-technology user cannot complete. Everything else is a recommendation and never HIGH. That covers AAA criteria, APG conventions, the one-<h1> and no-skipped-levels outline and the 44px and 40px targets. The criterion thresholds below are exact. The larger targets are heuristics, so keep an established, usable density.

Native elements first

The first rule of ARIA: don't use ARIA when a native element exists. <button> for actions, <a href> for navigation, never <div onClick>. A real link must support Cmd/Ctrl/middle-click. See semantics-and-aria.md ↗ for landmarks and button-vs-link.

Disabled means unavailable

Use native disabled when a control is genuinely unavailable. Reach for aria-disabled="true" only when it should stay focusable, then block pointer, keyboard and form behavior in code and style the state explicitly. The rules are in semantics-and-aria.md ↗.

Visible focus rings

Style :focus-visible, not bare :focus. Keyboard users get a ring and mouse users usually don't. Prefer the browser's unmodified indicator.

A custom ring needs a project focus token or another explicit color. It must reach 3:1 against every adjacent color it crosses, currentColor included, under 1.4.11. A 2px solid perimeter with a 3:1 change of contrast is the 2.4.13 AAA target. Never use outline: none without a verified replacement, and preserve system colors in forced-colors mode.

A focused element must never sit fully hidden behind a sticky header, footer or banner (2.4.11). Pad the scroller by the sticky chrome's height, a fix better-layout owns. Recipes are in focus-and-keyboard.md ↗.

Full keyboard support

Every pointer interaction needs a keyboard path. Follow the ARIA APG patterns: Escape closes overlays, arrow keys move within composite widgets, Tab moves between widgets, Enter and Space activate buttons.

Use only tabindex="0" to join the natural tab order and tabindex="-1" for programmatic focus. Positive values break that order. Composite widgets use roving tabindex, where the active item is 0 and every other is -1. Where focus must stay in an input, as in a combobox, use aria-activedescendant instead. Key maps per widget are in focus-and-keyboard.md ↗.

Trap and restore focus

Prefer <dialog> opened with showModal(), which makes the background inert and handles Escape. A custom overlay sets inert on the background, role="dialog" and aria-modal="true" on itself. Either way, move focus inside on open and return it to the trigger on close.

Client-side route changes reset nothing. Update document.title and move focus to the new view's <h1> or <main>. Both recipes are in focus-and-keyboard.md ↗.

Minimum hit area

WCAG 2.5.8's Level AA baseline is a 24×24 CSS-pixel target, or one of its exceptions. Aim for 44×44px on touch and 40×40px on desktop where density permits. Extend with a pseudo-element when the visible element should stay smaller.

Never let extended hit areas overlap. Give decorative layers pointer-events: none, so a glow never swallows the clicks meant for the control beneath it.

Every drag interaction needs a single-pointer alternative, such as buttons or a menu that reorder or move the same item (2.5.7). Sizes, exceptions and collision rules are in hit-areas.md ↗.

Label and type every control

Every input gets a <label for> or a wrapping <label>. A placeholder is never a label. Label and control share one hit target, with no dead zone between a checkbox and its text.

Add a valid autocomplete token and a descriptive name attribute, plus the type and inputmode that summon the right keyboard. Never block paste; users paste passwords and one-time codes. See forms.md ↗.

Errors that announce

Validate on submit, never by disabling submit until the form is valid. Mark failing fields aria-invalid="true", point aria-describedby at the inline error text and focus the first invalid field. Submit behavior while the request runs is in forms.md ↗.

Accessible names everywhere

Icon-only buttons need a descriptive aria-label. Visible label text must appear in the accessible name. Decorative elements get aria-hidden="true", never on a focusable element.

Pair color with a second cue

Status needs a redundant cue: an icon, text or an underline alongside the color (1.4.1).

This skill decides which contrast requirement applies:

| Criterion | Applies to | Minimum |

| --- | --- | --- |

| 1.4.3 AA | Text | 4.5:1 |

| 1.4.3 AA | Large text, at least 24px or 18.67px bold | 3:1 |

| 1.4.11 AA | UI component boundaries, states and meaningful graphics | 3:1 |

Inactive controls and logos are exempt. Use better-colors to measure the rendered pair. When it fails, report the pair and the criterion it misses, and leave the colors alone unless asked.

Honor prefers-reduced-motion

Wrap motion in @media (prefers-reduced-motion: no-preference) so it is opt-in. Under reduced motion, replace slides and scales with opacity cross-fades, and kill parallax and autoplay entirely. See motion-and-zoom.md ↗.

Nothing the user needs runs on a timer

Anything moving, blinking or updating on its own for more than 5 seconds needs a visible pause control (2.2.2). Toasts carrying an action or an error stay until dismissed. The rules are in motion-and-zoom.md ↗.

Announce dynamic content

Three mechanisms, three jobs. aria-describedby carries field-specific validation. A polite live region (role="status") carries non-urgent updates not tied to a control, such as toasts and result counts. role="alert" carries urgent untied errors and nothing else.

Repeated polite announcements need a stable empty region rendered before its text updates. Dynamically inserted alerts vary in support, so test them on the screen readers you target. See screen-readers.md ↗.

Alt text by purpose

Decorative images get alt="". Informative images describe the meaning. Functional images describe the action, never the picture. The full table is in screen-readers.md ↗.

Structure is navigation

Use headings that describe their sections and form a coherent outline. Expose one visible primary <main> landmark. When repeated navigation or chrome precedes it, make a "Skip to content" link the first focusable element. Anchored headings get scroll-margin-block-start.

Survive zoom and text resize

Text must survive 200% resize (1.4.4), and the page must reflow at 320px width without horizontal scrolling (1.4.10). Text containers take min-height, not height, and better-layout owns the rest of that fix. Never set maximum-scale=1 or user-scalable=no in the viewport meta. iOS input zoom is fixed with better-typography's 16px rule instead.

Before you finish

| Pattern | Fix |

| --- | --- |

| outline: none or outline-none with no focus-visible replacement nearby | Restore the browser ring or add a verified custom one |

| <div onClick or <span onClick | Use <button>, or <a href> when it navigates |

| role="button" or role="tab" with no onKeyDown | Use the native element, or implement the APG key map |

| tabIndex={1} or any positive tabindex | Fix the DOM order and use 0 |

| disabled={!isValid} on a submit button | Keep it enabled and validate on submit |

| {msg && <div role="status">, region mounted with its text | Render the empty region first and update its text |

| aria-live="assertive" on a success toast | role="status" |

| <img with no alt attribute | alt="" if decorative, otherwise describe the purpose |

| aria-label whose text omits the visible label | Start the name with the visible text |

| aria-hidden on an ancestor of a button, link or input | Remove it, or make the subtree inert |

| maximum-scale=1 or user-scalable=no | Remove it |

| Tooltip on a natively disabled control | Text beside it, or aria-disabled so it stays focusable |

| onDragStart or a drag library with no button alternative | Add a single-pointer path to the same result |

Reporting

Severity. HIGH prevents a task, hides content from assistive technology or creates a systemic failure. MEDIUM makes an interaction meaningfully harder. LOW is isolated polish. This domain's share of better-interface's escalation triggers is HIGH on sight. That is a missing accessible name, a missing focus indicator and a pointer path with no keyboard path. It is also motion ignoring reduced motion, loss at 320px or 200% and meaning carried by color alone.

Verification. Without a browser: accessible names on every interactive element, keyboard handlers on non-native controls, focus styles, prefers-reduced-motion guards and form labels bound to their inputs. With one: tab the flow in order, read computed names and roles from the accessibility tree, confirm a visible focus indicator at every stop and run an automated audit. Report every check you could not run as Not verified.

Format. Group findings under the principle each violates, ordered by severity, one row per root cause listing every location it appears in:

| Severity | Location | Before | After | Why |

| --- | --- | --- | --- | --- |

Location is path/to/file:line. Why names the WCAG criterion or principle and the user impact.

End with Block when any HIGH remains, Approve otherwise, leaving the rest in the table as work to do. Never Approve coverage you did not inspect. With nothing to report, state "No actionable accessibility findings" and report verification.

常見問題

better-accessibility 技能有什麼用途?

檢查和改善焦點狀態、鍵盤支援、ARIA、表單、螢幕閱讀器、觸擊區域和動作的無障礙功能。

如何安裝 better-accessibility?

打開本頁的「安裝」區塊並選擇你的代理 — Claude Code、Codex、Cursor 或 Gemini CLI:那裡有把技能資料夾複製到正確位置的現成指令。也可以複製「透過助理」分頁中的提示,讓助理自行檢查並安裝技能。

better-accessibility 適用哪些 AI 模型?

技能是純 Markdown 指示(Agent Skills 格式),因此 better-accessibility 適用任何讀取 SKILL.md 的代理:Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot、OpenCode 等。只有在任務符合技能描述時,模型才會載入指示。

better-accessibility 是免費的嗎?

此技能由 jakubkrehel 公開發布,採用 MIT 授權。技能本身免費 — 你只需向 AI 供應商支付實際使用的 token 費用。

安裝技能安全嗎?

技能是代理會遵循的指示,安裝前請閱讀 SKILL.md 及相關檔案。技能資料夾中的腳本只有在代理執行時才會運行 — 留意它的動作,不要授予多餘權限。

技能和 MCP 伺服器或外掛有何不同?

MCP 伺服器或外掛為模型提供新工具 — 會執行並回傳結果的程式碼。技能提供的是知識與流程:如何處理任務、要遵循哪些步驟、好的成果長什麼樣子。它不需要伺服器或 API 金鑰。

相關技能

所有技能 →
better-colors OKLCH 色彩空間適用於網頁專案,能夠將 hex/rgb/hsl 轉換為 oklch,生成色板,檢查對比度,處理色域邊界,並使用 Tailwind v4 建立主題,支援 oklch、顏色轉換、色板生成、對比度比率、色域、display p3、設計令牌、色調漂移、色度、暗黑模式顏色等功能。 jakubkrehel8.6k better-interface 進行介面可及性、佈局、書寫、字型、色彩和視覺呈現的全面評估。 jakubkrehel8.6k better-typography 網頁字型學從選擇字型到間距、換行和無障礙設計。使用於選擇或組合字型風格、設定可變字型或OpenType功能、建立字型尺度、在元件中樣式化文字、裁剪文字、樣式化下劃線、突出顯示、佔位符或遊標,或檢查前端程式碼的字型學。適用於字型學、字型、字型格式、woff2、可變字型、font-weight、opentype、font-feature-settings、letter-spacing、line-height、字型尺度、表格數字、text-wrap、裁剪、line clamp、下劃線、text-decoration、文字突出顯示、iOS 輸入縮放、字型平滑、文字對比、大小、行長、文字欄、智慧標點符號、drop cap。 jakubkrehel8.6k better-writing 改善使用者體驗的寫作,包括介面標籤、錯誤、空狀態、設定、通知和產品順序。 jakubkrehel8.6k oklch-skill 實用工作流程色彩OKLCH技術,打造一致、易用且可客製化的色彩系統於現代使用者介面。 jakubkrehel frontend-ui-engineering 前端UI工程指南,涵蓋元件架構、響應式設計、無障礙和可維護的實現範本。 addyosmani111k