Communitygithub.com

アクセシビリティ(WCAG 2.2)

WCAG 2.2 レベルAAに準拠したデジタルプロダクトの設計、実装、監査を行います。キーボード、コントラスト、スクリーンリーダーのサポートが必要なUIの構築やレビューの際に使用します。

アクセシビリティ(WCAG 2.2) とは?

このスキルは、スクリーンリーダーやスイッチコントロール、キーボードナビゲーションを使用するユーザーを含むすべてのユーザーに対して、デジタルインターフェースを知覚可能、操作可能、理解可能、かつ堅牢(POUR)にするためのものです。Web、iOS、Androidの各プラットフォーム向けの技術的な実装に焦点を当て、WCAG 2.2の達成基準(ターゲットサイズ最小値、フォーカス表示など)を実装・監査する際に役立ちます。このスキルは、セマンティックマッピング、フォーカス管理、ARIA属性、ネイティブアクセシビリティAPIを活用して、アクセシビリティツリーに正しい情報を提供します。開発者は、コンポーネントのロール特定から知覚可能属性の定義、操作可能なコントロールの実装、理解可能なロジックの確保、堅牢な互換性の検証までのステップバイステップのプロセスに従うことで、包括的なUIを構築できます。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/accessibility

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

アクセシビリティ(WCAG 2.2) は何をしますか?

このスキルは、スクリーンリーダー、スイッチコントロール、キーボードナビゲーションを使用するユーザーを含むすべてのユーザーに対して、デジタルインターフェースを知覚可能、操作可能、理解可能、かつ堅牢(POUR)にします。WCAG 2.2達成基準の技術的実装に焦点を当てています。

使用するタイミング

  • Web、iOS、Android向けのUIコンポーネント仕様を定義する場合。
  • 既存のコードにアクセシビリティの障壁や準拠のギャップがないか監査する場合。
  • ターゲットサイズ(最小)やフォーカス表示などの新しいWCAG 2.2基準を実装する場合。
  • 高レベルのデザイン要件を技術的属性(ARIAロール、トレイト、ヒント)にマッピングする場合。

中核概念

  • POUR原則: WCAGの基礎(知覚可能、操作可能、理解可能、堅牢)。
  • セマンティックマッピング: 汎用コンテナではなくネイティブ要素を使用して、組み込みのアクセシビリティを提供する。
  • アクセシビリティツリー: 支援技術が実際に「読み取る」UIの表現。
  • フォーカス管理: キーボード/スクリーンリーダーカーソルの順序と可視性を制御する。
  • ラベリングとヒント: aria-label、accessibilityLabel、contentDescriptionを通じてコンテキストを提供する。

仕組み

ステップ1: コンポーネントのロールを特定する

機能的な目的を判断します(例: これはボタンか、リンクか、タブか?)。カスタムロールに頼る前に、最もセマンティックなネイティブ要素を使用します。

ステップ2: 知覚可能属性を定義する

  • テキストのコントラストが4.5:1(標準)または3:1(大テキスト/UI)であることを確認します。
  • テキスト以外のコンテンツ(画像、アイコン)にテキスト代替を追加します。
  • レスポンシブリフロー(400%ズームまで機能を失わずに表示)を実装します。

ステップ3: 操作可能なコントロールを実装する

  • 最小24x24 CSSピクセルのターゲットサイズを確保します(WCAG 2.2 SC 2.5.8)。
  • すべてのインタラクティブ要素がキーボードで到達可能であり、可視のフォーカスインジケータがあることを確認します(SC 2.4.11)。
  • ドラッグ操作に代わる単一ポインタ操作を提供します。

ステップ4: 理解可能なロジックを確保する

  • 一貫したナビゲーションパターンを使用します。
  • 説明的なエラーメッセージと修正の提案を提供します(SC 3.3.3)。
  • 「冗長な入力」を避けるために、同じデータを二度要求しないようにします(SC 3.3.7)。

ステップ5: 堅牢な互換性を検証する

  • 正しいName, Role, Valueパターンを使用します。
  • 動的なステータス更新にはaria-liveまたはライブリージョンを実装します。

アクセシビリティアーキテクチャ図

flowchart TD
  UI["UI コンポーネント"] --> Platform{プラットフォーム?}
  Platform -->|Web| ARIA["WAI-ARIA + HTML5"]
  Platform -->|iOS| SwiftUI["アクセシビリティトレイト + ラベル"]
  Platform -->|Android| Compose["セマンティクス + ContentDesc"]

  ARIA --> AT["支援技術(スクリーンリーダー、スイッチ)"]
  SwiftUI --> AT
  Compose --> AT

クロスプラットフォームマッピング

機能Web (HTML/ARIA)iOS (SwiftUI)Android (Compose)
プライマリラベルaria-label / <label>.accessibilityLabel()contentDescription
セカンダリヒントaria-describedby.accessibilityHint()Modifier.semantics { stateDescription = ... }
アクションロールrole="button".accessibilityAddTraits(.isButton)Modifier.semantics { role = Role.Button }
ライブ更新aria-live="polite".accessibilityLiveRegion(.polite)Modifier.semantics { liveRegion = LiveRegionMode.Polite }

例

Web: アクセシブルな検索

<form role="search">
  <label for="search-input" class="sr-only">商品を検索</label>
  <input type="search" id="search-input" placeholder="検索..." />
  <button type="submit" aria-label="検索を実行">
    <svg aria-hidden="true">...</svg>
  </button>
</form>

iOS: アクセシブルなアクションボタン

Button(action: deleteItem) {
    Image(systemName: "trash")
}
.accessibilityLabel("アイテムを削除")
.accessibilityHint("このアイテムをリストから完全に削除します")
.accessibilityAddTraits(.isButton)

Android: アクセシブルなトグル

Switch(
    checked = isEnabled,
    onCheckedChange = { onToggle() },
    modifier = Modifier.semantics {
        contentDescription = "通知を有効にする"
    }
)

避けるべきアンチパターン

  • Divボタン: ロールとキーボードサポートを追加せずに、クリックイベントのために<div>や<span>を使用する。
  • 色のみの意味: 色の変更だけでエラーやステータスを示す(例: 境界線を赤くするだけ)。
  • フォーカスを閉じ込めないモーダル: フォーカスをトラップしないモーダル。キーボードユーザーがモーダルを開いている間に背景コンテンツを操作できてしまう。フォーカスはモーダル内に閉じ込められ、かつEscapeキーまたは明示的な閉じるボタンで脱出できる必要があります(WCAG SC 2.1.2)。
  • 冗長な代替テキスト: 代替テキストで「〜の画像」や「〜の写真」を使用する(スクリーンリーダーはすでにロール「画像」を読み上げます)。

ベストプラクティスチェックリスト

  • インタラクティブ要素が24x24px(Web)または44x44pt(ネイティブ)のターゲットサイズを満たしている。
  • フォーカスインジケータが明確に見え、ハイコントラストである。
  • モーダルが開いている間はフォーカスを閉じ込め、閉じるときにクリーンに解放する(Escapeキーまたは閉じるボタン)。
  • ドロップダウンとメニューは、閉じたときにトリガー要素にフォーカスを戻す。
  • フォームがテキストベースのエラー提案を提供する。
  • アイコンのみのボタンにはすべて、説明的なテキストラベルがある。
  • テキストを拡大したときにコンテンツが適切にリフローする。

参考文献

関連スキル

  • frontend-patterns
  • design-system
  • liquid-glass-design
  • swiftui-patterns

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

関連スキル