Debugging & Incidents

Incident Postmortem Writer

Write a blameless postmortem that captures the real timeline and root cause, with action items that would actually have prevented this -- not vague promises to 'be more careful.'

When to use this

  • After an incident is resolved and the timeline/root cause is understood.
  • A near-miss that didn't cause customer impact but revealed a real gap.
  • Not for writing the postmortem before root cause is actually known -- get there first, via root-cause-analyzer and log-triage-assistant.

The skill file

Copy this verbatim. It's written in the SKILL.md format (YAML frontmatter + markdown instructions) that Claude Code, and increasingly other agent tools, read directly.

SKILL.md
---
name: incident-postmortem-writer
description: Write a blameless incident postmortem -- timeline, root cause, impact, and specific preventive action items -- from confirmed facts rather than speculation. Use after an incident's root cause is understood, not while it's still being investigated.
---

# Incident Postmortem Writer

Blameless means: the timeline and analysis focus on systems and process,
not individuals. "Engineer X forgot to check Y" becomes "the deploy
process had no automated check for Y."

## Structure

1. **Summary**: what happened, impact (duration, what was affected, user-
   facing effect), in 2-3 sentences.
2. **Timeline**: chronological, timestamped, factual -- when the issue
   started, when it was detected, key investigation/mitigation steps, when
   it was resolved. Distinguish "detected at" from "started at" if they
   differ (often the more important gap).
3. **Root cause**: the actual root cause (see root-cause-analyzer), not
   just the proximate trigger. If multiple contributing factors existed,
   list them, but identify the primary one.
4. **Impact**: concrete numbers where available -- error rate, affected
   users/requests, duration, revenue/SLA impact if known.
5. **What went well** / **what went poorly** in the response itself
   (detection speed, escalation, communication) -- separate from the
   root cause of the incident.
6. **Action items**: specific, assigned, and each one should map to
   something in the timeline or root cause -- "add a canary check for X"
   (which would have caught the specific failure), not "improve testing"
   in general. Each item should pass the test: would this specific action
   have prevented or shortened this specific incident?

## Output

The postmortem document, following this team's existing template/format
if one exists.

Installing it elsewhere

The frontmatter/body split above is Claude Code's convention. Here's how to carry the same instructions into other tools:

Claude Code
.claude/skills/incident-postmortem-writer/SKILL.md

Save the file below verbatim (frontmatter included) at that path, project-local or in ~/.claude/skills/ for a user-level skill. Claude Code loads the name/description pair to decide when to pull it in, or you invoke it directly as /incident-postmortem-writer.

Cursor
.cursor/rules/incident-postmortem-writer.mdc

Convert the YAML frontmatter to Cursor's rule format (description, globs, alwaysApply: false) and keep the markdown body as the rule content. Cursor surfaces it by description match, same idea as Claude Code's auto-load.

Codex CLI / Copilot
AGENTS.md

Codex CLI (and increasingly other agentic CLIs) read AGENTS.md at the repo root as always-on instructions. Paste the markdown body under a heading like ## {title}; for GitHub Copilot's coding agent, the equivalent file is .github/copilot-instructions.md.

Windsurf
.windsurfrules

Append the markdown body to .windsurfrules at the repo root. Windsurf treats the whole file as always-on context, so keep only the instructions you want applied on every request.

Where this goes wrong
  • Writing action items too vague to ever be verified as done ("be more careful," "improve monitoring") instead of specific, checkable changes.
  • Naming individuals or implying fault instead of focusing on the system/process gap.
  • Writing the postmortem before root cause is actually confirmed, leading to action items that don't address what really happened.