Communitygithub.com

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

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

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

このスキルは、スクリーンリーダーやスイッチコントロール、キーボードナビゲーションを使用するユーザーを含むすべてのユーザーがデジタルインターフェースを知覚可能、操作可能、理解可能、かつ堅牢(POUR)にするための知識と手順を提供します。主にWCAG 2.2の達成基準の技術的な実装に焦点を当てており、Web(HTML/ARIA)、iOS(SwiftUI)、Android(Jetpack Compose)のクロスプラットフォームに対応しています。このスキルは、UIコンポーネントの仕様定義、既存コードのアクセシビリティ監査、新しいWCAG 2.2基準(ターゲットサイズ最小値、フォーカス表示など)の実装、高レベルなデザイン要件からARIAロールやアクセシビリティラベルなどの技術的属性へのマッピングを支援します。具体的な手順として、コンポーネントの役割の特定、知覚可能な属性の定義、操作可能なコントロールの実装、理解可能なロジックの確保、堅牢な互換性の検証を段階的に行い、反復パターンや推奨されないアンチパターンも示します。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/affaan-m/ECC/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 Component"] --> Platform{Platform?}
  Platform -->|Web| ARIA["WAI-ARIA + HTML5"]
  Platform -->|iOS| SwiftUI["Accessibility Traits + Labels"]
  Platform -->|Android| Compose["Semantics + ContentDesc"]

  ARIA --> AT["Assistive Technology (Screen Readers, Switches)"]
  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/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

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.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

api-connector-builder

Build a new API connector or provider by matching the target repo

関連スキル