Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Postmortem?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/alexander-tyagunov-postmortem)
---
name: postmortem
description: Blameless post-mortem / RCA; timeline, 5-Whys, action items, committed write-up. Use after an incident or outage.
allowed-tools: Read, AskUserQuestion, Edit(./.workspace/shared/postmortems/**), Bash(gh run list *), Bash(kg query *), Bash(git commit -m *)
disable-model-invocation: true
argument-hint: "[incident name or description]"
---
# /postmortem — Post-Mortem Analysis
> **Bundled command:** if `kg` is not found, run it as `${CLAUDE_PLUGIN_ROOT}/tools/kg` and give subagents that full path. If that is missing too (Claude chat ships no plugin tools), skip the `kg` steps and search the code directly.
Run a structured post-mortem for an incident or significant failure.
## Blameless Principle
This process is blameless. The goal is to understand what happened and prevent recurrence — not to assign fault.
## Autonomy
Gates: the commit of the post-mortem. Everything else runs without asking.
## Process
### Phase 1: Gather Facts
A post-mortem needs three facts: what the incident was, its impact (users affected, duration, data loss, revenue) and when it started and ended.
1. Take them from the request and the conversation first.
2. Fill gaps from the evidence. Fix and revert commits and failed CI runs bound the time window:
```bash
git log --oneline --since="<start>" --until="<end>"
gh run list --limit 20
```
With a knowledge-graph index, `kg query "<component>"` finds the code involved.
3. State in one line what you took as the incident, the impact and the window, and go on. Mark a fact you inferred as `(inferred)` in the draft.
4. Ask only when the incident or its time window is still unknown after steps 1 and 2. Ask once, in one message, for exactly the missing facts, and end your turn. An unknown impact does not block: write `Impact: unknown` and list it as an unmet rubric item.
### Phase 2: Timeline Reconstruction
Build a chronological timeline:
```
HH:MM — <event> (source: git log / monitoring / manual)
HH:MM — <event>
...
```
### Phase 3: Root Cause Analysis (5 Whys)
```
Problem: <symptom>
Why 1: <immediate cause>
Why 2: <cause of cause>
Why 3: <deeper cause>
Why 4: <systemic cause>
Why 5: <root cause>
```
The root cause is where action items should be aimed.
### Phase 4: Action Items
For each root cause identified:
```
ACTION: <what to do>
OWNER: <role, not person>
DEADLINE: <date>
PREVENTS: <which Why this addresses>
```
Categories: Detection (better monitoring), Prevention (code/process), Response (runbook), Recovery (backup/rollback).
### Phase 5: Write Post-Mortem
Save to `.workspace/shared/postmortems/YYYY-MM-DD-<incident-name>.md`:
```markdown
# Post-Mortem: <incident name>
**Date:** <date>
**Severity:** P1/P2/P3
**Duration:** <N minutes/hours>
**Impact:** <users/systems affected>
## Timeline
<reconstructed timeline>
## Root Cause
<5 Whys analysis>
## Action Items
| Action | Owner | Deadline | Status |
|--------|-------|----------|--------|
| <item> | <role> | <date> | Open |
## What Went Well
- <things that helped limit the incident>
## What Could Be Improved
- <systemic improvements>
```
### Phase 5b: Incident to eval skeleton
Turn the incident into a regression eval, so the same failure cannot pass a later run unnoticed.
1. Write `.workspace/shared/postmortems/YYYY-MM-DD-<incident-name>.eval.md` (inside this skill's write grant). It holds two fenced blocks in the eval format of `evals/*/`:
- `prompt.md`: frontmatter `name`, `description` (name the post-mortem path), `tags: [incident]`, `runs: 3`, `max_turns`, `allowed_tools` and `expected_outcome` (the correct behavior). The body is the triggering input or request, in the user's own words, with secrets and personal data removed.
- `case.yaml`, written as JSON: `{"schema_version": "1.1", "name": "<incident-name>", "graders": [{"name": "TODO-<check>", "type": "llm", "criteria": "TODO: PASS if <correct behavior>. FAIL if <the failure from the timeline>."}]}`. Add a `regex` or `tool_used` grader when the failure is mechanical. A human replaces each TODO before the case runs.
2. When the project has an `evals/` folder, say in the closing message that the skeleton can be copied to `evals/<incident-name>/prompt.md` and `evals/<incident-name>/case.yaml`. Copy it only on request: that write is outside the grant, so it prompts.
3. When the incident has no testable trigger (a vendor outage, a hardware fault), skip the skeleton and say why in the post-mortem.
Before the Phase 6 gate, grade the draft against [references/rubric.md](references/rubric.md); list unmet items.
### Phase 6: Commit
Show the drafted post-mortem with the unmet rubric items, then gate the commit with one `AskUserQuestion` call ("Post-mortem ready. Commit it?"): options **Commit it** (stage and commit the post-mortem and its eval skeleton) or **Keep it uncommitted** (the files stay in the working tree). The user changes the draft by saying what to change; then show it again.
**End your turn at the tool call.** Treat a free-form "yes / looks good / approved" as **Commit it**. Run `git add` and `git commit` only on approval:
```bash
git add .workspace/shared/postmortems/YYYY-MM-DD-<incident-name>.md
git add .workspace/shared/postmortems/YYYY-MM-DD-<incident-name>.eval.md
git commit -m "docs: add post-mortem for <incident>"
```
Run the `.eval.md` line only when the skeleton exists: `git add` of a missing path fails and stages nothing. Stage only this post-mortem, so a draft the user chose not to commit stays out. Claude Code asks before the `git add` (only the commit is pre-approved); if the user declines it, stop without committing.
Publish the post-mortem as a Claude Code **Artifact** (a live page on claude.ai) only when the user asks. A **public** link (anyone with the URL can view it) is an outward sharing action: **confirm it, keep it account-private by default, and never expose an internal incident's proprietary detail, secrets, or affected-system specifics to a public link.**
## Obstacles
This is a terminal, user-facing skill — it reports to the human directly, not upward to an orchestrator — so it emits no upward Obstacles block: surface any blocker in prose to the user and stop.
See [lore/obstacles.md](../../lore/obstacles.md).
## Completion Signal
"Postmortem complete. Post-mortem written to `.workspace/shared/postmortems/<filename>.md` (eval skeleton: `<filename>.eval.md`, or none with the reason). N action items identified. <Committed as <sha> | Not committed>."
You may add one line: "Next: `/remember remember <incident, date, post-mortem path>` keeps this incident in the global reference store." Do not ask it as a question.