Skip to main content
skill CX Codex

accessibility-wcag — Claude Code skill: what it does, how to install

The accessibility-wcag skill for Claude Code provides WCAG 2.2 patterns for semantic HTML, ARIA dialogs, keyboard navigation, and color contrast.

Apache-2.0 ★ 2,858 updated 2026-05-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add rohitg00/awesome-claude-code-toolkit --skill accessibility-wcag -a claude-code
Open on GitHub

What accessibility-wcag does

This skill injects WCAG 2.2 AA accessibility patterns into the coding assistant. It covers structural landmarks such as <main> and <nav>, along with React implementations for modal dialogs and arrow-key tab navigation.

Form guidelines require explicit label bindings, aria-describedby hints, and screen-reader announcements via role="alert". The styling rules enforce minimum contrast ratios: 4.5:1 for standard text and 3:1 for larger typography.

Relying on color alone for errors breaks compliance under these guidelines. The skill specifically flags hidden focus rings and non-semantic interactive div elements as anti-patterns.

What it helps with

  • implement arrow-key navigation and Escape handling for dialogs
  • wire form inputs with accessible labels and alert announcements
  • verify text contrast against WCAG AA requirements
  • replace interactive div elements with semantic landmarks

Example prompts for the agent

  • Make this tab component accessible with arrow-key navigation and ARIA attributes.
  • Review this signup form against WCAG 2.2 and attach proper error alerts.
  • Add visible focus-visible outlines and check the button color contrast.

How to install accessibility-wcag

1Skills CLI (Vercel)

npx skills add rohitg00/awesome-claude-code-toolkit --skill accessibility-wcag -a claude-code

2Manually: put the files in place

~/.claude/skills/accessibility-wcag/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/accessibility-wcag/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about accessibility-wcag

How to install accessibility-wcag in Claude Code?

Run npx skills add rohitg00/awesome-claude-code-toolkit --skill accessibility-wcag -a claude-code. You can also place the skill file directly at ~/.claude/skills/accessibility-wcag/SKILL.md.

What does accessibility-wcag do?

It equips Claude Code with WCAG 2.2 accessibility recipes and an audit checklist. The assistant uses it to generate accessible HTML, ARIA widgets, and keyboard handlers.

Which contrast ratios does this skill mandate?

It mandates a contrast ratio of at least 4.5:1 for regular text and 3:1 for large text. It also insists on visible focus indicators.

Source text

SKILL.md · Apache-2.0
---
name: accessibility-wcag
description: Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing
---

# Accessibility & WCAG

## Semantic HTML

```html
<!-- Use semantic elements instead of generic divs -->
<header>
  <nav aria-label="Main navigation">
    <ul>
      <li><a href="/" aria-current="page">Home</a></li>
      <li><a href="/products">Products</a></li>
      <li><a href="/about">About</a></li>
    </ul>
  </nav>
</header>

<main>
  <article>
    <h1>Product Details</h1>
    <section aria-labelledby="specs-heading">
      <h2 id="specs-heading">Specifications</h2>
      <dl>
        <dt>Weight</dt>
        <dd>1.2 kg</dd>
        <dt>Dimensions</dt>
        <dd>30 x 20 x 10 cm</dd>
      </dl>
    </section>
  </article>
</main>

<footer>
  <p>&copy; 2024 Company Name</p>
</footer>
```

Use `<nav>`, `<main>`, `<article>`, `<section>`, `<aside>` instead of `<div>` for landmarks. Screen readers use these to navigate the page.

## ARIA Patterns

```tsx
function Modal({ isOpen, onClose, title, children }) {
  if (!isOpen) return null;

  return (
    <div
      role="dialog"
      aria-modal="true"
      aria-labelledby="modal-title"
      onKeyDown={(e) => e.key === "Escape" && onClose()}
    >
      <h2 id="modal-title">{title}</h2>
      <div>{children}</div>
      <button onClick={onClose} aria-label="Close dialog">
        <XIcon aria-hidden="true" />
      </button>
    </div>
  );
}

function Tabs({ tabs, activeIndex, onChange }) {
  return (
    <div>
      <div role="tablist" aria-label="Settings sections">
        {tabs.map((tab, i) => (
          <button
            key={tab.id}
            role="tab"
            id={`tab-${tab.id}`}
            aria-selected={i === activeIndex}
            aria-controls={`panel-${tab.id}`}
            tabIndex={i === activeIndex ? 0 : -1}
            onClick={() => onChange(i)}
            onKeyDown={(e) => handleArrowKeys(e, i, tabs.length, onChange)}
          >
            {tab.label}
          </button>
        ))}
      </div>
      {tabs.map((tab, i) => (
        <div
          key={tab.id}
          role="tabpanel"
          id={`panel-${tab.id}`}
          aria-labelledby={`tab-${tab.id}`}
          hidden={i !== activeIndex}
          tabIndex={0}
        >
          {tab.content}
        </div>
      ))}
    </div>
  );
}
```

## Keyboard Navigation

```tsx
function handleArrowKeys(
  event: React.KeyboardEvent,
  currentIndex: number,
  totalItems: number,
  onSelect: (index: number) => void
) {
  let newIndex = currentIndex;

  switch (event.key) {
    case "ArrowRight":
    case "ArrowDown":
      newIndex = (currentIndex + 1) % totalItems;
      break;
    case "ArrowLeft":
    case "ArrowUp":
      newIndex = (currentIndex - 1 + totalItems) % totalItems;
      break;
    case "Home":
      newIndex = 0;
      break;
    case "End":
      newIndex = totalItems - 1;
      break;
    default:
      return;
  }

  event.preventDefault();
  onSelect(newIndex);
}
```

All interactive elements must be reachable via keyboard. Tab for focus navigation, Enter/Space for activation, Arrow keys for within-component navigation.

## Form Accessibility

```tsx
function SignupForm() {
  return (
    <form aria-labelledby="form-title" noValidate>
      <h2 id="form-title">Create Account</h2>

      <div>
        <label htmlFor="email">Email address</label>
        <input
          id="email"
          type="email"
          required
          aria-required="true"
          aria-describedby="email-hint email-error"
          aria-invalid={hasError ? "true" : undefined}
        />
        <p id="email-hint">We will never share your email.</p>
        {hasError && (
          <p id="email-error" role="alert">
            Please enter a valid email address.
          </p>
        )}
      </div>

      <button type="submit">Create Account</button>
    </form>
  );
}
```

## Color and Contrast

```css
:root {
  --text-primary: #1a1a1a;      /* 15.3:1 on white */
  --text-secondary: #595959;    /* 7.0:1 on white */
  --text-on-primary: #ffffff;   /* Ensure 4.5:1 on brand color */
  --border-focus: #0066cc;      /* Visible focus ring */
}

*:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

.error-message {
  color: #d32f2f;
  /* Don't rely on color alone - add icon or text prefix */
}
.error-message::before {
  content: "Error: ";
  font-weight: bold;
}
```

WCAG AA requires 4.5:1 contrast for normal text, 3:1 for large text (18px bold or 24px regular).

## Anti-Patterns

- Using `div` and `span` for clickable elements instead of `button` or `a`
- Removing focus outlines without providing an alternative indicator
- Relying on color alone to convey information (red for error, green for success)
- Using `aria-label` when visible text already labels the element
- Auto-playing media without a pause mechanism
- Missing skip navigation link for keyboard users

## Checklist

- [ ] All interactive elements keyboard-accessible (Tab, Enter, Escape, Arrows)
- [ ] Semantic HTML landmarks used (`nav`, `main`, `article`, `section`)
- [ ] Images have descriptive `alt` text (or `alt=""` for decorative)
- [ ] Color contrast meets WCAG AA (4.5:1 normal text, 3:1 large text)
- [ ] Focus indicators visible on all interactive elements
- [ ] Form inputs have associated `<label>` elements
- [ ] Error messages announced to screen readers via `role="alert"`
- [ ] Page tested with screen reader (VoiceOver, NVDA) and keyboard only

© rohitg00 · Apache-2.0 · rohitg00/awesome-claude-code-toolkit

Similar skills

All skills for Frontend and UI →

From the same set178

The whole set →
developer-portal Subagent for building internal developer portals using Backstage with service catalogs, project templates, and self-service infrastructure provisioning. Replaces scattered wikis and manual setup with unified discovery and CI/CD integration. CX Codex ★ 2,858repo stars websocket-realtime websocket-realtime provides real-time communication patterns for Claude Code, covering raw WebSocket implementations, Socket.io rooms, SSE, and Redis scaling. CX Codex +1 ★ 2,858repo stars monitoring-observability monitoring-observability is a Claude Code skill that adds tracing, metrics, structured logs, and alert rules to Node.js services. It connects application signals to dashboards and SLOs. CX Codex +1 ★ 2,858repo stars database-optimizer database-optimizer — a subagent that diagnoses slow queries, designs indexes, implements partitioning schemes, and plans capacity for PostgreSQL, MySQL, and distributed databases. CX Codex ★ 2,858repo stars content-strategist The content-strategist subagent plans SEO content, groups topics into clusters, and connects publishing work to performance metrics. It targets technical products and developer audiences. CX Codex ★ 2,858repo stars authentication-patterns authentication-patterns is a Claude Code skill with authentication and authorization patterns: JWT, OAuth2 with PKCE, role-based access control, and Express middleware. For securing a Node.js backend. CX Codex +1 ★ 2,858repo stars real-estate-tech real-estate-tech designs proptech platforms with MLS feeds, PostGIS spatial queries, property valuation models, and listing pipelines. Helps build property search and transaction backends. CX Codex ★ 2,858repo stars error-coordinator error-coordinator — a subagent classifies failures in multi-agent workflows, selects retry or fallback paths, and preserves the context needed for recovery. CX Codex ★ 2,858repo stars

Project sponsors

Companies that keep this analytics open