postmortem
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLessons Learned: Structured Retrospective
经验总结:结构化复盘
Analyse incidents using a structured framework, identify root causes, and encode preventive measures directly into skills, guards, or documentation. The goal is systematic improvement, not blame.
使用结构化框架分析事故,识别根本原因,并将预防措施直接编码到 Skill、Guard 或文档中。目标是系统性改进,而非追责。
When to Use
使用场景
- After incidents, mistakes, rollbacks, or near-misses
- When the user says "what went wrong", "lessons learned", "post-mortem", "retrospective", or "how do we prevent this"
- After a stuck session where significant time was lost
- After a wrong-approach event (plan existed but execution diverged)
- 事故、错误、回滚或未遂事件发生后
- 当用户提到“what went wrong”“lessons learned”“post-mortem”“retrospective”或“how do we prevent this”时
- 卡住的会话造成大量时间损失后
- 采用了错误方法的事件发生后(已有计划,但执行偏离了计划)
Process
流程
Phase 1: Incident Definition
阶段 1:事故定义
Capture the facts first, analysis later.
markdown
undefined先记录事实,之后再分析。
markdown
undefinedIncident Summary
Incident Summary
What happened: [Factual description]
When: [Date/time]
Impact: [What was affected, scope]
Resolution: [How it was fixed/rolled back]
Time to resolution: [How long to fix]
undefinedWhat happened: [Factual description]
When: [Date/time]
Impact: [What was affected, scope]
Resolution: [How it was fixed/rolled back]
Time to resolution: [How long to fix]
undefinedPhase 2: Timeline Reconstruction
阶段 2:时间线还原
Build a chronological sequence of events:
| Time | Action | Actor | Outcome |
|---|---|---|---|
| HH:MM | [What was done] | [Claude/User] | [Result] |
Key questions:
- What was the trigger?
- Where did the sequence diverge from expected?
- What was the point of no return?
按时间顺序还原事件序列:
| 时间 | 操作 | 执行者 | 结果 |
|---|---|---|---|
| HH:MM | [执行了什么] | [Claude/用户] | [结果] |
关键问题:
- 触发因素是什么?
- 事件序列在何处偏离预期?
- 不可逆转点在哪里?
Phase 3: Root Cause Analysis (5 Whys)
阶段 3:根因分析(5 Whys)
1. Why did [incident] happen?
→ Because [immediate cause]
2. Why did [immediate cause] happen?
→ Because [deeper cause]
3. Why did [deeper cause] happen?
→ Because [systemic issue]
4. Why did [systemic issue] exist?
→ Because [process gap]
5. Why did [process gap] exist?
→ Because [root cause]Stop when you reach a cause that can be addressed by a concrete change to the system (skill, rule, hook, doc).
1. Why did [incident] happen?
→ Because [immediate cause]
2. Why did [immediate cause] happen?
→ Because [deeper cause]
3. Why did [deeper cause] happen?
→ Because [systemic issue]
4. Why did [systemic issue] exist?
→ Because [process gap]
5. Why did [process gap] exist?
→ Because [root cause]当找到可以通过对系统(skill、rule、hook、doc)进行具体更改来解决的原因时停止。
Phase 4: Contributing Factors
阶段 4:促成因素
Identify all factors, not just the root cause:
| Category | Factor | Contribution |
|---|---|---|
| Process | Missing checkpoint, unclear workflow | [How it contributed] |
| Communication | Ambiguous instructions, assumed consent | [How it contributed] |
| Technical | Missing guard, no validation | [How it contributed] |
| Context | Session continuation, prior assumptions | [How it contributed] |
| Human | Fatigue, time pressure, overconfidence | [How it contributed] |
识别所有因素,而不只是根本原因:
| 类别 | 因素 | 促成作用 |
|---|---|---|
| 流程 | 缺少检查点、工作流不清晰 | [如何促成该问题] |
| 沟通 | 指令含糊、默认视为已获同意 | [如何促成该问题] |
| 技术 | 缺少 Guard、没有验证 | [如何促成该问题] |
| 上下文 | 延续会话、沿用先前假设 | [如何促成该问题] |
| 人为因素 | 疲劳、时间压力、过度自信 | [如何促成该问题] |
Phase 5: Fix Classification
阶段 5:修复分类
Classify each fix by type:
| Fix Type | When to Use | How to Encode |
|---|---|---|
| Skill | Recurring workflow needs structure | Create SKILL.md via |
| Guard | Action requires mandatory checkpoint | Add approval gate to existing skill |
| Rule | Behavioural constraint needed globally | Create |
| Documentation | Knowledge gap caused the issue | Update CLAUDE.md, MEMORY.md, or docs/ |
| Hook | Manual step was forgotten | Create script in hooks/ |
| Checklist | Multiple steps need verification | Add to existing skill |
按类型对每项修复进行分类:
| 修复类型 | 使用场景 | 编码方式 |
|---|---|---|
| Skill | 重复性工作流需要结构化 | 通过 |
| Guard | 操作需要强制检查点 | 在现有 skill 中添加审批门控 |
| Rule | 全局需要行为约束 | 创建 rules/*.md |
| Documentation | 问题源于知识缺口 | 更新 CLAUDE.md、MEMORY.md 或 docs/ |
| Hook | 手动步骤被遗漏 | 在 hooks/ 中创建脚本 |
| Checklist | 多个步骤需要核验 | 添加到现有 skill |
Phase 6: Fix Implementation
阶段 6:修复实施
Implement fixes during the retrospective, not after. This is the critical difference from a report-only post-mortem.
For each fix:
- Implement it (create/edit the file)
- Record what was done:
| Fix | Type | Location | Status |
|---|---|---|---|
| [Description] | Skill/Guard/Rule/Doc/Hook | [File path] | Created/Updated |
Also record a tag in MEMORY.md for each key correction (per the rule).
[LEARN]learn-tags在复盘期间实施修复,而不是在之后实施。 这是与仅生成报告的 post-mortem 之间的关键区别。
对于每项修复:
- 实施修复(创建/编辑文件)
- 记录已完成的工作:
| 修复 | 类型 | 位置 | 状态 |
|---|---|---|---|
| [描述] | Skill/Guard/Rule/Doc/Hook | [文件路径] | 已创建/已更新 |
此外,还要依据 规则,为每项关键纠正在 MEMORY.md 中记录一个 标签。
learn-tags[LEARN]Phase 7: Verification
阶段 7:验证
Define how to verify the fix works:
markdown
undefined定义验证修复是否有效的方法:
markdown
undefinedVerification
Verification
Test scenario: [How to test the fix]
Success criteria: [What "fixed" looks like]
Review date: [When to check if fix is working — default: 2 weeks]
undefinedTest scenario: [How to test the fix]
Success criteria: [What "fixed" looks like]
Review date: [When to check if fix is working — default: 2 weeks]
undefinedOutput
输出
Write the report to :
log/incidents/YYYY-MM-DD_short-description.mdmarkdown
undefined将报告写入 :
log/incidents/YYYY-MM-DD_short-description.mdmarkdown
undefinedLessons Learned: [Incident Title]
Lessons Learned: [Incident Title]
Date: YYYY-MM-DD
Severity: [Low|Medium|High|Critical]
Status: [Resolved|Monitoring|Open]
Date: YYYY-MM-DD
Severity: [Low|Medium|High|Critical]
Status: [Resolved|Monitoring|Open]
Incident Summary
Incident Summary
[Brief description]
[Brief description]
Timeline
Timeline
| Time | Action | Actor | Outcome |
|---|
| Time | Action | Actor | Outcome |
|---|
Root Cause
Root Cause
[The fundamental issue]
[The fundamental issue]
Contributing Factors
Contributing Factors
- [Factor 1]
- [Factor 2]
- [Factor 1]
- [Factor 2]
Fixes Implemented
Fixes Implemented
| Fix | Type | Location | Status |
|---|
| Fix | Type | Location | Status |
|---|
Prevention
Prevention
[How this prevents recurrence]
[How this prevents recurrence]
Lessons
Lessons
- [Key takeaway 1]
- [Key takeaway 2]
Create `log/incidents/` if it doesn't exist.- [Key takeaway 1]
- [Key takeaway 2]
如果 `log/incidents/` 不存在,则创建该目录。Common Incident Patterns
常见事故模式
| Pattern | Symptom | Root Cause | Typical Fix |
|---|---|---|---|
| Premature action | Action taken before approval | Implied consent ≠ explicit | Add approval gate to skill |
| Sequence error | Steps in wrong order | Missing dependency chain | Encode sequence in skill |
| Missing validation | Bad data passed through | No checkpoint | Add pre-flight check |
| Context carryover | Stale assumptions from prior session | State assumed to persist | Explicit context verification |
| Scope creep | Did more than requested | Task scope too broad | Clarifying questions first |
| Planning loop | Re-planned instead of executing | Perfectionism / uncertainty | Execution stall detector |
| 模式 | 症状 | 根因 | 典型修复 |
|---|---|---|---|
| 过早执行 | 未获批准便执行操作 | 默示同意 ≠ 明确同意 | 为 skill 添加审批门控 |
| 顺序错误 | 步骤顺序不正确 | 缺少依赖链 | 在 skill 中编码执行顺序 |
| 缺少验证 | 错误数据被放行 | 没有检查点 | 添加 pre-flight 检查 |
| 上下文沿用 | 沿用上一会话的过期假设 | 误以为状态会持续保留 | 显式验证上下文 |
| 范围蔓延 | 执行了超出要求的工作 | 任务范围过宽 | 先提出澄清问题 |
| 规划循环 | 反复重新规划而不执行 | 完美主义/不确定性 | 执行停滞检测器 |
Anti-Patterns
反模式
| Anti-Pattern | Problem | Instead |
|---|---|---|
| Blame assignment | Creates defensiveness | Focus on process, not people |
| Single-cause thinking | Oversimplifies | Use 5 Whys, multiple factors |
| Recommend without acting | Lessons forgotten, recurs | Implement fixes during retro |
| Vague fixes ("be more careful") | Not verifiable | Encode specific changes |
| Skip verification | No way to know if fix worked | Define success criteria |
| 反模式 | 问题 | 替代方案 |
|---|---|---|
| 归责 | 引发防御心理 | 关注流程,而非个人 |
| 单一根因思维 | 过度简化 | 使用 5 Whys 和多个因素 |
| 只建议不行动 | 经验教训被遗忘,问题反复出现 | 在复盘期间实施修复 |
| 模糊修复(“要更仔细一点”) | 无法验证 | 编码具体更改 |
| 跳过验证 | 无法判断修复是否有效 | 定义成功标准 |
Cross-References
交叉引用
- tags — record one-liner corrections in MEMORY.md (the quick complement to this skill)
[LEARN] - — extract a full skill from a session (when the fix type is "Skill")
skill-extract - — if a fix is too large for this session, capture as an idea for later
ideas
- 标签 — 在 MEMORY.md 中用一行记录纠正事项(作为本 Skill 的快速补充)
[LEARN] - — 从会话中提取完整的 Skill(当修复类型为“Skill”时)
skill-extract - — 如果某项修复对当前会话而言过大,则将其记录为想法,供后续处理
ideas
Success Criteria
成功标准
The retrospective is complete when:
- Incident clearly defined with timeline
- Root cause identified (not just symptoms)
- Contributing factors documented
- At least one fix implemented (not just recommended)
- Fix encoded in appropriate location (skill, rule, hook, doc)
- tags recorded in MEMORY.md
[LEARN] - Verification criteria defined
- Report written to
log/incidents/
复盘在满足以下条件时即告完成:
- 已明确定义事故并建立时间线
- 已识别根因(而不仅仅识别症状)
- 已记录促成因素
- 至少实施了一项修复(而不只是提出建议)
- 修复已编码到适当位置(skill、rule、hook、doc)
- 已在 MEMORY.md 中记录 标签
[LEARN] - 已定义验证标准
- 报告已写入
log/incidents/