jpskill.com
🛠️ 開発・MCP コミュニティ

chaos-engineer

システムの耐障害性を高めるため、計画的な実験を通じて障害注入や回復力テストを実施し、堅牢なシステムを構築するSkill。

📜 元の英語説明(参考)

Expert in resilience testing, fault injection, and building anti-fragile systems using controlled experiments.

🇯🇵 日本人クリエイター向け解説

一言でいうと

システムの耐障害性を高めるため、計画的な実験を通じて障害注入や回復力テストを実施し、堅牢なシステムを構築するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o chaos-engineer.zip https://jpskill.com/download/6625.zip && unzip -o chaos-engineer.zip && rm chaos-engineer.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/6625.zip -OutFile "$d\chaos-engineer.zip"; Expand-Archive "$d\chaos-engineer.zip" -DestinationPath $d -Force; ri "$d\chaos-engineer.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して chaos-engineer.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → chaos-engineer フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] カオスエンジニア

カオスエンジニア

目的

フォールトインジェクション、制御された実験、およびアンチフラジャイルなシステム設計に特化した、レジリエンス(回復力)テストとカオスエンジニアリングの専門知識を提供します。制御された障害シナリオ、フェイルオーバーテスト、およびゲームデイ演習を通じて、システムのレジリエンスを検証します。

使用するタイミング

  • 大規模なローンチ前にシステムのレジリエンスを検証する
  • フェイルオーバーメカニズム(データベース、リージョン、ゾーン)をテストする
  • アラートパイプラインを検証する(PagerDutyは発報しましたか?)
  • エンジニアリングチームと「ゲームデイ」を実施する
  • CI/CD(継続的検証)に自動化されたカオスを実装する
  • 特定が難しい分散システムバグ(競合状態、タイムアウト)をデバッグする


2. 意思決定フレームワーク

実験設計マトリックス

何をテストしていますか?
│
├─ **インフラストラクチャ層**
│  ├─ Pods/コンテナですか? → **Pod Kill / コンテナクラッシュ**
│  ├─ ノードですか? → **ノードドレイン / 再起動**
│  └─ ネットワークですか? → **レイテンシ / パケットロス / パーティション**
│
├─ **アプリケーション層**
│  ├─ 依存関係ですか? → **DB/Redisへのアクセスブロック**
│  ├─ リソースですか? → **CPU/メモリ負荷**
│  └─ ロジックですか? → **HTTP 500 / 遅延の注入**
│
└─ **プラットフォーム層**
   ├─ IAMですか? → **キーの取り消し**
   └─ DNSですか? → **DNS解決のブロック**

ツール選択

環境 ツール 最適な用途
Kubernetes Chaos Mesh / Litmus ネイティブK8s実験(ネットワーク、Pod、IO)。
AWS/Cloud AWS FIS / Gremlin クラウドレベルの障害(AZ停止、EC2停止)。
サービスメッシュ Istio Fault Injection アプリケーションレベル(HTTPエラー、遅延)。
Java/Spring Chaos Monkey for Spring アプリケーションレベルのロジック攻撃。

爆発半径の制御

レベル 範囲 リスク 承認が必要
ローカル/開発 単一コンテナ なし
ステージング フルクラスター QAリーダー
本番(カナリア) 1%のトラフィック エンジニアリングディレクター
本番(フル) 全トラフィック 危機的 VP/CTO(ゲームデイ)

危険信号 → sre-engineer にエスカレートしてください:

  • 「停止ボタン」メカニズムが利用できない
  • 可観測性のギャップ(死角)
  • 緩和策なしに連鎖的な障害のリスクが特定された
  • ステートフルデータ実験のバックアップがない


4. コアワークフロー

ワークフロー 1: Kubernetes Pod カオス (Chaos Mesh)

目標: フロントエンドがバックエンドPodの障害を適切に処理することを確認します。

手順:

  1. 実験の定義 (backend-kill.yaml)

    apiVersion: chaos-mesh.org/v1alpha1
    kind: PodChaos
    metadata:
      name: backend-kill
      namespace: chaos-testing
    spec:
      action: pod-kill
      mode: one
      selector:
        namespaces:
          - prod
        labelSelectors:
          app: backend-service
      duration: "30s"
      scheduler:
        cron: "@every 1m"
  2. 仮説の定義

    • もし バックエンドPodが停止した場合、そのとき Kubernetesは5秒以内にそれを再起動し、そして フロントエンドは500エラーをシームレスに再試行します(エラー率1%未満)。
  3. 実行と監視

    • マニフェストを適用します。
    • Grafanaダッシュボード:「HTTP 500レート」対「Pod再起動回数」を監視します。
  4. 検証

    • Podは再起動しましたか? はい。
    • ユーザーはエラーを見ましたか? いいえ(再試行が機能しました)。
    • 結果: 合格


ワークフロー 3: ゾーン停止シミュレーション (ゲームデイ)

目標: データベースのセカンダリリージョンへのフェイルオーバーを検証します。

手順:

  1. 準備

    • オンコールチームに通知します(ゲームデイ)。
    • プライマリDBの書き込みがアクティブであることを確認します。
  2. 実行 (AWS FIS / 手動)

    • ゾーンAサブネットへのネットワークトラフィックをブロックします。
    • または、RDSプライマリインスタンスを停止します(クラッシュをシミュレート)。
  3. 測定

    • RTO (Recovery Time Objective): セカンダリがプライマリになるまでの時間を測定します(目標: 60秒未満)。
    • RPO (Recovery Point Objective): データ損失はありましたか?(目標: 0)。


5. アンチパターンと落とし穴

❌ アンチパターン 1: 本番環境での最初のテスト

どのようなものか:

  • ステージングでテストせずに、本番環境で「データベースを削除する」スクリプトを実行する。

なぜ失敗するのか:

  • 壊滅的なデータ損失。
  • 履歴書作成イベント(RGE)。

正しいアプローチ:

  • 開発 → ステージング → カナリア → 本番。
  • まず下位環境で仮説を検証します。

❌ アンチパターン 2: 可観測性なし

どのようなものか:

  • ダッシュボードを開かずにカオスを実行する。
  • 「うまくいったと思う、アプリが遅いだけだ。」

なぜ失敗するのか:

  • なぜ失敗したのかがわからない。
  • レジリエンスを証明できない。

正しいアプローチ:

  • 可観測性第一: 測定できないものは壊さないでください。

❌ アンチパターン 3: ランダムなカオス (Chaos Monkeyスタイル)

どのようなものか:

  • 目的もなくランダムなものを常に停止させる。

なぜ失敗するのか:

  • アラート疲労を引き起こす。
  • 特定の障害モード(例:ネットワークパーティション対クラッシュ)をテストしない。

正しいアプローチ:

  • 思慮深い実験: ターゲットを絞ったシナリオを設計します(例:「Redisが遅くなったらどうなるか?」)。ランダムなカオスはメンテナンスのためであり、ターゲットを絞ったカオスは検証のためです。


7. 品質チェックリスト

計画:

  • [ ] 仮説: 明確に定義されている(「Xが発生した場合、Yが発生するはず」)。
  • [ ] 爆発半径: 限定されている(例:1ゾーン、1%のユーザー)。
  • [ ] 承認: 関係者に通知済み(またはゲームデイをスケジュール済み)。

安全性:

  • [ ] 停止ボタン: 自動中止スクリプトが準備されている。
  • [ ] ロールバック: 必要に応じて状態を復元する計画。
  • [ ] バックアップ: ステートフルな実験の前にデータがバックアップされている。

実行:

  • [ ] 監視: 実験中にダッシュボードが表示されている。
  • [ ] ログ記録: 相関のために実験の開始/終了時刻がログに記録されている。

レビュー:

  • [ ] 修正: アクションアイテムが割り当てられている(Jira)。
  • [ ] レポート: 調査結果がエンジニアリングチームと共有されている。

例 1: Kubernetes Pod障害からの回復

シナリオ: マイクロサービスプラットフォームは、カートサービスがユーザーのチェックアウトフローに影響を与えることなく、Podの障害を適切に処理することを確認する必要があります。

実験設計:

  1. 仮説: カートサービスPodが停止した場合、Kubernetesは5秒以内に再スケジュールし、
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Chaos Engineer

Purpose

Provides resilience testing and chaos engineering expertise specializing in fault injection, controlled experiments, and anti-fragile system design. Validates system resilience through controlled failure scenarios, failover testing, and game day exercises.

When to Use

  • Verifying system resilience before a major launch
  • Testing failover mechanisms (Database, Region, Zone)
  • Validating alert pipelines (Did PagerDuty fire?)
  • Conducting "Game Days" with engineering teams
  • Implementing automated chaos in CI/CD (Continuous Verification)
  • Debugging elusive distributed system bugs (Race conditions, timeouts)


2. Decision Framework

Experiment Design Matrix

What are we testing?
│
├─ **Infrastructure Layer**
│  ├─ Pods/Containers? → **Pod Kill / Container Crash**
│  ├─ Nodes? → **Node Drain / Reboot**
│  └─ Network? → **Latency / Packet Loss / Partition**
│
├─ **Application Layer**
│  ├─ Dependencies? → **Block Access to DB/Redis**
│  ├─ Resources? → **CPU/Memory Stress**
│  └─ Logic? → **Inject HTTP 500 / Delays**
│
└─ **Platform Layer**
   ├─ IAM? → **Revoke Keys**
   └─ DNS? → **Block DNS Resolution**

Tool Selection

Environment Tool Best For
Kubernetes Chaos Mesh / Litmus Native K8s experiments (Network, Pod, IO).
AWS/Cloud AWS FIS / Gremlin Cloud-level faults (AZ outage, EC2 stop).
Service Mesh Istio Fault Injection Application level (HTTP errors, delays).
Java/Spring Chaos Monkey for Spring App-level logic attacks.

Blast Radius Control

Level Scope Risk Approval Needed
Local/Dev Single container Low None
Staging Full cluster Medium QA Lead
Production (Canary) 1% Traffic High Engineering Director
Production (Full) All Traffic Critical VP/CTO (Game Day)

Red Flags → Escalate to sre-engineer:

  • No "Stop Button" mechanism available
  • Observability gaps (Blind spots)
  • Cascading failure risk identified without mitigation
  • Lack of backups for stateful data experiments


4. Core Workflows

Workflow 1: Kubernetes Pod Chaos (Chaos Mesh)

Goal: Verify that the frontend handles backend pod failures gracefully.

Steps:

  1. Define Experiment (backend-kill.yaml)

    apiVersion: chaos-mesh.org/v1alpha1
    kind: PodChaos
    metadata:
      name: backend-kill
      namespace: chaos-testing
    spec:
      action: pod-kill
      mode: one
      selector:
        namespaces:
          - prod
        labelSelectors:
          app: backend-service
      duration: "30s"
      scheduler:
        cron: "@every 1m"
  2. Define Hypothesis

    • If a backend pod dies, then Kubernetes will restart it within 5 seconds, and the frontend will retry 500s seamlessly ( < 1% error rate).
  3. Execute & Monitor

    • Apply manifest.
    • Watch Grafana dashboard: "HTTP 500 Rate" vs "Pod Restart Count".
  4. Verification

    • Did the pod restart? Yes.
    • Did users see errors? No (Retries worked).
    • Result: PASS.


Workflow 3: Zone Outage Simulation (Game Day)

Goal: Verify database failover to secondary region.

Steps:

  1. Preparation

    • Notify on-call team (Game Day).
    • Ensure primary DB writes are active.
  2. Execution (AWS FIS / Manual)

    • Block network traffic to Zone A subnets.
    • OR Stop RDS Primary instance (Simulate crash).
  3. Measurement

    • Measure RTO (Recovery Time Objective): How long until Secondary becomes Primary? (Target: < 60s).
    • Measure RPO (Recovery Point Objective): Any data lost? (Target: 0).


5. Anti-Patterns & Gotchas

❌ Anti-Pattern 1: Testing in Production First

What it looks like:

  • Running a "delete database" script in prod without testing in staging.

Why it fails:

  • Catastrophic data loss.
  • Resume Generating Event (RGE).

Correct approach:

  • Dev → Staging → Canary → Prod.
  • Verify hypothesis in lower environments first.

❌ Anti-Pattern 2: No Observability

What it looks like:

  • Running chaos without dashboards open.
  • "I think it worked, the app is slow."

Why it fails:

  • You don't know why it failed.
  • You can't prove resilience.

Correct approach:

  • Observability First: If you can't measure it, don't break it.

❌ Anti-Pattern 3: Random Chaos (Chaos Monkey Style)

What it looks like:

  • Killing random things constantly without purpose.

Why it fails:

  • Causes alert fatigue.
  • Doesn't test specific failure modes (e.g., network partition vs crash).

Correct approach:

  • Thoughtful Experiments: Design targeted scenarios (e.g., "What if Redis is slow?"). Random chaos is for maintenance, targeted chaos is for verification.


7. Quality Checklist

Planning:

  • [ ] Hypothesis: Clearly defined ("If X happens, Y should occur").
  • [ ] Blast Radius: Limited (e.g., 1 zone, 1% users).
  • [ ] Approval: Stakeholders notified (or scheduled Game Day).

Safety:

  • [ ] Stop Button: Automated abort script ready.
  • [ ] Rollback: Plan to restore state if needed.
  • [ ] Backup: Data backed up before stateful experiments.

Execution:

  • [ ] Monitoring: Dashboards visible during experiment.
  • [ ] Logging: Experiment start/end times logged for correlation.

Review:

  • [ ] Fix: Action items assigned (Jira).
  • [ ] Report: Findings shared with engineering team.

Examples

Example 1: Kubernetes Pod Failure Recovery

Scenario: A microservices platform needs to verify that their cart service handles pod failures gracefully without impacting user checkout flow.

Experiment Design:

  1. Hypothesis: If a cart-service pod is killed, Kubernetes will reschedule within 5 seconds, and users will see less than 0.1% error rate
  2. Chaos Injection: Use Chaos Mesh to kill random pods in the production namespace
  3. Monitoring: Track error rates, pod restart times, and user-facing failures

Execution Results:

  • Pod restart time: 3.2 seconds average (within SLA)
  • Error rate during experiment: 0.02% (below 0.1% threshold)
  • Circuit breakers prevented cascading failures
  • Users experienced seamless failover

Lessons Learned:

  • Retry logic was working but needed exponential backoff
  • Added fallback response for stale cart data
  • Created runbook for pod failure scenarios

Example 2: Database Failover Validation

Scenario: A financial services company needs to verify their multi-region database failover meets RTO of 30 seconds and RPO of zero data loss.

Game Day Setup:

  1. Preparation: Notified all stakeholders, backed up current state
  2. Primary Zone Blockage: Used AWS FIS to simulate zone failure
  3. Failover Trigger: Automated failover initiated when health checks failed
  4. Measurement: Tracked RTO, RPO, and application recovery

Measured Results: | Metric | Target | Actual | Status | |--------|--------|--------|--------| | RTO | < 30s | 18s | ✅ PASS | | RPO | 0 data | 0 data | ✅ PASS | | Application recovery | < 60s | 42s | ✅ PASS | | Data consistency | 100% | 100% | ✅ PASS |

Improvements Identified:

  • DNS TTL was too high (5 minutes), reduced to 30 seconds
  • Application connection pooling needed pre-warming
  • Added health check for database replication lag

Example 3: Third-Party API Dependency Testing

Scenario: A SaaS platform depends on a payment processor API and needs to verify graceful degradation when the API is slow or unavailable.

Fault Injection Strategy:

  1. Delay Injection: Using Istio to add 5-10 second delays to payment API calls
  2. Timeout Validation: Verify circuit breakers open within configured timeouts
  3. Fallback Testing: Ensure users see appropriate error messages

Test Scenarios:

  • 50% of requests delayed 10s: Circuit breaker opens, fallback shown
  • 100% delay: System degrades gracefully with queue-based processing
  • Recovery: System reconnects properly after fault cleared

Results:

  • Circuit breaker threshold: 5 consecutive failures (needed adjustment)
  • Fallback UI: 94% of users completed purchase via alternative method
  • Alert tuning: Reduced false positives by tuning latency thresholds

Best Practices

Experiment Design

  • Start with Hypothesis: Define what you expect to happen before running experiments
  • Limit Blast Radius: Always start with small scope and expand gradually
  • Measure Steady State: Establish baseline metrics before introducing chaos
  • Document Everything: Record experiment parameters, expectations, and outcomes
  • Iterate and Evolve: Use findings to design more comprehensive experiments

Safety and Controls

  • Always Have a Stop Button: Can you abort the experiment immediately?
  • Define Rollback Plan: How do you restore normal operations?
  • Communication: Notify stakeholders before and during experiments
  • Timing: Avoid experiments during critical business periods
  • Escalation Path: Know when to stop and call for help

Tool Selection

  • Match Tool to Environment: Kubernetes → Chaos Mesh/Litmus, AWS → FIS
  • Service Mesh Integration: Use Istio/Linkerd for application-level faults
  • Cloud-Native Tools: Leverage managed chaos services where available
  • Custom Tools: Build application-specific chaos when needed
  • Multi-Cloud: Consider tools that work across cloud providers

Observability Integration

  • Pre-Experiment Validation: Ensure dashboards and alerts are working
  • Metrics Collection: Capture before/during/after metrics
  • Log Analysis: Review logs for unexpected behavior
  • Distributed Tracing: Use traces to understand failure propagation
  • Alert Validation: Verify alerts fire as expected during experiments

Cultural Aspects

  • Blame-Free Post-Mortems: Focus on system improvement, not finger-pointing
  • Regular Game Days: Schedule chaos exercises as routine team activities
  • Cross-Team Participation: Include on-call, developers, and operations
  • Share Learnings: Document and share experiment results broadly
  • Reward Resilience: Recognize teams that build resilient systems