混沌工程实验设计与复盘
chaos-engineering
在规划、执行或复盘混沌工程实验时使用。触发词包括「混沌实验」「故障注入」「gameday」「韧性测试」「爆炸半径」「稳态」「中止条件」「Chaos Toolkit」「Chaos Mesh」「Litmus」「Gremlin」「AWS FIS」,或任何刻意注入故障的问题。自带实验设计器、爆炸半径计算器和事后复盘生成器(均为 Python 标准库实现),提供 4 份参考资料,涵盖混沌原理、实验设计、攻击分类与工具生态,并提供 /chaos-experiment 斜杠命令。可与 feature-flags-architect(将终止开关作为中止触发器)和 kubernetes-operator(常见混沌目标)组合使用。
- License 许可
- MIT
- 最近更新
- 2026-10-28
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- chaos-engineering
- tags
- [ "chaos-engineering", "resilience", "fault-injection", "gameday", "sre", "reliability", "chaos-toolkit", "chaos-mesh", "litmus", "gremlin", "aws-fis" ]
- author
- claude-code-skills
- context
- fork
- license
- MIT
- version
- 2.9.0
- description
- 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 /chaos-experiment slash command. Composes with feature-flags-architect (kill switches as abort triggers) and kubernetes-operator (common chaos targets).
- compatible_tools
- [ "claude-code", "codex-cli", "cursor", "antigravity", "opencode", "gemini-cli" ]
02 资源文件 9
- 资产文件assets/experiment_template.md2.4 KB
- 资产文件assets/postmortem_template.md1.5 KB
- 参考文档references/attack_taxonomy.md5.7 KB
- 参考文档references/chaos_principles.md5.3 KB
- 参考文档references/experiment_design.md5.6 KB
- 参考文档references/tooling_landscape.md6.1 KB
- 脚本scripts/blast_radius_calculator.py4.9 KB
- 脚本scripts/experiment_designer.py6.3 KB
- 脚本scripts/experiment_postmortem.py5.1 KB
03 SKILL.md 正文
Chaos Engineering
Design 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.
When to use
- Planning a chaos experiment (what to break, where, when, how to abort)
- Calculating blast radius before running the experiment
- Reviewing an existing experiment plan for safety
- Choosing a chaos tool (Chaos Toolkit / Chaos Mesh / Litmus / Gremlin / AWS FIS)
- Writing a chaos experiment postmortem
- Running a Game Day exercise
When NOT to use
- General incident response (use
incident-response) - Threat hunting / red-team (use
red-team,threat-detection) - Performance load testing (different goal — chaos is about failure modes, not capacity)
- Production debugging (chaos discovers weaknesses preemptively, not after-the-fact)
Core principle: chaos without abort criteria is an outage
The 4 Principles of Chaos Engineering (Netflix, 2016):
- Build a hypothesis around steady-state behavior. Not "what breaks?" but "X holds; will it still hold under fault Y?"
- Vary real-world events. Inject realistic failures: kill nodes, slow networks, lose cache, throttle dependencies.
- Run experiments in production. Staging never has the same failure modes. Start small.
- Automate experiments to run continuously. One-off chaos is a press release; continuous chaos is engineering.
Add a fifth: Define abort criteria up front. A chaos experiment with no abort criteria is an outage by another name.
Quick start
SKILL=engineering/chaos-engineering/skills/chaos-engineering
# 1. Design an experiment
python "$SKILL/scripts/experiment_designer.py" --target "checkout-svc" --hypothesis "p99 latency stays <500ms" --attack latency --duration-min 15
# 2. Calculate blast radius
python "$SKILL/scripts/blast_radius_calculator.py" --traffic-share 0.05 --user-pop 1000000 --duration-min 15
# 3. Generate postmortem after the experiment
python "$SKILL/scripts/experiment_postmortem.py" --plan experiment.json --result-log results.txt
The 3 Python tools
All stdlib-only. Run with --help.
experiment_designer.py
Generates a structured experiment plan from inputs. Enforces the required sections (hypothesis, steady-state metric, blast radius, abort criteria, rollback).
python scripts/experiment_designer.py \
--target "checkout-svc" \
--hypothesis "p99 latency stays <500ms when payment-svc is slow" \
--attack latency \
--magnitude "+200ms" \
--duration-min 15 \
--blast-radius "5% of US traffic" \
--abort-if "p99 > 1000ms OR error_rate > baseline + 1pp"
Outputs a markdown plan with: hypothesis, steady-state, attack, magnitude, duration, blast radius, abort criteria, rollback procedure, monitoring dashboards, and learning question.
blast_radius_calculator.py
Computes 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.
python scripts/blast_radius_calculator.py \
--traffic-share 0.05 \
--user-pop 1000000 \
--duration-min 15 \
--baseline-availability 0.999 \
--expected-impact-availability 0.95
Outputs:
- Expected affected users
- Error budget consumed (in minutes of error budget)
- Risk score: GREEN / YELLOW / RED
- Recommendation: PROCEED / REDUCE / ABORT
GREEN = <1% error budget; YELLOW = 1-10%; RED = >10%.
experiment_postmortem.py
Produces a structured postmortem from an experiment plan + results. Catches the common postmortem failure modes: no learning recorded, no follow-up actions, blame-laden language.
python scripts/experiment_postmortem.py --plan experiment.json --result-log results.txt
Outputs markdown with: summary, hypothesis (was it confirmed/refuted?), what we learned, what surprised us, follow-up actions with owners, and link to next experiment.
The 7 attack types (taxonomy)
Different attacks reveal different weaknesses. See references/attack_taxonomy.md for full detail.
| Attack | What it tests | Tooling |
|---|---|---|
| Latency | Timeouts, retries, circuit breakers | tc, Chaos Mesh NetworkChaos |
| Error | Error handling, fallback paths | Chaos Mesh HTTPChaos, Toxiproxy |
| Resource (CPU, memory, disk) | Saturation handling, autoscaling | Chaos Mesh StressChaos, stress-ng |
| Network partition | Split-brain, consensus, failover | Chaos Mesh NetworkChaos partition |
| Dependency failure | Graceful degradation, fallback | Service mesh fault injection |
| Time | Clock skew, NTP issues | libfaketime, Chaos Mesh TimeChaos |
| Infrastructure (kill instance) | Auto-recovery, failover | AWS FIS, Chaos Monkey |
Pick the attack that matches the hypothesis. "What happens if X is slow?" → latency. "What happens if X loses network?" → partition.
Tooling chooser
| Tool | Best for | Pricing | Stack |
|---|---|---|---|
| Chaos Toolkit | Lightweight, language-agnostic, JSON experiments | OSS | Any |
| Chaos Mesh | Kubernetes-native, rich CRDs, in-cluster | OSS | Kubernetes |
| Litmus | Kubernetes, Argo-integrated, large library | OSS + Enterprise | Kubernetes |
| Gremlin | Enterprise SaaS, multi-cloud, audit | Paid | Any |
| AWS FIS | AWS-native, IAM-integrated, EC2/ECS/EKS | Paid (AWS) | AWS |
| Custom | Niche needs, single-cloud, low budget | None | Any |
Decision rules:
- k8s-only stack + OSS → Chaos Mesh or Litmus (Litmus has bigger experiment library)
- Multi-cloud + OSS → Chaos Toolkit
- AWS-heavy + simple needs → AWS FIS
- Enterprise + audit/compliance → Gremlin
See references/tooling_landscape.md for trade-offs.
Workflows
Workflow 1: Design and run a single experiment
1. State a hypothesis: "When [fault], steady-state metric X stays within Y."
2. Identify the steady-state metric — must be measurable BEFORE the experiment.
3. Run blast_radius_calculator.py — confirm GREEN before proceeding.
4. Run experiment_designer.py to produce the plan.
5. Get a peer review of the plan; confirm abort criteria are concrete.
6. Notify the on-call team in #incidents (or whatever channel).
7. Run the experiment with monitoring open.
8. If abort criteria are hit, abort immediately; record what happened.
9. Run experiment_postmortem.py to capture learnings.
10. File follow-up actions; link to next experiment.
Workflow 2: Game Day exercise
1. Pick a scenario (e.g., "primary database fails over").
2. Identify all dependent services that should keep working.
3. Build a multi-experiment plan covering each layer.
4. Schedule with stakeholders; on-call coverage required.
5. Run with a facilitator who manages the scenario.
6. Capture observations in a shared doc as they happen.
7. Single combined postmortem covering all observations.
8. Track follow-up actions in a board with owners.
Workflow 3: Continuous chaos (game days → daily)
1. Start: weekly Game Day in staging.
2. Move to: weekly Game Day in production with limited blast radius.
3. Mature to: continuous chaos via scheduled experiments (Litmus chaos schedule, Gremlin scenarios).
4. Wire to deployment: every prod deploy triggers a baseline chaos sweep.
5. Track: experiments per week, weaknesses discovered, MTTR trend.
Composition with other skills
This skill explicitly composes with two others in this library:
| Skill | Composition |
|---|---|
feature-flags-architect |
Kill switches defined there are the abort triggers here |
kubernetes-operator |
Operators are common chaos targets (test reconcile under fault) |
incident-response |
Chaos experiments that escalate become incidents |
Anti-patterns
- No hypothesis — "let's break things" is sabotage, not engineering
- No steady-state metric — without a baseline, you can't tell if X broke
- No blast radius bound — full-prod experiment without limits = outage
- No abort criteria — see above; this is mandatory
- No on-call coverage — chaos without monitoring is unmonitored production
- Chaos in staging only — staging never has prod failure modes
- Chaos in dev — useless; dev has different failure modes from prod
- One-off chaos — single experiment is a press release; learning requires recurrence
- Blame-laden postmortem — record causes, not blame; teams stop running chaos otherwise
References
references/chaos_principles.md— the 4 principles, history, when to startreferences/experiment_design.md— hypothesis structure, steady-state metrics, abort criteriareferences/attack_taxonomy.md— 7 attack types with examples and toolingreferences/tooling_landscape.md— Chaos Toolkit / Mesh / Litmus / Gremlin / FIS / DIY
Slash command
/chaos-experiment — interactive experiment design wizard that runs all 3 tools.
Asset templates
assets/experiment_template.md— fill-in plan templateassets/postmortem_template.md— structured postmortem template
Verifiable success
A team using this skill should achieve:
- 100% of chaos experiments have a written hypothesis, abort criteria, and blast-radius calculation
- Blast radius for any single experiment never exceeds 10% of error budget
- Mean time between chaos experiments <14 days (continuous, not one-off)
- Each experiment produces ≥1 follow-up action that gets shipped
- No chaos experiment escalates to a customer-impacting incident in trailing 90 days
04 同仓库更多 Skills
课程大纲阅读清单生成
syllabus
使用 Consensus 学术搜索从任意课程大纲生成精选的补充阅读清单。在任何搜索运行之前,进行'拷问式'信息收集(syllabus 输入格式 + 课程受众 + 年份范围)以及分组强制选项检查点——以确保阅读清单匹配课程的层次和时效性需求。解析大纲以提取主题和学习成果,针对每个主题在 Consensus 中搜索近期同行评审论文,并生成专业排版的 .docx 文档,包含可点击的 Consensus 链接、按受众层次校准的通俗语言摘要,以及与课程学习目标关联的布鲁姆(Bloom)高阶层次讨论问题。当用户上传课程大纲、课程概要或课程文档并希望获得补充阅读材料时使用(例如'create a reading list from this syllabus'、'find recent papers for my course')——即使是附带大纲的随意提及也应触发此技能。
话题动态多源调研
pulse
多源近期研究技能,可在可配置的近期时间窗口(默认 30 天)内,跨 Reddit、Hacker News、开放网络以及可选的 X/Twitter 把握任意话题的动态。强制信息收集(intake)会在搜索前明确话题的具体性、角度(趋势/情绪/问题/机会/对比)、时间窗口和平台范围。返回一份综合简报,包含引用来源、互动指标和跨平台模式分析。当用户请求对某话题进行多源近期情报调研时使用(例如'pulse on [topic]'、'what's happening with [topic]'、'what are people saying about [topic]'、'current conversation about [topic]'、'take the pulse of [topic]'、'trending: [topic]'、'find me info on [topic]'),也适用于竞品研究、趋势发现、工具对比和受众情绪分析。
专利现有技术检索分析
patent
专利现有技术检索与专利景观情报技能——并非通用专利助手。在任何检索运行之前,通过强制问询确定五种子用例之一(新颖性检索 / 自由实施 FTO / 竞争景观 / 收购尽调 / 诉讼现有技术)。检索 Google Patents、Espacenet、USPTO,并可选检索 Lens.org 以获取引文图谱信号。输出为可编辑的 Word 文档(.docx),包含结论、按相关度排序的最接近现有技术(附提取的权利要求文本)、考虑 CPC 分类的景观分析、经家族解析的命中结果、地域覆盖、适用时的 FTO 标记、策略建议以及完整审计日志。当用户要求进行专利检索或分析时使用(例如“针对 [invention] 的现有技术检索”“针对 [product] 的自由实施分析”)。产出的是检索信号而非法律建议——在提交申请或许可决策前始终建议咨询专利律师。商标、版权和商业秘密问题不在范围内。
NotebookLM 笔记本自动化管理
notebooklm
用于控制 Google NotebookLM 的浏览器自动化技能。当用户希望在 NotebookLM 中完成任何操作时使用(例如“打开 NotebookLM”“查看我的 [name] 笔记本”“向我的笔记本询问 X”“将 [source] 添加到 NotebookLM”“从我的笔记本生成视频概览”“使用 NotebookLM Studio”)。可处理读取与查询笔记本、添加来源(URL、文本、文件、YouTube 链接、合成内容)、生成 Studio 输出(音频/视频概览、思维导图、报告,包括简报文档/学习指南/FAQ、抽认卡、测验、幻灯片、信息图——需从实时 Studio 面板发现确切的输出集合;其 UI 迭代很快),以及创建新笔记本。需要浏览器自动化环境——不可用时优雅降级。
学术文献综述指南
litreview
学术文献导向技能,默认通过免费、无需密钥的API(PubMed E-utilities + OpenAlex)检索论文——连接后可将Consensus MCP作为可选的增强通道——使用PICO(默认)或SPIDER / Decomposition / hybrid作为后备来构建战略检索计划,并将发现综合成格式化的Word(.docx)研究指南。在侦察性检索(recon search)前进行Grill-me式信息收集(研究问题的具体程度+框架提示+初步深度);在Phase 2之后设置第二个强制检查点,先确认框架+子领域+深度,再让检索消耗预算。可配置的深度(5/10/20次查询)用于控制覆盖面与速度。输出是一个'起点'(launching pad)——让研究者能自信地深入展开的方向性指南,而非已完成的综述。当用户开始文献导向的研究时使用(例如'litreview on [topic]'、'literature review on [topic]'、'I'm starting a literature review on X'、'I'm writing a paper on X'、'help me research X'、'I'm doing research on X'、'can you help me research X')。不要用于只想快速获得列表的单个一次性论文检索——那属于普通的PubMed/OpenAlex(或Consensus)查询。
NIH科研基金申请
grants
面向临床研究人员的NIH科研基金申请技能。Grill-me式信息收集(研究想法+职业阶段+初步数据+研究环境+提交姿态+已知的目标研究所)会在任何检索开始前锁定资助策略。运行5个维度的Consensus定位分析(含起草的Significance/Innovation措辞),通过RePORTER将研究映射到合适的NIH研究所(institutes)与研究部门(study sections),查找NOSIs及已获资助的重叠项目,并生成可编辑的Word文档(.docx),包含考虑预算与范围的机制推荐、提交时间线以及必须给出的项目官员(program officer)推荐。当用户询问研究资助或提出任何与基金申请相关的请求时使用(例如'[某主题]的基金'、'为我的研究想法找基金'、'哪些基金与我的研究匹配'、'帮我找NIH资助'、'我研究的基金机会')。仅限NIH范围——非NIH资助方(PCORI、DOD CDMRP、VA、基金会)不在范围内,并会在信息收集(intake)时予以提示。