Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

wcag-keyboard-navigation

БесплатноБез исполняемых скриптовНе проверен

Use when building or reviewing keyboard-only support or a modal, drawer or popover's focus handling: WCAG 2.2 keyboard access, no keyboard traps, shortcuts…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

wcag-keyboard-navigation

Reference catalog for how to verify keyboard-navigation conformance. Pairs with the scanner umbrella axe-a11y (axe-core, pa11y, Lighthouse a11y).

Overview

WCAG 2.2 organizes accessibility into four principles - Perceivable / Operable / Understandable / Robust - at three conformance levels - A / AA / AAA (wcag22).

Keyboard navigation lives under Operable (Principle 2) and spans six key Success Criteria covering keyboard operability, focus management, and focus visibility.

When to use

  • Reviewing a component's keyboard interaction surface during PR review.
  • Authoring a keyboard-navigation test plan for a new component.
  • Triaging an accessibility audit finding tagged with one of the SCs below.
  • Configuring per-rule severities for axe-a11y.

Success Criteria

SC 2.1.1 - Keyboard (Level A)

Per wcag22: "All functionality of the content is operable through a keyboard interface" without requiring specific timings. Path-dependent input (handwriting) is exempt.

Pattern What to test
<button>, <a href>, <input> Native - already keyboard-accessible.
<div onclick="..."> Anti-pattern. Non-focusable; not keyboard-operable. Convert to <button>.
Custom widget (role="button", tabindex="0") Verify Enter / Space activates the same handler.
Drag-and-drop Provide a keyboard alternative (arrow keys + Enter, or button-based reorder).

Test script (Playwright):

test('SC 2.1.1 - interactive elements are keyboard-operable', async ({ page }) => {
  // Tab to the button, activate with Enter
  await page.keyboard.press('Tab');
  await page.keyboard.press('Enter');
  await expect(page.locator('[data-testid="action-result"]')).toBeVisible();

  // Repeat with Space for elements that should accept Space
  await page.keyboard.press('Tab');
  await page.keyboard.press('Space');
  await expect(...).toBeVisible();
});

SC 2.1.2 - No Keyboard Trap (Level A)

Per wcag22: "Focus must be movable away using standard methods; users should be informed of exit procedures if non- standard keys are required."

Common failure Fix
Modal traps Tab without an explicit Escape handler Add Escape handler that closes the modal and restores focus.
Embedded <iframe> (e.g. third-party widget) traps Tab Set tabindex="-1" on the iframe OR document the exit (Esc + Tab) in surrounding label.
Custom date picker locks focus inside on first focus Provide Tab to exit the calendar and continue to the next field.

See references/focus-trap.md for the intentional-trap convention (modal focus management) which is distinct from a violation.

SC 2.1.4 - Character Key Shortcuts (Level A, added in 2.1)

Single-character shortcuts (/ to focus search, j/k to navigate items) must offer at least one of:

  • Off mechanism - user can disable the shortcut globally.
  • Remap mechanism - user can rebind to non-character or modifier-prefixed combinations.
  • Active only on focus - shortcut active only when the associated component has focus.

This SC exists because users with speech-input software produce spurious key presses; unguarded single-character shortcuts trigger unintended actions.

SC 2.4.3 - Focus Order (Level A)

Per wcag22: components must "receive focus in an order that preserves meaning and operability."

Pattern What to test
Reading-order vs DOM-order vs visual-order All three should agree. CSS order / flex-direction: row-reverse can desync visual from DOM.
tabindex="3" (positive) Anti-pattern. Positive tabindex creates explicit focus order separate from DOM; rarely intended. Use 0 or -1.
Modal that doesn't trap focus Tab moves focus to the page behind; user loses context.
Skip links Always at the start of the document; tabindex="0" not needed (anchor links are focusable).

SC 2.4.7 - Focus Visible (Level AA)

Per wcag22: "Any keyboard operable user interface has a mode of operation where the key

Полный SKILL.md на GitHub

Установить wcag-keyboard-navigation в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonevals/aa-signoff-on-a-checkout-with-two-sticky-bars/criteria.jsonevals/aa-signoff-on-a-checkout-with-two-sticky-bars/task.mdevals/kanban-cards-that-only-move-by-mouse/criteria.jsonevals/kanban-cards-that-only-move-by-mouse/task.mdevals/power-user-shortcuts-archiving-mail-nobody-touched/criteria.jsonevals/power-user-shortcuts-archiving-mail-nobody-touched/task.mdevals/procurement-audit-finding-on-our-hand-rolled-dialog/criteria.jsonevals/procurement-audit-finding-on-our-hand-rolled-dialog/task.mdevals/tab-strip-where-arrows-move-the-panel-but-not-the-reader/criteria.jsonevals/tab-strip-where-arrows-move-the-panel-but-not-the-reader/task.mdreferences/focus-trap.md

FAQ

Что делает скилл wcag-keyboard-navigation?

Use when building or reviewing keyboard-only support or a modal, drawer or popover's focus handling: WCAG 2.2 keyboard access, no keyboard traps, shortcuts, focus order, visible and unobscured focus, with test scripts and the focus-trap pattern (focus on open, Escape, restore).

Как установить скилл wcag-keyboard-navigation?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл wcag-keyboard-navigation запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить wcag-keyboard-navigation с