Communitygithub.com

WCAG監査パターン

自動テスト、手動検証、改善ガイダンスを用いたWCAG 2.2アクセシビリティ監査を実施します。Webサイトのアクセシビリティ監査、WCAG違反の修正、アクセシブルなデザインパターンの実装時に使用します。

WCAG監査パターン とは?

このスキルは、WCAG 2.2ガイドラインに基づく包括的なアクセシビリティ監査を可能にします。自動テストと手動検証を組み合わせ、クリティカルからマイナーまでの違反を特定し、具体的な修正パターンを提供します。主な対象プラットフォームはWebアプリケーションであり、axe-coreやPlaywrightを使った自動テストコード例、スクリーンリーダーやキーボード操作の検証手順を含みます。スキルはPOUR原則(知覚可能、操作可能、理解可能、堅牢)に沿って監査チェックリストを構造化しており、各チェック項目には実装例と修正方法が付属します。また、ADA/Section 508への準拠やVPAT文書作成にも役立ちます。開発プロセスにアクセシビリティを組み込むためのベストプラクティスとよくある誤りにも触れており、初心者から上級者まで利用可能です。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ulasalyesil/personal-website-v2/tree/HEAD/.agent/skills/wcag-audit-patterns

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

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

プレビュー

スキル README より

WCAG監査パターン preview
WCAG監査パターン preview

ドキュメント

WCAG監査パターン は何をしますか?

WCAG 2.2ガイドラインに基づくWebコンテンツ監査のための包括的ガイドと、具体的な改善戦略。

このスキルを使うべき場面

  • アクセシビリティ監査の実施
  • WCAG違反の修正
  • アクセシブルなコンポーネントの実装
  • アクセシビリティ訴訟への備え
  • ADA/Section 508要件への対応
  • VPAT準拠の達成

コアコンセプト

1. WCAG適合レベル

レベル説明必要となる状況
A最低限のアクセシビリティ法的基準線
AA標準的な適合ほとんどの規制
AAA拡張されたアクセシビリティ専門的なニーズ

2. POUR原則

知覚可能:ユーザーはコンテンツを知覚できるか?
操作可能:ユーザーはインターフェースを操作できるか?
理解可能:ユーザーはコンテンツを理解できるか?
堅牢:支援技術で動作するか?

3. 影響度別の一般的な違反

クリティカル(ブロッカー):
├── 機能画像の代替テキスト欠落
├── インタラクティブ要素へのキーボードアクセス不能
├── フォームラベルの欠落
└── コントロールなしの自動再生メディア

深刻:
├── 不十分な色のコントラスト
├── スキップリンクの欠落
├── アクセシブルでないカスタムウィジェット
└── ページタイトルの欠落

中程度:
├── 言語属性の欠落
├── 不明瞭なリンクテキスト
├── ランドマークの欠落
└── 不適切な見出し階層

監査チェックリスト

知覚可能(原則1)

## 1.1 テキスト代替

### 1.1.1 非テキストコンテンツ(レベルA)

- [ ] すべての画像に代替テキストがある
- [ ] 装飾画像にはalt=""を設定
- [ ] 複雑な画像には長い説明がある
- [ ] 意味のあるアイコンにアクセシブルな名前がある
- [ ] CAPTCHAに代替手段がある

確認:

```html
<!-- 良い例 -->
<img src="chart.png" alt="売上が第1四半期から第2四半期で25%増加" />
<img src="decorative-line.png" alt="" />

<!-- 悪い例 -->
<img src="chart.png" />
<img src="decorative-line.png" alt="装飾線" />
```

1.2 時間ベースのメディア

1.2.1 音声のみおよび映像のみ(レベルA)

  • 音声にはテキストトランスクリプトがある
  • 映像に音声解説またはトランスクリプトがある

1.2.2 キャプション(レベルA)

  • すべての映像に同期キャプションがある
  • キャプションは正確で完全である
  • 発言者識別を含む

1.2.3 音声解説(レベルA)

  • 映像に視覚コンテンツの音声解説がある

1.3 適応可能

1.3.1 情報および関係性(レベルA)

  • 見出しに適切なタグ(h1-h6)を使用
  • リストにul/ol/dlを使用
  • テーブルに見出しがある
  • フォーム入力にラベルがある
  • ARIAランドマークが存在する

確認:

<!-- 見出し階層 -->
<h1>ページタイトル</h1>
<h2>セクション</h2>
<h3>サブセクション</h3>
<h2>別のセクション</h2>

<!-- テーブル見出し -->
<table>
  <thead>
    <tr>
      <th scope="col">名前</th>
      <th scope="col">価格</th>
    </tr>
  </thead>
</table>

1.3.2 意味のあるシーケンス(レベルA)

  • 読み取り順が論理的である
  • CSSの配置によって順序が崩れていない
  • フォーカス順が視覚的な順序と一致する

1.3.3 感覚的な特性(レベルA)

  • 指示が形状や色のみに依存していない
  • 「赤いボタンをクリック」→「送信(赤いボタン)をクリック」

1.4 識別可能

1.4.1 色の使用(レベルA)

  • 色が情報伝達の唯一の手段ではない
  • リンクが色なしで区別可能
  • エラー状態が色のみで示されていない

1.4.3 コントラスト(最低限)(レベルAA)

  • テキスト:4.5:1のコントラスト比
  • 大きなテキスト(18pt以上):3:1の比率
  • UIコンポーネント:3:1の比率

ツール:WebAIMコントラストチェッカー、axe DevTools

1.4.4 テキストのサイズ変更(レベルAA)

  • テキストが200%まで損なわれずに拡大可能
  • 320pxで水平スクロールが発生しない
  • コンテンツが適切にリフローする

1.4.10 リフロー(レベルAA)

  • 400%ズームでコンテンツがリフローする
  • 2次元スクロールがない
  • 320px幅で全コンテンツがアクセス可能

1.4.11 非テキストのコントラスト(レベルAA)

  • UIコンポーネントに3:1のコントラストがある
  • フォーカスインジケーターが可視
  • グラフィカルオブジェクトが区別可能

1.4.12 テキスト間隔(レベルAA)

  • 間隔を広げてもコンテンツ損失がない
  • 行の高さがフォントサイズの1.5倍
  • 段落間隔がフォントサイズの2倍
  • 文字間隔がフォントサイズの0.12倍
  • 単語間隔がフォントサイズの0.16倍

### 操作可能(原則2)

```markdown
## 2.1 キーボードアクセス可能

### 2.1.1 キーボード(レベルA)
- [ ] すべての機能がキーボードで操作可能
- [ ] キーボードトラップがない
- [ ] タブ順序が論理的である
- [ ] カスタムウィジェットがキーボード操作可能

確認:
```javascript
// カスタムボタンはキーボードアクセス可能である必要がある
<div role="button" tabindex="0"
     onkeydown="if(event.key === 'Enter' || event.key === ' ') activate()">
```

### 2.1.2 キーボードトラップの禁止(レベルA)

- [ ] すべてのコンポーネントからフォーカスを移動できる
- [ ] モーダルダイアログがフォーカスを正しくトラップする
- [ ] モーダル閉鎖後にフォーカスが戻る

## 2.2 十分な時間

### 2.2.1 調整可能なタイミング(レベルA)

- [ ] セッションタイムアウトを延長できる
- [ ] タイムアウト前にユーザーに警告する
- [ ] 自動リフレッシュを無効にするオプションがある

### 2.2.2 一時停止、停止、非表示(レベルA)

- [ ] 動くコンテンツを一時停止できる
- [ ] 自動更新コンテンツを一時停止できる
- [ ] アニメーションがprefers-reduced-motionを尊重する

```css
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
```

## 2.3 発作と身体的反応

### 2.3.1 3回の閃光(レベルA)

- [ ] 毎秒3回以上の閃光がない
- [ ] 閃光領域が小さい(ビューポートの25%未満)

## 2.4 ナビゲート可能

### 2.4.1 ブロックのバイパス(レベルA)

- [ ] 「メインコンテンツへスキップ」リンクがある
- [ ] ランドマーク領域が定義されている
- [ ] 適切な見出し構造

```html
<a href="#main" class="skip-link">メインコンテンツへスキップ</a>
<main id="main">...</main>
```

### 2.4.2 ページタイトル(レベルA)

- [ ] ユニークで説明的なページタイトル
- [ ] タイトルがページコンテンツを反映している

### 2.4.3 フォーカス順序(レベルA)

- [ ] フォーカス順序が視覚順序と一致する
- [ ] tabindexが正しく使用されている

### 2.4.4 リンクの目的(コンテキスト内)(レベルA)

- [ ] リンクがコンテキストから切り離されても意味が通じる
- [ ] 「ここをクリック」や「続きを読む」のみのリンクがない

```html
<!-- 悪い例 -->
<a href="report.pdf">ここをクリック</a>

<!-- 良い例 -->
<a href="report.pdf">Q4販売レポートをダウンロード(PDF)</a>
```

### 2.4.6 見出しとラベル(レベルAA)

- [ ] 見出しがコンテンツを説明している
- [ ] ラベルが目的を説明している

### 2.4.7 フォーカスの可視化(レベルAA)

- [ ] すべての要素にフォーカスインジケーターが可視
- [ ] カスタムフォーカススタイルがコントラスト要件を満たす

```css
:focus {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}
```

### 2.4.11 フォーカスが隠されていない(レベルAA) - WCAG 2.2

- [ ] フォーカスされた要素が完全に隠れていない
- [ ] スティッキーヘッダーがフォーカスを隠さない

理解可能(原則3)

## 3.1 読み取り可能

### 3.1.1 ページの言語(レベルA)
- [ ] HTMLにlang属性が設定されている
- [ ] 言語がコンテンツに正しい

```html
<html lang="ja">

3.1.2 部分の言語(レベルAA)

  • 言語の変更がマークされている
<p>フランス語の単語 <span lang="fr">bonjour</span> は「こんにちは」を意味します。</p>

3.2 予測可能

3.2.1 フォーカス時(レベルA)

  • フォーカスのみでコンテキストが変わらない
  • フォーカス時に予期しないポップアップが表示されない

3.2.2 入力時(レベルA)

  • フォームが自動送信されない
  • コンテキスト変更前にユーザーに警告する

3.2.3 一貫したナビゲーション(レベルAA)

  • ナビゲーションがページ間で一貫している
  • 繰り返されるコンポーネントが同じ順序

3.2.4 一貫した識別(レベルAA)

  • 同じ機能には同じラベル
  • アイコンが一貫して使用されている

3.3 入力支援

3.3.1 エラー識別(レベルA)

  • エラーが明確に識別されている
  • エラーメッセージが問題を説明している
  • エラーがフィールドにリンクされている
<input aria-describedby="email-error" aria-invalid="true" />
<span id="email-error" role="alert">有効なメールアドレスを入力してください</span>

3.3.2 ラベルまたは指示(レベルA)

  • すべての入力に可視ラベルがある
  • 必須フィールドが示されている
  • 形式のヒントが提供されている

3.3.3 エラー提案(レベルAA)

  • エラーに修正提案が含まれている
  • 提案が具体的である

3.3.4 エラー防止(レベルAA)

  • 法律/金融フォームが元に戻せる
  • 送信前にデータがチェックされる
  • 送信前にユーザーが確認できる

### 堅牢(原則4)

```markdown
## 4.1 互換性

### 4.1.1 解析(レベルA) - WCAG 2.2では廃止
- [ ] 有効なHTML(良い習慣)
- [ ] 重複IDがない
- [ ] 開始/終了タグが完全

### 4.1.2 名前、役割、値(レベルA)
- [ ] カスタムウィジェットにアクセシブルな名前がある
- [ ] ARIAロールが正しい
- [ ] 状態変更が通知される

```html
<!-- アクセシブルなカスタムチェックボックス -->
<div role="checkbox"
     aria-checked="false"
     tabindex="0"
     aria-labelledby="label">
</div>
<span id="label">利用規約に同意する</span>
```

### 4.1.3 ステータスメッセージ(レベルAA)

- [ ] ステータス更新が通知される
- [ ] ライブリージョンが正しく使用されている

```html
<div role="status" aria-live="polite">3個のアイテムがカートに追加されました</div>

<div role="alert" aria-live="assertive">エラー:フォーム送信に失敗しました</div>
```

自動テスト

// axe-coreの統合
const axe = require('axe-core');

async function runAccessibilityAudit(page) {
  await page.addScriptTag({ path: require.resolve('axe-core') });

  const results = await page.evaluate(async () => {
    return await axe.run(document, {
      runOnly: {
        type: 'tag',
        values: ['wcag2a', 'wcag2aa', 'wcag21aa', 'wcag22aa']
      }
    });
  });

  return {
    violations: results.violations,
    passes: results.passes,
    incomplete: results.incomplete
  };
}

// Playwrightテストの例
test('アクセシビリティ違反がないこと', async ({ page }) => {
  await page.goto('/');
  const results = await runAccessibilityAudit(page);

  expect(results.violations).toHaveLength(0);
});
# CLIツール
npx @axe-core/cli https://example.com
npx pa11y https://example.com
lighthouse https://example.com --only-categories=accessibility

修正パターン

修正:フォームラベルの欠落

<!-- 修正前 -->
<input type="email" placeholder="メール" />

<!-- 修正後:オプション1 - 可視ラベル -->
<label for="email">メールアドレス</label>
<input id="email" type="email" />

<!-- 修正後:オプション2 - aria-label -->
<input type="email" aria-label="メールアドレス" />

<!-- 修正後:オプション3 - aria-labelledby -->
<span id="email-label">メール</span>
<input type="email" aria-labelledby="email-label" />

修正:不十分な色のコントラスト

/* 修正前:2.5:1のコントラスト */
.text {
  color: #767676;
}

/* 修正後:4.5:1のコントラスト */
.text {
  color: #595959;
}

/* または背景を追加 */
.text {
  color: #767676;
  background: #000;
}

修正:キーボードナビゲーション

// カスタム要素をキーボードアクセス可能にする
class AccessibleDropdown extends HTMLElement {
  connectedCallback() {
    this.setAttribute("tabindex", "0");
    this.setAttribute("role", "combobox");
    this.setAttribute("aria-expanded", "false");

    this.addEventListener("keydown", (e) => {
      switch (e.key) {
        case "Enter":
        case " ":
          this.toggle();
          e.preventDefault();
          break;
        case "Escape":
          this.close();
          break;
        case "ArrowDown":
          this.focusNext();
          e.preventDefault();
          break;
        case "ArrowUp":
          this.focusPrevious();
          e.preventDefault();
          break;
      }
    });
  }
}

ベストプラクティス

すべきこと

  • 早期に開始する - デザインフェーズからアクセシビリティを組み込む
  • 実際のユーザーでテストする - 障害を持つユーザーが最良のフィードバックを提供
  • 自動化できる部分は自動化する - 30〜50%の問題を検出可能
  • セマンティックHTMLを使用する - ARIAの必要性を減らす
  • パターンを文書化する - アクセシブルなコンポーネントライブラリを構築

してはいけないこと

  • 自動テストのみに依存しない - 手動テストが必要
  • ARIAを最初の解決策にしない - まずネイティブHTMLを使う
  • フォーカスアウトラインを非表示にしない - キーボードユーザーに必要
  • ズームを無効にしない - ユーザーはサイズ変更が必要
  • 色のみを使用しない - 複数のインジケーターが必要

リソース

Individual skills in this repo

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

ulasalyesil/personal-website-v2

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

ulasalyesil/personal-website-v2

Conduct design interviews, generate five distinct UI variations in a temporary design lab, collect feedback, and produce implementation plans. Use when the user wants to explore UI design options, redesign existing components, or create new UI with multiple approaches to compare.

ulasalyesil/personal-website-v2

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

ulasalyesil/personal-website-v2

Design and implement microinteractions, motion design, transitions, and user feedback patterns. Use when adding polish to UI interactions, implementing loading states, or creating delightful user experiences.

ulasalyesil/personal-website-v2

This skill is for interface design — dashboards, admin panels, apps, tools, and interactive products. NOT for marketing design (landing pages, marketing sites, campaigns).

ulasalyesil/personal-website-v2

Best practices and example-driven guidance for building SwiftUI views and components. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens, or needing component-specific patterns and examples.

ulasalyesil/personal-website-v2

UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.

ulasalyesil/personal-website-v2

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

ulasalyesil/personal-website-v2

Enforces an opinionated UI baseline to prevent AI-generated interface slop.

ulasalyesil/personal-website-v2

Build modern, composable, and accessible React UI components following the components.build specification. Use when creating, reviewing, or refactoring component libraries, design systems, or any reusable UI components. Triggers on tasks involving component APIs, composition patterns, accessibility, styling systems, or TypeScript props.

ulasalyesil/personal-website-v2

Ship correct, complete metadata.

ulasalyesil/personal-website-v2

Survey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on source code — never implements, fixes, or refactors anything itself. Use when asked to audit a codebase, find improvement opportunities (bugs, security, performance, test coverage, tech debt, migrations, DX), suggest features or where to take the project next (roadmap, product direction), or generate handoff plans for another agent to implement.

ulasalyesil/personal-website-v2

Defines the product's objects, relationships, states, and vocabulary independently of any interface — the most load-bearing layer

ulasalyesil/personal-website-v2

Maps domain concepts, terminology conflicts, and bounded contexts — produces a noun harvest for the conceptual model layer

ulasalyesil/personal-website-v2

Maps interaction structure and flow — produces breadboard notation with edge cases, failure paths, and open decisions

ulasalyesil/personal-website-v2

Framework orientation for Layers of Product Design — load this first; provides the context all other skills depend on

ulasalyesil/personal-website-v2

User research planning and synthesis at the observed behaviour layer — produces candidate job stories with confidence ratings

ulasalyesil/personal-website-v2

Diagnostic audit across all seven layers — identifies the bottleneck layer and recommends where to focus

ulasalyesil/personal-website-v2

Connects user opportunities to business outcomes and solution bets — produces a strategy tree and prioritised experiments

ulasalyesil/personal-website-v2

Audits existing surface against lower-layer decisions and produces a surface decision inventory — vocabulary, object consistency, completeness, feedback, hierarchy, accessibility

関連スキル