
分散システムおよびステートフルシステム向けに、クレーム駆動のテストを設計・実行するAIコーディングエージェントのための2つのスキル。 この2つを組み合わせることで、構造化されたMarkdownテスト計画と、10状態の判定結果およびSUT/ハーネス/チェッカー/環境の明示的な責務分類を備えた調査レポートを生成します。レビュー担当者はこの2つの成果物を読んでリリース可否を判断します。その他の再実行は不要です。
Claude Code、Codex、Copilot CLI、Cursor、Gemini、またはMarkdownを読み取ってシェルを実行できるあらゆるエージェントで動作します。このスキルはプレーンなSKILL.mdファイルです。エージェントがこれを実行し、計画と調査レポートが出力となります。
一方のスキルが計画を設計し、もう一方がそれを実行します。計画は製品のクレームから始まり、そのクレームに紐づく仮説を生成し、それぞれが反証しようとするクレームにちなんで命名されたシナリオを記述します。一貫性が重要なシナリオでは、各シナリオは抽象モデル(register | queue | log | lock | lease | ledger | …)を操作履歴スキーマ、名前付きチェッカー、および観測可能な着地証拠を伴うネメシスに結び付けます。計画はカバレッジ妥当性の議論と保守的な信頼度ステートメントで締めくくられます。
分散システムおよびステートフルシステムのテストのデフォルト——統合テストをいくつか書いて完了とする——では、本番環境で実際にこれらのシステムを壊すバグのごく一部しか発見できません。部分的なネットワーク分断、非決定的な並行性、クラッシュリカバリ、アップグレード/ロールバック、リプレイ時の冪等性、タイミングに敏感な順序性などです。
これらのスキルは、この分野で苦労して得られた知見を活かした、信念に基づいたワークフローを強制します。
エンドツーエンドで、2つのスキルは以下を生成します:
docs/testing-plans/<slug>.md ← plan with §0–§9 (see below)
test-sessions/<slug>/<UTC>/
├── session-log.md ← timeline + toolbox + env probe
├── logs/ ← per-scenario stdout/stderr
├── metrics/ ← metric snapshots
├── artifacts/ ← ephemeral harnesses, dumps
└── findings/
├── <scenario>.md ← per-scenario verdict (written as run proceeds)
└── report.md ← summary + adequacy + confidence delta
計画の構造(レビュー担当者はこれを読めば、テストを再実行せずにリリース可否を判断できます):
0. Architectural summary — system as it actually exists
1. Scope
1b. Claims under test — the spine
1c. Missing claims discovered — docs ↔ code drift
2. SUT model
3. Existing test inventory — what's already covered
4. Failure-mode hypotheses — tied to claim IDs
5. Coverage matrix — claim × hypothesis
6. Technique selection — from the catalog
6b. Environment requirements
7. Scenarios — each named after the claim, with
Target test file + Skeleton
7.M Model / history / — mandatory when the scenario falsifies
checker discipline a claim in {safety, durability,
idempotency, isolation, ordering,
membership}: model under test,
operation-history schema, named
checker, nemesis + landing evidence,
ambiguous-outcome handling, reduction
plan (SUT/harness/checker/env blame)
7b. Coverage adequacy argument — why these tests are enough
7c. Residual uncertainty — what stays unverified, and why ok
7d. Confidence statement — the reviewer's verdict
8. What this plan does NOT cover
9. Open questions / followups
### Scenario S3: linearizable_append_under_partition
- Falsifies if it FAILs: C1 (every acknowledged append is durable
and linearisable), C5 (leader election completes within 5s)
- Workload: 8 clients, 70% append / 30% read, 5min, key-skew zipf
- Faults: asymmetric partition isolating current leader at T+60s
for 30s
- Oracle: linearizability via Porcupine over per-key histories
§7.M (model / history / checker discipline)
- Model under test: log
- Operation history: default 11-field schema (op id, process id,
invoke/complete ts, op type, key, input,
output, error, timeout marker, node seen,
fault epoch). Recorded in-process + server-
side audit.
- Checker: linearizability (Porcupine) per-key, then
no-lost-ack against final state
- Nemesis + landing: asymmetric-partition (iptables drop one
direction). Landing evidence = iptables drop
counter goes 0 → 14,712 over the 30s window
AND raft log emits "leader-lost; starting
election" within 2s of injection.
- Ambiguous outcomes: timeouts → timeout_marker=true, complete_ts
=null, treated as could-have-succeeded;
retries are separate ops sharing input
- Reduction plan: if FAIL, bisect fault window + fix seed, then
classify SUT / harness / checker / environment
per references/test-case-reduction.md
(完全な調査結果テンプレートには、Oracle、Oracle実行証拠、成果物リンク、計画との妥当性比較セクション、および信頼度デルタが含まれます — skills/executing-distributed-system-tests/assets/findings-report-template.md を参照してください。)
これを任意のAIコーディングエージェント(Claude Code、Codex、Copilot CLI、Cursor、Gemini、またはMarkdownを読み取ってシェルを実行するその他のツール)に貼り付けます:
Read https://raw.githubusercontent.com/shenli/distributed-system-testing/main/INSTALL.md
and follow the instructions to install and configure
distributed-testing-skills for this agent.
エージェントはINSTALL.mdを取得し、リポジトリを~/.local/share/distributed-testing-skills/にクローンして、スキルを組み込みます(Claude Codeでは~/.claude/skills/配下にシンボリックリンク、その他のエージェントでは~/AGENTS.md内のポインターブロック)。
その後、マシン上の任意のエージェントに「このシステムのテスト計画を設計して」または「Xで計画を実行して」と依頼すると、SKILL.mdのワークフローに従います。
同じ1行を再度貼り付けます。 INSTALL.mdは冪等です。インストールパスが存在すればgit pull --ff-onlyを実行し、存在しなければgit cloneを実行します。シンボリックリンクは常にクローンされたコンテンツを指すため、新しいバージョンを自動的に取り込みます。~/AGENTS.mdのポインターブロックはHTMLマーカーを使用しており、実行のたびに重複なくきれいに置き換えられます。
クローンしたスキルにローカルでの編集がある場合、git pull --ff-onlyは失敗します。エージェントは破棄する前に停止して確認を求めます。
git clone https://github.com/shenli/distributed-system-testing.git \
~/.local/share/distributed-testing-skills
# Claude Code: symlink under ~/.claude/skills/
mkdir -p ~/.claude/skills
ln -snf ~/.local/share/distributed-testing-skills/skills/designing-distributed-system-tests \
~/.claude/skills/designing-distributed-system-tests
ln -snf ~/.local/share/distributed-testing-skills/skills/executing-distributed-system-tests \
~/.claude/skills/executing-distributed-system-tests
# Codex / Copilot CLI / Cursor / Gemini / others: see INSTALL.md
リポジトリには.claude-plugin/配下にプラグインマニフェストとマーケットプレイスマニフェストが含まれているため、Claude Codeはシンボリックリンクの代わりにプラグインとしてインストールできます:
/plugin marketplace add shenli/distributed-system-testing
/plugin install distributed-testing-skills@distributed-testing-skills
両方のスキルはskills/から自動検出されます。上記の1行INSTALL.mdフローは、エージェント非依存の経路(Codex、Copilot CLI、Cursor、Gemini)として残ります。
スキルがインストールされると、2つの方法でこれらを駆動できます:
カジュアルな依頼(自動トリガー付きClaude Code):
Design a project-wide test plan for this codebase.
Execute the plan at ./testing-plans/<slug>.md against this codebase.
スキルの説明は、「テスト計画を設計」「計画を実行」「安定性テストを実行」「リリース検証計画を設計」などの自然な表現を拾い上げます。
特定のモード、出力パス、または自動トリガーではないエージェントの場合、USAGE.mdにはすべてのワークフロー(設計と実行、それぞれのモード)用のコピー&ペーストプロンプトに加えて、スコープ、環境プロービング、長時間実行のチェックポイントに関するヒントがあります。
designing-distributed-system-testsリポジトリを調査し、製品が行うクレームを抽出し、そのクレームに紐づく仮説を生成し、カタログから手法を選び、カバレッジ妥当性の議論と信頼度ステートメントを備えた構造化Markdown計画を作成します。一貫性が重要なシナリオでは、計画はシナリオごとに§7.Mブロックを埋めます:テスト対象モデル、操作履歴スキーマ、名前付きチェッカー、ネメシス+着地証拠、曖昧な結果の扱い、削減計画。詳細:history-discipline.md。
2つのモード:変更スコープ(特定のコミットまたはPR)とプロジェクト全体(既存テストの棚卸しとギャップ分析を伴う全体計画)。
executing-distributed-system-tests計画を読み、SUTの道具箱を発見し、環境をプローブし、チェックポイント規律でシナリオを実行します。シナリオごとに:障害の着地証拠を取得し、green-but-broken監査とweak-oracle監査を実行し、verdict-taxonomy.mdの10状態分類法から判定を割り当て、報告前にすべてのFAILをSUT/ハーネス/チェッカー/環境に分類します。計画との妥当性比較評価と信頼度デルタを備えた調査レポートを生成します。
2つのモード:デフォルト(SUTに対して読み取り専用、セッションディレクトリ配下の一時的なハーネス)とオーサーモード(計画の§7で宣言されたシナリオスケルトンをレビュー用にSUTに書き込みます)。
この分野の文献から抽出された8つのリファレンスファイル:
それぞれ同じ構成です:どのようなときに使うか、何をうまく検出するか、何を見逃すか、具体的なツール、論文、コストシグナル、計画チェックリスト。カタログインデックスは症状とリファレンスを対応付けます。
.
├── .claude-plugin/ ← plugin + marketplace manifests
├── README.md ← this file
├── INSTALL.md ← idempotent install / update (paste-this)
├── USAGE.md ← copy/paste prompts for every workflow
├── LICENSE
├── skills/
│ ├── designing-distributed-system-tests/
│ │ ├── SKILL.md ← the design workflow
│ │ ├── assets/plan-template.md ← §0–§9 incl. gated §7.M
│ │ └── references/ ← 8-file technique catalog + index,
│ │ common-distributed-systems-pitfalls,
│ │ history-discipline,
│ │ boundary-and-isolation-testing
│ └── executing-distributed-system-tests/
│ ├── SKILL.md ← the execute workflow
│ ├── assets/
│ │ ├── session-log-template.md
│ │ └── findings-report-template.md ← 10-state verdicts + landing evidence
│ └── references/ ← oracle-patterns (checker picker + 14
│ patterns), fault-injection-howto
│ (22-row nemesis taxonomy),
│ test-case-reduction (with blame
│ classification), green-but-broken-
│ red-flags (incl. weak-oracle audit),
│ finding-classification (TaxDC),
│ verdict-taxonomy (10-state)
├── evals/ ← manual regression prompts (see evals/README.md)
├── verification/ ← real local runs (gitignored — not in the repo)
└── specs/ ← original design spec (historical snapshot)
初期段階ですが、実践済みです。両方のスキルはAgentDB(Rust製の分散エージェントランタイム)に対してエンドツーエンドで複数回駆動され、6件の調査結果を表面化させました(P0候補1件は現在クローズ、P1が2件PRとしてリリースされ、2件はオープン)。スキル本体はハーネスの経験が蓄積されるにつれて進化します。今後数回のイテレーションでSKILL.mdとテンプレートに軽微な更新が入る見込みです。
それらの実行による実際の計画出力、セッションディレクトリ、調査レポートはローカルのverification/配下に保持されます(実行ごとに1つのサブディレクトリ)。このディレクトリはgitignoredです。生の成果物は大きくマシン固有であるため、このリポジトリの一部ではありません。これまでの実行には、AgentDBコミットfab7d9dに対する変更スコープの計画+実行(永続的な冪等アペンドリプレイ; 8つの障害モードカテゴリすべてにわたる16の仮説を含む670行の計画)、線形化可能性チェックを伴う一貫性+クラッシュリカバリ実行、完全なカバレッジマトリックスを備えたプロジェクト全体の計画、およびLMCacheに対するクロスサーバー多層実行が含まれます。
evals/ディレクトリには、イテレーション間のSKILL.md本体への動作変更を健全性チェックするための手動回帰プロンプト(設計スキルと実行スキル用の個別のevals.json)が保持されています。これらは作者のローカルSUTチェックアウトを参照するため、自動スイートではなく手動で再実行するプロンプトです — evals/README.mdを参照してください。
手法カタログは、Andrey Satarinの包括的なtesting-distributed-systemsカタログから抽出されました。カタログの基盤となる重要な論文は以下のとおりです:
MIT.
| ID | 判定 | ネメシスの着地証拠 | 削減クラス |
|---|
| S3 | PASS-hardening | iptables ctr 0→14,712; raft re-election at T+1.8s | n/a |
| S4 | FAIL-reproducible | partition landed; Elle: G2-item anomaly on key K17 | SUT |
| S7 | INCONCLUSIVE-fault-not-proven | iptables rule installed but counter stayed 0 — wrong chain | harness |
| S9 | PARTIAL-model | landing ok; checker covered per-key, not cross-key | n/a |
| ファイル | どのようなときに使うか |
|---|
catalog-index.md | セレクターページ — ここから始める |
jepsen-and-elle.md | 障害下での線形化可能性/直列化可能性 |
deterministic-simulation.md | シードから再現可能なバグ; 非同期処理の多いコード |
chaos-and-fault-injection.md | 実クラスターでの部分/非対称障害 |
fuzzing.md | サニタイザー下での入力または並行性ファジング |
formal-methods-tla.md | 設計時におけるプロトコル正当性 |
property-and-metamorphic.md | 代数則/メタモルフィック関係テスト |
performance-and-benchmarking.md | テールレイテンシ/スループット/公平性 |
crash-recovery-and-upgrade.md | 永続性、リプレイ、冪等性、バージョン混在 |