keyboard-a11y-tester

本サイトが提示する下記のベストプラクティスを実行するプロジェクトは、Open Source Security Foundation (OpenSSF) バッジを達成したことを自主的に自己認証し、そのことを外部に示すことができます。

ソフトウェアに欠陥や脆弱性がないことを保証する手立てはありません。形式論的な証明ができたとしても、仕様や前提が間違っていると誤動作の可能性があります。また、プロジェクトが健全で、かつ機能的な開発コミュニティであり続けることを保証する手立てもありません。しかし、ベストプラクティスの採用は、プロジェクトの成果の向上に寄与する可能性があります。たとえば、いくつものベストプラクティスがリリース前の複数人によるレビューを定めていますが、それによりレビュー以外では発見困難な技術的脆弱性を見つけるのを助け、同時に異なる企業の開発者間の信頼を築き、さらに交流を続けることに対する意欲を生んでいます。バッジを獲得するには、すべてのMUSTおよびMUST NOT基準を満たさなければなりません。すべてのSHOULD基準も満たさなければなりませんが、正当な理由がある場合は満たさなくても構いません。そしてすべてのSUGGESTED基準も満たさなければなりませんが、満たさないとしても、少なくとも考慮することが望まれます。フィードバックは、 GitHubサイトのissueまたはpull requestとして提示されれば歓迎します。また、議論のためのメールリストも用意されています。

私たちは多言語で情報を提供していますが、翻訳版に矛盾や意味の不一致がある場合は、英語版を正式な記述とします。
これがあなたのプロジェクトである場合は、プロジェクトページにベースラインバッジステータスを表示してください!ベースラインバッジステータスは次のようになります: プロジェクト13561のベースラインバッジレベルはin_progressです ベースラインバッジを埋め込む方法は次のとおりです:
ベースラインバッジステータスを表示するには、マークダウンファイルに以下を埋め込みます:
[![OpenSSF Baseline](https://www.bestpractices.dev/projects/13561/baseline)](https://www.bestpractices.dev/projects/13561)
または、HTMLに以下を埋め込みます:
<a href="https://www.bestpractices.dev/projects/13561"><img src="https://www.bestpractices.dev/projects/13561/baseline"></a>


これらはベースラインレベル3の基準です。 これらは基準バージョン v2026.02.19 の評価項目です。

Baseline Series: ベースラインレベル1 ベースラインレベル2 ベースラインレベル3

        

 基本的情報

  • 一般

    他のプロジェクトが同じ名前を使用していないか注意してください。

    An AI-assisted web accessibility tester that behaves like two W3C personas at once: a keyboard-only user ("Ade") and a screen-reader user ("Lakshmi"). It drives a page keyboard-only, records what happens at every focus stop, and emits evidence-linked findings mapped to specific WCAG success criteria — against any website.

    SPDXライセンスの表現形式を使用してください。 例:「Apache-2.0」、「BSD-2-Clause」、「BSD-3-Clause」、「GPL-2.0+」、「LGPL-3.0+」、「MIT」、「(BSD-2-Clause OR Ruby)」。一重引用符または二重引用符を含めないでください。
    複数の言語がある場合は、コンマを区切り(スペースを入れてもよい)としてリストし、使用頻度の高いものから順に並べます。使用言語が多くある場合は、少なくとも最初の3つの最も多く使われるものをリストアップしてください。言語がない場合(例:ドキュメントだけ、またはテスト専用のプロジェクトの場合)、1文字 " - "を使用します。言語ごとにある大文字・小文字の慣用を踏襲してください(例:「JavaScript」)。
    Common Platform Enumeration(CPE)は、情報技術(IT)システム、ソフトウェア、およびパッケージのための構造化された命名体系です。脆弱性を報告する際に、多くのシステムやデータベースで使用されています。

    keyboard-a11y-tester

    An AI-assisted web accessibility tester that behaves like two W3C personas at once: a
    keyboard-only user ("Ade") and a screen-reader user ("Lakshmi"). It drives a page
    keyboard-only, records what happens at every focus stop, and emits evidence-linked
    findings mapped to specific WCAG success criteria — against any website. Both
    personas run in the same pass by default; a --persona flag restricts to just one.

    It has two layers:

    • a deterministic runner (scripts/runner.mjs) that owns the mechanical, reproducible
      work — driving the page keyboard-only, capturing a per-step trace + screenshots, and
      computing the machine-decidable checks for both personas;
    • an AI-judgment layer — the invoking agent — that reads the trace/screenshots/census
      and judges what rules can't (task completion, logical focus/reading order, form
      quality, announcement quality). See SKILL.md for how an agent drives it.

    Standalone and portable: it depends only on playwright, yaml, pngjs, pixelmatch,
    and @guidepup/virtual-screen-reader, needs no bundled test cases, and writes all output
    to a per-user temp directory (never into this folder). The screen-reader persona
    never drives a real screen reader (NVDA/VoiceOver) — see "Screen-reader detection" below.

    Documentation: docs/usage.md (setup, dependencies, quick start,
    CAPTCHAs) · docs/interface.md (full CLI reference, output file
    schema, WCAG checks table).

    Quick start

    As a Claude Code plugin — register this repo as a plugin marketplace, then install it:

    /plugin marketplace add ezufelt/keyboard-a11y-tester
    /plugin install keyboard-a11y-tester@ezufelt
    

    The first command registers this repo as a marketplace (named ezufelt, per
    .claude-plugin/marketplace.json); the second installs the plugin. Once installed, the
    skill in SKILL.md becomes available to the agent.

    As a standalone clone — clone the repo and install its dependencies:

    git clone https://github.com/ezufelt/keyboard-a11y-tester.git
    cd keyboard-a11y-tester
    npm install
    npx playwright install chromium
    

    Then drive it directly (see Run against any URL).

    Requirements & dependencies

    Requires Node.js ≥ 20 and Chromium (via Playwright), plus five small npm dependencies —
    no build step. Run node scripts/setup-check.mjs to verify both before your first run.

    See docs/usage.md for the full dependency
    table, licensing credit for @guidepup/virtual-screen-reader, and setup instructions.

    Run against any URL (no test file needed)

    # quick unattended blind Tab-crawl of the start page, per viewport
    node scripts/runner.mjs --url https://example.com
    
    # a full scenario, driven live by the agent one keystroke at a time
    node scripts/runner.mjs serve --url https://example.com --goal "find the pricing page" \
    
         --viewport desktop --port 9400
    #   → prints:  READY <session-dir>   (under the system temp dir)
    node scripts/runner.mjs observe <session-dir>
    node scripts/runner.mjs step    <session-dir> --press Tab      # one keystroke; prints observation
    node scripts/runner.mjs step    <session-dir> --press Enter
    node scripts/runner.mjs step    <session-dir> --type "hello@example.com"
    node scripts/runner.mjs finish  <session-dir>                  # writes trace + findings
    node scripts/runner.mjs stop    <session-dir>
    

    See docs/usage.md for the full
    quick-start walkthrough, and docs/interface.md for every CLI flag and
    the complete output file schema.

    Authenticated runs

    Pages behind a login can't be tested with a fresh, logged-out browser. Pass a Playwright
    storageState JSON file with --storage-state <file> to start the browser with its cookies
    and localStorage already loaded (e.g. an already-logged-in session). Generate one with
    context.storageState({ path: 'auth.json' }) or npx playwright codegen --save-storage=auth.json <url>.
    The file is validated (exists, parses as JSON, and looks like a real storageState export —
    i.e. has cookies/origins arrays) before the browser launches — a missing or malformed file
    fails the run immediately rather than silently testing the logged-out site. In serve mode
    it's applied once at launch and the session browser keeps the state alive for every subsequent
    step.

    A storageState file holds live session cookies/tokens — treat it as a secret. Don't commit
    it; .gitignore already excludes auth.json, storageState.json, and *storage-state*.json,
    but a differently-named file won't be caught automatically.

    What the runner does (deterministic layer)

    Playwright (full Chromium, new-headless + SwiftShader for real pixels) drives the page with
    only the keyboard — it never calls .click() or .focus(); if a control is only
    reachable by pointer, that is itself a finding. It drops to a raw CDP session for the
    accessibility tree (Accessibility.getPartialAXTree), the ground truth for name/role/state.
    At startup it fails fast if :focus-visible does not fire on CDP-driven key events
    (every focus-indicator check would otherwise be invalid) — skipped entirely when
    --persona screen-reader is passed, since that persona has no pixel/focus-ring work.

    Checks are evaluated per focus stop the persona actually visits (keyboard persona) or
    against a page-wide structural census (screen-reader persona) — this is scenario
    testing, not an exhaustive page audit. Conformance target: AA is pass/fail, AAA is
    informative.

    WCAG Level Persona Check
    2.4.7 AA keyboard Focus indicator present
    2.4.13 AAA (informative) keyboard Focus indicator strength
    1.4.1 AA keyboard Indicator is not colour-only
    2.1.2 AA keyboard Keyboard trap
    2.4.1 AA keyboard No skip link
    2.4.3 AA keyboard Positive tabindex
    3.2.1 AA keyboard Context change from focus alone
    3.3.2 AA keyboard File input named only by the user-agent default ("Choose File")
    4.1.2 AA keyboard Focusable control with no accessible name
    1.1.1 AA screen-reader Missing alt text/aria-label
    1.3.1 AA screen-reader Heading level skip
    1.3.1 AA screen-reader Duplicate, unlabeled landmark roles
    4.1.2 AA screen-reader Interactive control announced as a bare role
    4.1.3 AA screen-reader Declared live region that never announced anything

    See docs/interface.md for the authoritative version of
    this table (full check descriptions) and the W3C persona references.

    Output

    Everything is written under a per-user temp dir (${TMPDIR}/keyboard-a11y-tester/…, or
    --out): a trace.json (per-step evidence), deterministic-findings.json (WCAG findings),
    screen-reader-census.json (screen-reader persona), and cropped screenshots/step_NNNN.png
    per viewport. See docs/interface.md for the
    complete directory layout and field-by-field schema of every output file.

    Focus-visible detection (2.4.7 AA presence + 2.4.13 AAA strength)

    Presence (AA) uses two independent signals, so a faint-but-real indicator is never
    missed:

    1. the focused element's computed style declares an outline or box-shadow (ground
      truth — recorded in the trace as computed_focus_style), or
    2. pixels change on focus (catches background/colour indicators with no outline).

    Either one means the indicator is present → AA pass. Pixel diffing compares the focused
    frame to a scroll-aligned baseline (the next step's frame, where the element is no longer
    focused — so focus is never manipulated programmatically), measuring ring slices at
    increasing offset (thin and offset outlines), the interior, and top/bottom edge bands.

    Strength (AAA, informative) measures whether the indicator meets 2.4.13 Focus
    Appearance — changed area ≥ a 2px-thick perimeter of the control, and ≥ 3:1 WCAG luminance
    contrast between focused and unfocused states. Advisory only. (This measure is unreliable
    on pages that mutate between steps — e.g. "load more" — because the neighbour-frame
    baseline then differs by content, not just the focus ring; treat AAA numbers on such pages
    with caution. AA presence is unaffected, being driven by the computed style.)

    So 2.4.7 (AA) requires only that an indicator is visible with no size/contrast minimum: a
    faint 1px or low-opacity ring passes AA and is flagged weak at AAA — rather than being
    falsely reported as "no focus indicator."

    Screen-reader detection (Lakshmi)

    The screen-reader persona is emulated, never driven for real: @guidepup/virtual-screen-reader
    builds an ARIA/ACCNAME-spec accessible tree over the live page and computes what a
    spec-compliant screen reader would announce, entirely in the browser's own JS engine — no
    NVDA/JAWS/VoiceOver is launched, and it works the same way on any OS the runner itself
    supports.

    Its self-contained browser bundle is injected via Playwright's context.addInitScript,
    which is not subject to the page's own CSP — verified against both a synthetic CSP-locked
    page and a real CSP-locked production site. Once injected, its virtual cursor tracks
    real keyboard focus automatically
    (it listens for native focusin events), so every
    step you drive with real Tab/Enter/etc. produces a matching sr_announcement with no
    separate "chasing" logic and no drift between what's focused and what's reported as
    announced. The same mechanism also wires a MutationObserver that computes WAI-ARIA
    live-region semantics and captures "assertive: …"/"polite: …" announcements as they
    happen — this is what 4.1.3 (Status Messages) findings are derived from.

    Separately, once per newly-visited page URL, an ephemeral instance walks the entire page
    in reading order (never touching the live per-step monitor) to build
    screen-reader-census.json — the source for the heading-hierarchy, duplicate-landmark,
    missing-alt-text, and bare-role-control checks, since those need whole-page context rather
    than just the stops a keyboard user's Tab order happens to visit.

    This augments but does not replace testing with a real screen reader and real users
    the upstream library's own README says exactly that, and it's worth repeating: this checks
    what a spec-compliant screen reader should announce given the page's ARIA/HTML, not the
    specific quirks of any one real screen reader implementation.

    CAPTCHAs

    CAPTCHAs detect automation and refuse to run; the runner has a page-scoped, human-approved
    compatibility workaround. See docs/usage.md for details.

    License

    MIT © Everett Zufelt. See LICENSE.

 管理策 0/21

  • 管理策


    CI/CDパイプラインでジョブに権限が割り当てられる場合、ソースコードまたは設定は、対応するアクティビティに必要な最小限の権限のみを割り当てる必要があります。 [OSPS-AC-04.02]
    プロジェクトのCI/CDパイプラインを構成して、デフォルトでユーザーとサービスに最小限の利用可能な権限を割り当て、特定のタスクに必要な場合にのみ権限を昇格させます。一部のバージョン管理システムでは、組織またはリポジトリレベルで設定できる場合があります。それができない場合は、パイプラインのトップレベルで権限を設定してください。


    信頼できる協力者の入力を受け付けるCI/CDパイプラインは、パイプラインで使用する前にその入力をサニタイズおよび検証しなければなりません。 [OSPS-BR-01.04]
    CI/CDパイプラインは、明示的なワークフロー実行時にすべての協力者の入力をサニタイズ(期待値の引用、エスケープ、または終了)する必要があります。協力者は一般的に信頼されていますが、ワークフローへの手動入力はレビューできず、アカウント乗っ取りや内部脅威によって悪用される可能性があります。


    正式なリリースが作成される場合、そのリリース内のすべてのアセットは、リリース識別子またはアセットの他の一意の識別子と明確に関連付けられている必要があります。 [OSPS-BR-02.02]
    プロジェクトによって生成される各ソフトウェアアセットに一意のバージョン識別子を割り当て、一貫した命名規則または番号体系に従ってください。例としては、SemVer、CalVer、またはgitコミットIDなどがあります。


    プロジェクトは、プロジェクトで使用されるシークレットと認証情報を管理するためのポリシーを定義する必要があります。このポリシーには、シークレットと認証情報を保存、アクセス、およびローテーションするためのガイドラインが含まれている必要があります。 [OSPS-BR-07.02]
    シークレットと認証情報がプロジェクト内でどのように管理され使用されているかを文書化してください。これには、シークレットがどのように保存されるか(例:シークレット管理ツールを使用)、アクセスがどのように制御されるか、シークレットがどのようにローテーションまたは更新されるかについての詳細が含まれている必要があります。機密情報がソースコードにハードコードされたり、バージョン管理システムに保存されたりしないようにしてください。


    プロジェクトがリリースを作成した場合、プロジェクトのドキュメントには、リリースアセットの整合性と真正性を検証するための手順が含まれている必要があります。 [OSPS-DO-03.01]
    プロジェクトの手順には、使用されている技術、実行するコマンド、および期待される出力に関する情報が含まれている必要があります。可能であれば、このドキュメントをビルドおよびリリースパイプラインと同じ場所に保存しないようにして、単一の侵害によってソフトウェアとその整合性を検証するためのドキュメントの両方が侵害されることを避けてください。


    プロジェクトがリリースを作成した場合、プロジェクトのドキュメントには、ソフトウェアリリースを作成した人またはプロセスの期待されるIDを検証するための手順が含まれている必要があります。 [OSPS-DO-03.02]
    期待されるIDは、署名に使用される鍵ID、sigstore証明書からの発行者とID、または他の類似の形式である可能性があります。可能であれば、このドキュメントをビルドおよびリリースパイプラインと同じ場所に保存しないようにして、単一の侵害によってソフトウェアとその整合性を検証するためのドキュメントの両方が侵害されることを避けてください。


    プロジェクトがリリースを作成した場合、プロジェクトのドキュメントには、各リリースのサポートの範囲と期間に関する説明文が含まれている必要があります。 [OSPS-DO-04.01]
    プロジェクトのリリースされたソフトウェアアセットのサポートの範囲と期間を伝えるために、プロジェクトにはSUPPORT.mdファイル、SECURITY.mdの「サポート」セクション、または各リリースの予想されるサポート期間、提供されるサポートの種類(例:バグ修正、セキュリティ更新)、およびサポートを受けるための関連ポリシーや手順を説明する他のドキュメントが必要です。


    プロジェクトがリリースを作成した場合、プロジェクトのドキュメントには、リリースやバージョンがセキュリティ更新を受けなくなる時期について説明文が含まれている必要があります。 [OSPS-DO-05.01]
    セキュリティ修正のサポート範囲と期間を伝えるために、プロジェクトにはSUPPORT.mdまたはプロジェクトのセキュリティ更新に関するポリシーを説明する他のドキュメントが必要です。


    プロジェクトがアクティブである間、プロジェクトのドキュメントには、機密リソースへのエスカレートされた権限を付与する前にコード共同作業者がレビューされるポリシーが含まれている必要があります。 [OSPS-GV-04.01]
    マージ承認やシークレットへのアクセスなど、機密リソースへのエスカレートされた権限を付与される前に、コード共同作業者がレビューおよび承認される必要があるという実行可能なポリシーをプロジェクトのドキュメントに公開してください。審査には、既知の信頼できる組織との貢献者の関連性を確認するなど、正当化可能なIDの系統を確立することが推奨されます。


    プロジェクトがリリースを作成した場合、リリースされたすべてのコンパイル済みソフトウェアアセットは、ソフトウェア部品表とともに配信される必要があります。 [OSPS-QA-02.02]
    ビルド時に精度が検証されたツールを使用してSBOMを自動生成することが推奨されます。これにより、ユーザーは環境内の他のプロジェクトと並行して、標準化されたアプローチでこのデータを取り込むことができます。


    プロジェクトが複数のソースコードリポジトリで構成されるリリースを作成した場合、すべてのサブプロジェクトは、プライマリコードベースと同等またはそれより厳しいセキュリティ要件を実施する必要があります。 [OSPS-QA-04.02]
    プロジェクトによって生成され、リリースにコンパイルされる追加のサブプロジェクトコードリポジトリは、それぞれのコードベースのステータスと意図に応じて、セキュリティ要件を実施する必要があります。対応するOSPS Baseline要件に従うことに加えて、これにはセキュリティレビューを要求すること、脆弱性がないこと、および既知のセキュリティ問題がないことを確認することが含まれる場合があります。


    プロジェクトがアクティブである間、プロジェクトのドキュメントには、テストがいつどのように実行されるかを明確に記載する必要があります。 [OSPS-QA-06.02]
    コントリビューションドキュメントに、ローカルでテストを実行する方法とCI/CDパイプラインでテストを実行する方法を説明するセクションを追加します。ドキュメントでは、テストが何をテストしているかと結果の解釈方法を説明する必要があります。


    アクティブな間、プロジェクトのドキュメントには、プロジェクトが生成するソフトウェアに対するすべての主要な変更は、自動化されたテストスイートの機能のテストを追加または更新する必要があるというポリシーを含めなければなりません(MUST)。 [OSPS-QA-06.03]
    コントリビューションドキュメントに、テストの追加または更新に関するポリシーを説明するセクションを追加します。ポリシーでは、主要な変更とは何か、どのようなテストを追加または更新すべきかを説明する必要があります。


    プライマリブランチにコミットが行われる場合、プロジェクトのバージョン管理システムは、マージする前に、作者以外の少なくとも1人の人間による変更の承認を要求しなければなりません(MUST)。 [OSPS-QA-07.01]
    プロジェクトのバージョン管理システムを構成し、リリースまたはプライマリブランチにマージする前に、作者以外の少なくとも1人の人間による変更の承認を要求します。これは、プルリクエストがマージされる前に、少なくとも1人の他のコラボレーターによってレビューおよび承認されることを要求することで実現できます。


    プロジェクトがリリースを行った場合、プロジェクトは、システム内の重要なコードパス、関数、および相互作用に対する攻撃を理解して防御するために、脅威モデリングと攻撃面分析を実行しなければなりません(MUST)。 [OSPS-SA-03.02]
    脅威モデリングは、プロジェクトがコードベース、関連するプロセスとインフラストラクチャ、インターフェース、主要コンポーネントを調べ、「ハッカーのように考え」、システムがどのように破壊または侵害される可能性があるかをブレインストーミングする活動です。識別された各脅威をリストアップし、プロジェクトは、発生する可能性のあるギャップ/脆弱性を積極的に回避または閉じる方法を検討できます。新機能や破壊的変更に対して、これが更新されていることを確認してください。


    アクティブな間、プロジェクトに影響を与えないソフトウェアコンポーネントの脆弱性は、VEXドキュメントで説明し、非悪用可能性の詳細で脆弱性レポートを補強しなければなりません(MUST)。 [OSPS-VM-04.02]
    既知の脆弱性の悪用可能性ステータスを伝達するVEXフィードを確立し、評価の詳細または脆弱なコードが実行されないようにする適切な緩和策を含めます。


    アクティブな間、プロジェクトドキュメントには、脆弱性とライセンスに関連するSCA調査結果の修復のしきい値を定義するポリシーを含めなければなりません(MUST)。 [OSPS-VM-05.01]
    プロジェクト内に、脆弱性とライセンスに関連するSCA調査結果の修復のしきい値を定義するポリシーを文書化します。これらの調査結果を識別、優先順位付け、修復するプロセスを含めます。


    アクティブな間、プロジェクトドキュメントには、リリース前にSCA違反に対処するポリシーを含めなければなりません(MUST)。 [OSPS-VM-05.02]
    プロジェクト内に、リリース前に該当するソフトウェア構成分析の結果に対処するポリシーを文書化し、リリース前にそのポリシーへの準拠を検証するステータスチェックを追加します。


    アクティブな間、プロジェクトのコードベースへのすべての変更は、悪意のある依存関係と依存関係の既知の脆弱性に関する文書化されたポリシーに対して自動的に評価され、非悪用可能と宣言および抑制されている場合を除き、違反の場合はブロックされなければなりません(MUST)。 [OSPS-VM-05.03]
    プロジェクトのバージョン管理システムにステータスチェックを作成し、コードベースへのすべての変更に対してソフトウェア構成分析ツールを実行します。変更がマージされる前に、ステータスチェックが合格することを要求します。


    アクティブな間、プロジェクトドキュメントには、SAST調査結果の修復のしきい値を定義するポリシーを含めなければなりません(MUST)。 [OSPS-VM-06.01]
    プロジェクト内に、静的アプリケーションセキュリティテスト(SAST)調査結果の修復のしきい値を定義するポリシーを文書化します。これらの調査結果を識別、優先順位付け、修復するプロセスを含めます。


    アクティブな間、プロジェクトのコードベースへのすべての変更は、セキュリティの弱点に関する文書化されたポリシーに対して自動的に評価され、非悪用可能と宣言および抑制されている場合を除き、違反の場合はブロックされなければなりません(MUST)。 [OSPS-VM-06.02]
    プロジェクトのバージョン管理システムにステータスチェックを作成し、コードベースへのすべての変更に対して静的アプリケーションセキュリティテスト(SAST)ツールを実行します。変更がマージされる前に、ステータスチェックが合格することを要求します。


このデータは、Community Data License Agreement – Permissive, Version 2.0 (CDLA-Permissive-2.0)のもとで利用可能です。これは、データ受領者が、データ受領者がこの契約のテキストを共有データとともに利用可能にする限り、変更の有無にかかわらずデータを共有できることを意味します。ezufeltおよびOpenSSFベストプラクティスバッジのコントリビューターにクレジットを表示してください。

プロジェクト バッジ登録の所有者: ezufelt.
エントリの作成日時 2026-07-10 18:22:26 UTC、 最終更新日 2026-07-10 21:04:01 UTC 最後に2026-07-10 21:04:01 UTCにバッジ合格を達成しました。