[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-94be62a4-2cac-456d-b81f-a04b7a4a5d90":3,"$fmTGiII-TjIWfeEHQ2Eywa3tuF26KMfskcN3luxfE4hQ":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"94be62a4-2cac-456d-b81f-a04b7a4a5d90","chaos-engineering","使用于规划、运行或从混沌工程实验中学习时。触发于“混沌实验”、“故障注入”、“游戏日”、“弹性测试”、“爆炸半径”、“稳态”、“中止标准”、“混沌工具包”、“混沌网格”、“Litmus”、“Gremlin”、“AWS FIS”或任何故意的故障注入问题。包含实验设计师、爆炸半径计算器和事后分析生成器（所有stdlib Python），4个关于混沌原理+实验设计+攻击分类+工具的参考...","cat_coding_devops","mod_coding","alirezarezvani,coding","---\nname: chaos-engineering\ndescription: Use when planning, running, or learning from chaos engineering experiments. Triggers on \"chaos experiment\", \"fault injection\", \"gameday\", \"resilience test\", \"blast radius\", \"steady state\", \"abort criteria\", \"Chaos Toolkit\", \"Chaos Mesh\", \"Litmus\", \"Gremlin\", \"AWS FIS\", or any deliberate failure-injection question. Ships experiment designer, blast-radius calculator, and postmortem generator (all stdlib Python), 4 references on chaos principles + experiment design + attack taxonomy + tooling landscape, and a \u002Fchaos-experiment slash command. Composes with feature-flags-architect (kill switches as abort triggers) and kubernetes-operator (common chaos targets).\ncontext: fork\nversion: 2.4.0\nauthor: claude-code-skills\nlicense: MIT\ntags: [chaos-engineering, resilience, fault-injection, gameday, sre, reliability, chaos-toolkit, chaos-mesh, litmus, gremlin, aws-fis]\ncompatible_tools: [claude-code, codex-cli, cursor, antigravity, opencode, gemini-cli]\n---\n\n# Chaos Engineering\n\nDesign experiments that surface real weaknesses in production systems — without becoming outages. Most \"chaos engineering\" attempts skip steady-state measurement, define no abort criteria, and have no blast-radius bound. This skill enforces the discipline that makes chaos experiments safe and useful.\n\n## When to use\n\n- Planning a chaos experiment (what to break, where, when, how to abort)\n- Calculating blast radius before running the experiment\n- Reviewing an existing experiment plan for safety\n- Choosing a chaos tool (Chaos Toolkit \u002F Chaos Mesh \u002F Litmus \u002F Gremlin \u002F AWS FIS)\n- Writing a chaos experiment postmortem\n- Running a Game Day exercise\n\n## When NOT to use\n\n- General incident response (use `incident-response`)\n- Threat hunting \u002F red-team (use `red-team`, `threat-detection`)\n- Performance load testing (different goal — chaos is about failure modes, not capacity)\n- Production debugging (chaos discovers weaknesses preemptively, not after-the-fact)\n\n## Core principle: chaos without abort criteria is an outage\n\nThe 4 Principles of Chaos Engineering (Netflix, 2016):\n\n1. **Build a hypothesis around steady-state behavior.** Not \"what breaks?\" but \"X holds; will it still hold under fault Y?\"\n2. **Vary real-world events.** Inject realistic failures: kill nodes, slow networks, lose cache, throttle dependencies.\n3. **Run experiments in production.** Staging never has the same failure modes. Start small.\n4. **Automate experiments to run continuously.** One-off chaos is a press release; continuous chaos is engineering.\n\nAdd a fifth: **Define abort criteria up front.** A chaos experiment with no abort criteria is an outage by another name.\n\n## Quick start\n\n```bash\nSKILL=engineering\u002Fchaos-engineering\u002Fskills\u002Fchaos-engineering\n\n# 1. Design an experiment\npython \"$SKILL\u002Fscripts\u002Fexperiment_designer.py\" --target \"checkout-svc\" --hypothesis \"p99 latency stays \u003C500ms\" --attack latency --duration-min 15\n\n# 2. Calculate blast radius\npython \"$SKILL\u002Fscripts\u002Fblast_radius_calculator.py\" --traffic-share 0.05 --user-pop 1000000 --duration-min 15\n\n# 3. Generate postmortem after the experiment\npython \"$SKILL\u002Fscripts\u002Fexperiment_postmortem.py\" --plan experiment.json --result-log results.txt\n```\n\n## The 3 Python tools\n\nAll stdlib-only. Run with `--help`.\n\n### `experiment_designer.py`\n\nGenerates a structured experiment plan from inputs. Enforces the required sections (hypothesis, steady-state metric, blast radius, abort criteria, rollback).\n\n```bash\npython scripts\u002Fexperiment_designer.py \\\n  --target \"checkout-svc\" \\\n  --hypothesis \"p99 latency stays \u003C500ms when payment-svc is slow\" \\\n  --attack latency \\\n  --magnitude \"+200ms\" \\\n  --duration-min 15 \\\n  --blast-radius \"5% of US traffic\" \\\n  --abort-if \"p99 > 1000ms OR error_rate > baseline + 1pp\"\n```\n\nOutputs a markdown plan with: hypothesis, steady-state, attack, magnitude, duration, blast radius, abort criteria, rollback procedure, monitoring dashboards, and learning question.\n\n### `blast_radius_calculator.py`\n\nComputes the blast radius of a planned experiment. Given traffic share + user population + duration, calculates expected affected users, expected error budget burn, and a risk score.\n\n```bash\npython scripts\u002Fblast_radius_calculator.py \\\n  --traffic-share 0.05 \\\n  --user-pop 1000000 \\\n  --duration-min 15 \\\n  --baseline-availability 0.999 \\\n  --expected-impact-availability 0.95\n```\n\nOutputs:\n- Expected affected users\n- Error budget consumed (in minutes of error budget)\n- Risk score: GREEN \u002F YELLOW \u002F RED\n- Recommendation: PROCEED \u002F REDUCE \u002F ABORT\n\nGREEN = \u003C1% error budget; YELLOW = 1-10%; RED = >10%.\n\n### `experiment_postmortem.py`\n\nProduces a structured postmortem from an experiment plan + results. Catches the common postmortem failure modes: no learning recorded, no follow-up actions, blame-laden language.\n\n```bash\npython scripts\u002Fexperiment_postmortem.py --plan experiment.json --result-log results.txt\n```\n\nOutputs markdown with: summary, hypothesis (was it confirmed\u002Frefuted?), what we learned, what surprised us, follow-up actions with owners, and link to next experiment.\n\n## The 7 attack types (taxonomy)\n\nDifferent attacks reveal different weaknesses. See `references\u002Fattack_taxonomy.md` for full detail.\n\n| Attack | What it tests | Tooling |\n|---|---|---|\n| **Latency** | Timeouts, retries, circuit breakers | tc, Chaos Mesh `NetworkChaos` |\n| **Error** | Error handling, fallback paths | Chaos Mesh `HTTPChaos`, Toxiproxy |\n| **Resource** (CPU, memory, disk) | Saturation handling, autoscaling | Chaos Mesh `StressChaos`, stress-ng |\n| **Network partition** | Split-brain, consensus, failover | Chaos Mesh `NetworkChaos` partition |\n| **Dependency failure** | Graceful degradation, fallback | Service mesh fault injection |\n| **Time** | Clock skew, NTP issues | libfaketime, Chaos Mesh `TimeChaos` |\n| **Infrastructure** (kill instance) | Auto-recovery, failover | AWS FIS, Chaos Monkey |\n\nPick the attack that matches the hypothesis. \"What happens if X is slow?\" → latency. \"What happens if X loses network?\" → partition.\n\n## Tooling chooser\n\n| Tool | Best for | Pricing | Stack |\n|---|---|---|---|\n| **Chaos Toolkit** | Lightweight, language-agnostic, JSON experiments | OSS | Any |\n| **Chaos Mesh** | Kubernetes-native, rich CRDs, in-cluster | OSS | Kubernetes |\n| **Litmus** | Kubernetes, Argo-integrated, large library | OSS + Enterprise | Kubernetes |\n| **Gremlin** | Enterprise SaaS, multi-cloud, audit | Paid | Any |\n| **AWS FIS** | AWS-native, IAM-integrated, EC2\u002FECS\u002FEKS | Paid (AWS) | AWS |\n| **Custom** | Niche needs, single-cloud, low budget | None | Any |\n\nDecision rules:\n- k8s-only stack + OSS → Chaos Mesh or Litmus (Litmus has bigger experiment library)\n- Multi-cloud + OSS → Chaos Toolkit\n- AWS-heavy + simple needs → AWS FIS\n- Enterprise + audit\u002Fcompliance → Gremlin\n\nSee `references\u002Ftooling_landscape.md` for trade-offs.\n\n## Workflows\n\n### Workflow 1: Design and run a single experiment\n\n```\n1. State a hypothesis: \"When [fault], steady-state metric X stays within Y.\"\n2. Identify the steady-state metric — must be measurable BEFORE the experiment.\n3. Run blast_radius_calculator.py — confirm GREEN before proceeding.\n4. Run experiment_designer.py to produce the plan.\n5. Get a peer review of the plan; confirm abort criteria are concrete.\n6. Notify the on-call team in #incidents (or whatever channel).\n7. Run the experiment with monitoring open.\n8. If abort criteria are hit, abort immediately; record what happened.\n9. Run experiment_postmortem.py to capture learnings.\n10. File follow-up actions; link to next experiment.\n```\n\n### Workflow 2: Game Day exercise\n\n```\n1. Pick a scenario (e.g., \"primary database fails over\").\n2. Identify all dependent services that should keep working.\n3. Build a multi-experiment plan covering each layer.\n4. Schedule with stakeholders; on-call coverage required.\n5. Run with a facilitator who manages the scenario.\n6. Capture observations in a shared doc as they happen.\n7. Single combined postmortem covering all observations.\n8. Track follow-up actions in a board with owners.\n```\n\n### Workflow 3: Continuous chaos (game days → daily)\n\n```\n1. Start: weekly Game Day in staging.\n2. Move to: weekly Game Day in production with limited blast radius.\n3. Mature to: continuous chaos via scheduled experiments (Litmus chaos schedule, Gremlin scenarios).\n4. Wire to deployment: every prod deploy triggers a baseline chaos sweep.\n5. Track: experiments per week, weaknesses discovered, MTTR trend.\n```\n\n## Composition with other skills\n\nThis skill explicitly composes with two others in this library:\n\n| Skill | Composition |\n|---|---|\n| `feature-flags-architect` | Kill switches defined there are the abort triggers here |\n| `kubernetes-operator` | Operators are common chaos targets (test reconcile under fault) |\n| `incident-response` | Chaos experiments that escalate become incidents |\n\n## Anti-patterns\n\n- **No hypothesis** — \"let's break things\" is sabotage, not engineering\n- **No steady-state metric** — without a baseline, you can't tell if X broke\n- **No blast radius bound** — full-prod experiment without limits = outage\n- **No abort criteria** — see above; this is mandatory\n- **No on-call coverage** — chaos without monitoring is unmonitored production\n- **Chaos in staging only** — staging never has prod failure modes\n- **Chaos in dev** — useless; dev has different failure modes from prod\n- **One-off chaos** — single experiment is a press release; learning requires recurrence\n- **Blame-laden postmortem** — record causes, not blame; teams stop running chaos otherwise\n\n## References\n\n- `references\u002Fchaos_principles.md` — the 4 principles, history, when to start\n- `references\u002Fexperiment_design.md` — hypothesis structure, steady-state metrics, abort criteria\n- `references\u002Fattack_taxonomy.md` — 7 attack types with examples and tooling\n- `references\u002Ftooling_landscape.md` — Chaos Toolkit \u002F Mesh \u002F Litmus \u002F Gremlin \u002F FIS \u002F DIY\n\n## Slash command\n\n`\u002Fchaos-experiment` — interactive experiment design wizard that runs all 3 tools.\n\n## Asset templates\n\n- `assets\u002Fexperiment_template.md` — fill-in plan template\n- `assets\u002Fpostmortem_template.md` — structured postmortem template\n\n## Verifiable success\n\nA team using this skill should achieve:\n\n- 100% of chaos experiments have a written hypothesis, abort criteria, and blast-radius calculation\n- Blast radius for any single experiment never exceeds 10% of error budget\n- Mean time between chaos experiments \u003C14 days (continuous, not one-off)\n- Each experiment produces ≥1 follow-up action that gets shipped\n- No chaos experiment escalates to a customer-impacting incident in trailing 90 days\n","","imported","https:\u002F\u002Fgithub.com\u002Falirezarezvani\u002Fclaude-skills","user_system_seed","SkillOPIC",true,66,846,"2026-05-16 13:53:22",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"621ac8af-584c-4530-bedf-8a9a1bd5d133","1.0.0","chaos-engineering.zip",23627,"uploads\u002Fskills\u002F94be62a4-2cac-456d-b81f-a04b7a4a5d90\u002Fchaos-engineering.zip","823bd1da24a65b6cfdb47b16f33aa4689bf2cdbc494495425d10471ff461cc67","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":10690},{\"path\":\"assets\u002Fexperiment_template.md\",\"isDirectory\":false,\"size\":2410},{\"path\":\"assets\u002Fpostmortem_template.md\",\"isDirectory\":false,\"size\":1534},{\"path\":\"references\u002Fattack_taxonomy.md\",\"isDirectory\":false,\"size\":5881},{\"path\":\"references\u002Fchaos_principles.md\",\"isDirectory\":false,\"size\":5456},{\"path\":\"references\u002Fexperiment_design.md\",\"isDirectory\":false,\"size\":5741},{\"path\":\"references\u002Ftooling_landscape.md\",\"isDirectory\":false,\"size\":6269},{\"path\":\"scripts\u002Fblast_radius_calculator.py\",\"isDirectory\":false,\"size\":4574},{\"path\":\"scripts\u002Fexperiment_designer.py\",\"isDirectory\":false,\"size\":6473},{\"path\":\"scripts\u002Fexperiment_postmortem.py\",\"isDirectory\":false,\"size\":5187}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]