sfnext-accessibility
БесплатноБез исполняемых скриптовНе проверенBuild and fix accessible UI in a Storefront Next storefront (WCAG 2.1 AA): jsx-a11y lint findings, missing accessible names and labels, form error…
от SalesforceCommerceCloud★ 58 звёзд на GitHubОб этом скилле
Storefront Next Accessibility
Target: WCAG 2.1 AA. Accessibility is checked at three levels, cheapest first:
| Level | Tool | Catches |
|---|---|---|
| Lint | OxLint jsx-a11y (pnpm lint, pnpm lint:a11y) |
Missing alt/labels, invalid ARIA, non-interactive handlers, ambiguous link text |
| Component | Storybook a11y addon (axe) and play() assertions |
Contrast and name/role issues in a rendered state; focus, live regions, dialog behavior |
| Page | e2e axe scan (pnpm a11y) against e2e/a11y-baseline.json |
Page composition, layout, mobile vs desktop |
Some things no scanner finds: focus order, meaning carried by color alone, 200%/400% zoom reflow, and what a screen reader actually announces. Those need keyboard testing, a story play() assertion of the DOM facts behind them, or a human with assistive technology.
Author accessibly by default
- Use the project's building blocks; they are already accessible in the general case:
- Radix-based primitives in
src/components/ui/(dialog, dropdown-menu, sheet, tooltip, ...). FormLabel/FormControl/FormMessagefrom@/components/ui/formand the wrappers insrc/components/form-fields/(they wirearia-describedbyand invalid state from form context).src/components/product-imageandsrc/components/dynamic-image(alt text),src/components/radio-card(grouped options),src/components/skip-link.tsx(first focusable element, targets#main-content),src/components/announcement-banner.
- Radix-based primitives in
- Icon-only controls need a translated accessible name:
<Button aria-label={t('close')}>. Decorative icons getaria-hidden="true"and must not be focusable. - Every input needs a real label; errors must be programmatically associated and announced (form-field wrappers do this).
- Use semantic elements first (
button,a,ul,h1..h6); add ARIA only to fill gaps. Keep oneh1per page and do not skip levels. - Status changes that happen without navigation (cart updates, promo applied, errors) need an
aria-liveregion (role="status"orrole="alert"); the message must be rendered into an existing live region or the region must exist before content changes. - Dialogs and drawers: focus moves in on open, is trapped, returns to the trigger on close,
Escapecloses. Use the Radix dialog primitives rather than hand-rolling. - Respect
prefers-reduced-motion(seesrc/components/fade-through-imageandproduct-zoom-modalfor the pattern). - Keep visible focus styles; do not remove outlines without a replacement from the theme tokens.
- Do not "fix"
role="list"on aul: it is deliberate (Tailwind'slist-style: noneremoves list semantics in Safari + VoiceOver), and the lint config allows it.
Fix the right layer
Before editing a shared primitive, check the call site.
- Call-site fix (most common): the primitive is correct but the caller passed no
aria-label, a meaninglessalt, or bypassedFormLabel. Fix the caller. - Primitive fix: the shared component itself emits inaccessible markup. One change cascades to every usage, so keep it small and re-run the component's stories and snapshots.
- Many findings citing one primitive usually means one call-site pattern to correct, not a broken primitive.
Reproduce, fix, confirm
Do not call something fixed from reading code. Capture a failing signal first, then the same check passing afterwards.
- Name the state: default, form-error, modal-open, out-of-stock, focus-after-action, zoomed. Many violations only exist after interaction, which is why default-page scans come back clean.
- Reproduce:
- Lint rule:
pnpm lint:a11y. - Rendered axe rule: run the story with
STORYBOOK_A11Y_TEST_MODE=errorviapnpm storybook:test --type=a11y, or add the scenario to the e2e a11y specs. - Focus/label/live-region issues: write a
play()assertion (next section) and watch it fail.
- Lint rule:
- Fix at the right layer.
- Re-run the same check; also run the component's snapshot (
pnpm storybook:test --type=snapshot,--updateonly after reviewing the diff) andpnpm lint. - Never add a suppression (disabled axe rule,
oxlint-disable,aria-hidden) just to turn a check green. A suppression is acceptable only when it targets a node you do not control and the reason is written next to it.
Storybook: a11y addon and play() assertions
- Default addon mode is
todo(violations are shown, not failing).pnpm storybook:test --type=a11yruns in error mode, so violations fail.STORYBOOK_DISABLE_A11Y=trueturns it off. - Opt one story file into strict mode: spread
{ a11y: { test: 'error' } }intoparameters(seesrc/components/checkout/storybook/checkout-strict-a11y-parameters.ts). - Tag
skip-a11yexcludes a story from a11y runs. Use it rarely and comment why. - Assert accessible outcomes, not CSS classes:
play: async ({ canvasElement }) => {
await waitForStorybookReady(canvasElement);
const body = within(canvasElement.ownerDocument
Установить sfnext-accessibility в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл sfnext-accessibility?
Build and fix accessible UI in a Storefront Next storefront (WCAG 2.1 AA): jsx-a11y lint findings, missing accessible names and labels, form error association, dialog focus management, aria-live status messages, keyboard behavior, color contrast, and verifying fixes with Storybook a11y/play() tests and the e2e axe scan with its baseline. Use for "accessibility", "a11y", "WCAG", "screen reader", "aria-label", "focus trap", "axe violation", pnpm lint:a11y, pnpm a11y, a11y-baseline.json, skip-a11y, STORYBOOK_A11Y_TEST_MODE, or an accessibility audit finding to fix. Do not use for general lint/typecheck gates (use `storefront-next:sfnext-quality-gates`), writing non-accessibility tests (use `storefront-next:sfnext-testing`), or color/token design (use `storefront-next:sfnext-theming`).
Как установить скилл sfnext-accessibility?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sfnext-accessibility запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic