1
---
2
name: incident-postmortem
3
description: 'Use when an outage, production incident, or significant service degradation has occurred and the team needs a blameless post-mortem / RCA document in the Google SRE format. Triggers on phrases like "write a post-mortem", "incident review", "what went wrong", "outage report", "root cause analysis", "RCA", or "fishbone". Collects incident inputs from the user, uses a fishbone (Ishikawa) diagram to surface candidate causes, drills the strongest branches with 5 Whys, and produces typed action items. Outputs Markdown by default, with HTML, DOCX, or PDF on request.'
4
---
5
6
# Incident Post-Mortem (Google SRE format)
7
8
Guide a team through writing a blameless post-mortem after a production incident, following the structure of the Google SRE post-mortem template. The output builds shared understanding, identifies root causes without blame, and produces concrete action items to prevent recurrence.
9
10
Everything in the document comes from the user. Never invent timestamps, metrics, names, or causes. If something is unknown, write it as an open question in the document.
11
12
## Blameless Principle
13
14
Systems fail, not people. The goal is to understand HOW the incident happened, not WHO caused it. Avoid language like "X forgot to" or "Y should have known". Use "the system did not", "the process lacked", "the alert did not fire".
15
16
## When to Use
17
18
- Production outage or service degradation has been resolved
19
- A significant near-miss occurred (would have been an incident if caught later)
20
- User-facing errors, data loss, or SLA breach happened
21
- Team wants to capture learnings before context fades
22
23
**Not for:** Minor bugs caught in staging, planned maintenance windows, or incidents with no learning value.
24
25
## Input Requirements
26
27
Gather these from the user before writing. Ask for anything missing, section by section, and do not start the analysis until the first three groups are covered.
28
29
### Incident Metadata
30
- Incident title (short, descriptive)
31
- Authors / post-mortem owner, and incident commander or on-call owner
32
- Date and time of start, detection, and resolution (with timezone)
33
- Severity / impact level (P1-P4 or equivalent)
34
35
### Impact
36
- Affected services and systems
37
- User-facing impact (errors, slowness, full outage)
38
- Estimated number or percentage of users affected
39
- Data loss or corruption (yes/no, scope)
40
- SLA/SLO breach (yes/no, by how much), revenue or business impact if known
41
42
### Timeline Events
43
- First symptom occurred
44
- Trigger (the change or event that set the failure off, e.g. a deploy or config push)
45
- Alert fired, or the problem was noticed manually, and by whom
46
- On-call paged / incident declared
47
- Investigation started, root cause identified
48
- Mitigation applied, full resolution confirmed
49
- Customer communication sent (if any)
50
51
### Evidence and Context
52
- Logs, dashboards, alerts, chat threads, or tickets to cite
53
- Recent changes (deploys, config, infra, dependency upgrades)
54
- Prior similar incidents
55
56
### Output Format
57
Ask which format they want. Default to Markdown.
58
59
## Process
60
61
### Step 1 - Gather Inputs
62
Collect the inputs above. If the user pastes raw material (chat export, alert log), extract what you can and list what is still missing.
63
64
### Step 2 - Reconstruct Timeline
65
Build a chronological timeline in UTC. For each event record the time, what happened (system event or human action), who observed or acted, and a link to evidence.
66
67
Flag gaps: "We don't know what happened between 14:32 and 14:47 - worth checking logs." Separate **time to detect** (start to detection) from **time to mitigate** (detection to mitigation).
68
69
### Step 3 - Fishbone: Brainstorm Candidate Causes
70
Before any 5 Whys, widen the search with a fishbone (Ishikawa) diagram. The problem statement is the "head" (the observed failure, e.g. "Checkout API returned 500s for 47 minutes"). Ask the user, for each category, "what in this area could have contributed?":
71
72
| Category | Prompts |
73
|----------|---------|
74
| Code & Change | Recent deploy, feature flag, migration, dependency bump, missing rollback path |
75
| Infrastructure & Platform | Capacity, limits/quotas, autoscaling, networking, node or zone health |
76
| Configuration & Data | Config drift, secrets/certs expiry, data shape or volume, schema |
77
| Monitoring & Detection | Missing metric, alert threshold or routing, dashboard gaps, noisy alerts |
78
| Process & Tooling | Review/testing gaps, deploy checklist, runbooks, on-call handoff, escalation |
79
| Dependencies & External | Upstream/downstream services, third-party vendors, traffic spikes |
80
81
Rules:
82
- Collect causes from the user's evidence; propose prompts, not conclusions. Mark each cause **confirmed** (evidence exists), **suspected**, or **ruled out**.
83
- Leave a category empty if nothing applies. Do not pad it.
84
- Sub-causes may nest one level (a cause of a cause) as a branch on the bone.
85
86
Render the result as an indented tree plus a table. See [references/fishbone-example.md](references/fishbone-example.md) for the exact shape.
87
88
### Step 4 - 5 Whys on the Strongest Branches
89
Select the confirmed branches that most plausibly explain the incident (usually one to three, including at least one from Monitoring & Detection if detection was slow). Run a separate 5 Whys chain down each:
90
91
```
92
Why did users see 500 errors?
93
-> The API pods were crash-looping.
94
Why were they crash-looping?
95
-> Memory limit was exceeded.
96
Why was the limit exceeded?
97
-> A new query was loading full result sets into memory.
98
Why wasn't this caught before deploy?
99
-> Load tests only covered the p50 case, not high-cardinality accounts.
100
Why did load tests only cover p50?
101
-> We had no test fixtures for large accounts.
102
```
103
104
Guidance:
105
- Five is a guide. Stop when the last "why" lands on a system or process gap that can be fixed.
106
- "Human error" is never a stopping point; keep asking why the system allowed it.
107
- Each chain ends in a root cause. Record which fishbone category it came from.
108
- Distinguish **root causes** (deepest fixable gaps), the **trigger** (what set it off), and **contributing factors** (conditions that made it worse). Unlike a single linear chain, this approach can legitimately yield more than one root cause.
109
110
### Step 5 - Impact Quantification
111
Help the user be precise: duration (separate detection from resolution), error rate at peak vs. baseline, percentage of traffic affected, SLO error budget consumed, revenue or business impact.
112
113
### Step 6 - Action Items
114
Every root cause and contributing factor needs at least one action item. Following the Google SRE template, give each a **type**:
115
116
- **Detect** - would have alerted us sooner
117
- **Mitigate** - would have reduced impact or time to recover
118
- **Prevent** - would have stopped it from happening
119
120
| # | Action | Type | Owner | Tracking | Due | Priority |
121
|---|--------|------|-------|----------|-----|----------|
122
| 1 | Add load-test fixtures for accounts > 10k records | Prevent | @person | PROJ-123 | 2026-07-01 | High |
123
124
Include at least one Detect or Mitigate item when detection or recovery was slow, not only Prevent items. Owners are individuals, not teams. Vague actions like "improve monitoring" must be broken into specific deliverables (service, metric, threshold). Ask the user for the tracking ticket; leave it as `TBD` rather than inventing one.
125
126
### Step 7 - Write the Document
127
Fill in the template in [references/postmortem-template.md](references/postmortem-template.md). Sections follow the Google SRE order: Summary, Impact, Root Causes, Trigger, Detection, Resolution, Action Items, Lessons Learned (what went well, what went wrong, where we got lucky), Timeline, Supporting Information. The fishbone and 5 Whys go in Root Cause Analysis.
128
129
Save Markdown to `docs/postmortems/YYYY-MM-DD-<slug>.md` unless the user names a different location.
130
131
### Step 8 - Other Output Formats
132
Always produce the Markdown source first, then convert only if the user asked.
133
134
| Format | How |
135
|--------|-----|
136
| Markdown (default) | The `.md` file from Step 7 |
137
| HTML | Write a single self-contained `.html` (inline CSS, no external assets) with the same sections and tables; render the fishbone tree in a `<pre>` block |
138
| DOCX | Use the repo's `md-to-docx` skill: `node skills/md-to-docx/scripts/md-to-docx.mjs <file.md> <file.docx>` (needs `npm install` in that skill's `scripts/` folder once) |
139
| PDF | Print the HTML to PDF with a browser, or use a locally available tool such as Pandoc. Check what is installed and tell the user if nothing suitable is available rather than installing anything silently |
140
141
Confirm the output path(s) to the user at the end.
142
143
## Common Mistakes
144
145
| Mistake | Fix |
146
|---------|-----|
147
| "Bob forgot to check the config" | "The deploy checklist did not include config validation" |
148
| Root cause is "human error" | Keep asking Why - human error is always a symptom |
149
| Jumping straight to one 5 Whys chain | Fishbone first, then drill the strongest branches |
150
| Listing every fishbone idea as a root cause | Only evidence-backed causes get a 5 Whys chain; label the rest suspected or ruled out |
151
| Only Prevent action items | Add Detect and Mitigate items too |
152
| Action items without owners | Every item needs a named individual, not a team |
153
| Timeline reconstructed from memory | Check logs, alerts, chat, and paging history before writing |
154
| "Improve monitoring" as an action | Specify which service, metric, threshold, and date |
155
| Post-mortem written weeks later | Write within 48-72 hours while context is fresh |
156
| Filling gaps with plausible-sounding details | Mark unknowns as open questions |
157
158
## Bundled Files
159
160
| File | Purpose |
161
|------|---------|
162
| [references/postmortem-template.md](references/postmortem-template.md) | Google SRE-style post-mortem template to fill in |
163
| [references/fishbone-example.md](references/fishbone-example.md) | Worked fishbone + 5 Whys example and rendering format |
164