postmortem

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lessons 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
undefined

Incident 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]
undefined
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]
undefined

Phase 2: Timeline Reconstruction

阶段 2:时间线还原

Build a chronological sequence of events:
TimeActionActorOutcome
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:
CategoryFactorContribution
ProcessMissing checkpoint, unclear workflow[How it contributed]
CommunicationAmbiguous instructions, assumed consent[How it contributed]
TechnicalMissing guard, no validation[How it contributed]
ContextSession continuation, prior assumptions[How it contributed]
HumanFatigue, time pressure, overconfidence[How it contributed]
识别所有因素,而不只是根本原因:
类别因素促成作用
流程缺少检查点、工作流不清晰[如何促成该问题]
沟通指令含糊、默认视为已获同意[如何促成该问题]
技术缺少 Guard、没有验证[如何促成该问题]
上下文延续会话、沿用先前假设[如何促成该问题]
人为因素疲劳、时间压力、过度自信[如何促成该问题]

Phase 5: Fix Classification

阶段 5:修复分类

Classify each fix by type:
Fix TypeWhen to UseHow to Encode
SkillRecurring workflow needs structureCreate SKILL.md via
skill-extract
GuardAction requires mandatory checkpointAdd approval gate to existing skill
RuleBehavioural constraint needed globallyCreate
rules/*.md
DocumentationKnowledge gap caused the issueUpdate CLAUDE.md, MEMORY.md, or docs/
HookManual step was forgottenCreate script in hooks/
ChecklistMultiple steps need verificationAdd to existing skill
按类型对每项修复进行分类:
修复类型使用场景编码方式
Skill重复性工作流需要结构化通过
skill-extract
创建 SKILL.md
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:
  1. Implement it (create/edit the file)
  2. Record what was done:
FixTypeLocationStatus
[Description]Skill/Guard/Rule/Doc/Hook[File path]Created/Updated
Also record a
[LEARN]
tag in MEMORY.md for each key correction (per the
learn-tags
rule).
在复盘期间实施修复,而不是在之后实施。 这是与仅生成报告的 post-mortem 之间的关键区别。
对于每项修复:
  1. 实施修复(创建/编辑文件)
  2. 记录已完成的工作:
修复类型位置状态
[描述]Skill/Guard/Rule/Doc/Hook[文件路径]已创建/已更新
此外,还要依据
learn-tags
规则,为每项关键纠正在 MEMORY.md 中记录一个
[LEARN]
标签。

Phase 7: Verification

阶段 7:验证

Define how to verify the fix works:
markdown
undefined
定义验证修复是否有效的方法:
markdown
undefined

Verification

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]
undefined
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]
undefined

Output

输出

Write the report to
log/incidents/YYYY-MM-DD_short-description.md
:
markdown
undefined
将报告写入
log/incidents/YYYY-MM-DD_short-description.md
:
markdown
undefined

Lessons 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

TimeActionActorOutcome
TimeActionActorOutcome

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

FixTypeLocationStatus
FixTypeLocationStatus

Prevention

Prevention

[How this prevents recurrence]
[How this prevents recurrence]

Lessons

Lessons

  1. [Key takeaway 1]
  2. [Key takeaway 2]

Create `log/incidents/` if it doesn't exist.
  1. [Key takeaway 1]
  2. [Key takeaway 2]

如果 `log/incidents/` 不存在,则创建该目录。

Common Incident Patterns

常见事故模式

PatternSymptomRoot CauseTypical Fix
Premature actionAction taken before approvalImplied consent ≠ explicitAdd approval gate to skill
Sequence errorSteps in wrong orderMissing dependency chainEncode sequence in skill
Missing validationBad data passed throughNo checkpointAdd pre-flight check
Context carryoverStale assumptions from prior sessionState assumed to persistExplicit context verification
Scope creepDid more than requestedTask scope too broadClarifying questions first
Planning loopRe-planned instead of executingPerfectionism / uncertaintyExecution stall detector
模式症状根因典型修复
过早执行未获批准便执行操作默示同意 ≠ 明确同意为 skill 添加审批门控
顺序错误步骤顺序不正确缺少依赖链在 skill 中编码执行顺序
缺少验证错误数据被放行没有检查点添加 pre-flight 检查
上下文沿用沿用上一会话的过期假设误以为状态会持续保留显式验证上下文
范围蔓延执行了超出要求的工作任务范围过宽先提出澄清问题
规划循环反复重新规划而不执行完美主义/不确定性执行停滞检测器

Anti-Patterns

反模式

Anti-PatternProblemInstead
Blame assignmentCreates defensivenessFocus on process, not people
Single-cause thinkingOversimplifiesUse 5 Whys, multiple factors
Recommend without actingLessons forgotten, recursImplement fixes during retro
Vague fixes ("be more careful")Not verifiableEncode specific changes
Skip verificationNo way to know if fix workedDefine success criteria
反模式问题替代方案
归责引发防御心理关注流程,而非个人
单一根因思维过度简化使用 5 Whys 和多个因素
只建议不行动经验教训被遗忘,问题反复出现在复盘期间实施修复
模糊修复(“要更仔细一点”)无法验证编码具体更改
跳过验证无法判断修复是否有效定义成功标准

Cross-References

交叉引用

  • [LEARN]
    tags
    — record one-liner corrections in MEMORY.md (the quick complement to this skill)
  • skill-extract
    — extract a full skill from a session (when the fix type is "Skill")
  • ideas
    — if a fix is too large for this session, capture as an idea for later
  • [LEARN]
    标签
    — 在 MEMORY.md 中用一行记录纠正事项(作为本 Skill 的快速补充)
  • skill-extract
    — 从会话中提取完整的 Skill(当修复类型为“Skill”时)
  • 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)
  • [LEARN]
    tags recorded in MEMORY.md
  • Verification criteria defined
  • Report written to
    log/incidents/
复盘在满足以下条件时即告完成:
  • 已明确定义事故并建立时间线
  • 已识别根因(而不仅仅识别症状)
  • 已记录促成因素
  • 至少实施了一项修复(而不只是提出建议)
  • 修复已编码到适当位置(skill、rule、hook、doc)
  • 已在 MEMORY.md 中记录
    [LEARN]
    标签
  • 已定义验证标准
  • 报告已写入
    log/incidents/