postmortem
Skill0 starsChanged 7 months agoMITView on GitHub
Structured incident and bug analysis — timeline reconstruction, root cause identification, contributing factors, and prevention. Use when user says 'postmortem', 'what went wrong', 'why did this break', 'incident review', 'root cause analysis', 'RCA', 'failure analysis', 'what happened'. Do NOT use for session-level audits (use session-audit). Do NOT use for code quality review (use simplify).
44 other projects use a version of this.
Adopted by
Most recently taken up by
- mehboobali98/rmine-skillstheir own version, first seen Nov 6, 2026
- SethGammon/Citadeltheir own version, first seen Nov 4, 2026
- flonat/flonat-researchtheir own version, first seen Nov 3, 2026
- jp-solumhealth/jpstacktheir own version, first seen Nov 1, 2026
- MakiDevelop/claude-skillstheir own version, first seen Nov 1, 2026
- Dimon94/dveritytheir own version, first seen Oct 28, 2026
Used with
Projects with it also use hypothesis-driven-debugging, status-report and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Sturla22Skillhypothesis-driven-debugging
Debug by ranking concrete hypotheses and running discriminating checks. Use when a bug is hard to localize, many plausible failure points exist, logs are noisy or misleading, a symptom appears intermittently, or trial-and-error edits haven't worked.
Also in 3 projects that use this
AnthropicSkillstatus-report
Generate a status report with KPIs, risks, and action items. Use when writing a weekly or monthly update for leadership, summarizing project health with green/yellow/red status, surfacing risks and decisions that need stakeholder attention, or turning a pile of project tracker activity into a readable narrative.
Also in 3 projects that use this
neurofooSkillpremortem
Pre-mortem analysis that imagines a plan has failed, then works backward to identify causes and preventions. Use before launches, major decisions, or risky initiatives to surface hidden risks.
Also in 3 projects that use this
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 4 projects that use this
OpenAISkillthreat-model
Use when Codex is already in the threat-modeling phase of a security scan, the user explicitly invokes $threat-model, or the user explicitly asks to create, update, or persist a repository threat model. Do not use as the primary trigger for full PR, commit, branch, patch, or repository scans.
Also in 3 projects that use this
iovisorSkillevolve
Evolve uBPF through a gated spec-first workflow that propagates approved changes through requirements, design, validation, implementation, and RFC alignment artifacts.
Also in 3 projects that use this
Other versions44 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 44
- dotnet/fsharp★ 4.3ksame name
- SethGammon/Citadel★ 927same name
- boshu2/agentops★ 453same name
- flonat/flonat-research★ 150same name
- neurofoo/agent-skills★ 111same name
- Dimon94/dverity★ 107same name
- Dimon94/skills★ 107same name
- EthanReedLabs/sulde★ 99same name
- Hongyu-yu/matsci-ai-skills★ 19same name
- Hassaan146/claude-skills★ 18same name
34 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- 5x5Skill
- business-planSkill
- chart-forgeSkill
- code-blast-radiusSkill
- code-edgesSkill
- code-preflightSkill
- code-reviewSkill
- code-securitySkill
- hail-marySkill
- organizeSkill
- plan-capacitySkill
- plan-directionsSkill
- plan-reviewSkill
- research-critiqueSkill
- research-searchSkill
- session-auditSkill
- session-driftSkill
- skill-builderSkill
- skill-evalSkill
- ui-ideasSkill
- update-prSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 40 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Evidence-based: Every claim in the timeline must cite a source: a log line, commit hash, error message, or metric.
- Very specific: line 26
Read $ARGUMENTS. This is the incident description — what the user says went wrong.
- Very specific: line 28
If $ARGUMENTS is empty or vague, ask one clarifying question: "What broke, and when did you notice it?" Do not proceed with guesswork.
- Distinctive: line 42
Before analyzing, gather all available evidence.
- Distinctive: line 44
Check these sources (as applicable to the incident):
- Distinctive: line 56
If evidence is unavailable, note the gap.
- Distinctive: line 78
If exact timestamps are unavailable, use relative times (T+0, T+5min, etc.) or sequence markers (Step 1, Step 2, etc.).
- Very specific: line 80
Every event should have a source citation.
- Distinctive: line 84
Use the 5 Whys method. Start from the observable failure and ask "why" until you reach a systemic root cause.
- Distinctive: line 110
No rollback plan or procedure
- Distinctive: line 128
If impact is unknown, say so explicitly.
- Distinctive: line 154
Do NOT write preventions that amount to "be more careful," "add more documentation," or "review more thoroughly" without naming the …
“Common” is measured: kept by at least 6 in 10 of the 40 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Postmortem
Structured incident and bug analysis. Blameless, evidence-based, actionable. Covers production incidents, failed deployments, data loss, bug investigations, and any "what went wrong" scenario.
Important
- Blameless. Focus on systems, processes, and conditions — not individuals. "The deploy script had no rollback" beats "the engineer forgot to test."
- Evidence-based. Every claim in the timeline must cite a source: a log line, commit hash, error message, or metric. Unsupported assertions are not analysis.
- Actionable. Prevention items must be specific enough to become tickets. "Be more careful" is not a prevention. "Add a pre-deploy check that validates the migration is reversible" is.
- Proportional. Match depth to severity. A small bug gets a 5-minute writeup. A production outage gets a deep dive. Do not over-analyze low-impact incidents.
Instructions
Step 1: Parse Incident Description
Read $ARGUMENTS. This is the incident description — what the user says went wrong.
If $ARGUMENTS is empty or vague, ask one clarifying question: "What broke, and when did you notice it?" Do not proceed with guesswork.
Identify incident type from the description:
outage— service unavailable, significant user impactdegradation— service slow or partially brokendata-loss— data deleted, corrupted, or inaccessibledeploy-failure— deployment rolled back or failed mid-deploybug— incorrect behavior in production or stagingsecurity— unauthorized access, data exposure, credential compromise
Incident type drives the depth of the postmortem. outage and security always get full analysis. bug may get abbreviated treatment if low-severity.
Step 2: Gather Evidence
Before analyzing, gather all available evidence. Do not theorize without data.
Check these sources (as applicable to the incident):
- Logs — error logs, application logs, system logs. Look for first occurrence of the error.
- Git history — recent commits and merges.
git log --oneline -20covers most bugs. Checkgit difffor the change that introduced the issue. - Error messages — exact stack traces, exception types, HTTP status codes.
- Metrics/monitoring — when did error rate spike? When did latency increase? When did a service go down?
- Deployment records — what was deployed, when, by what process?
- Configuration changes — env vars, feature flags, infrastructure changes.
- External dependencies — third-party API status pages, library changelogs.
For each piece of evidence, note the source explicitly (e.g., "app.log line 1842", "commit a3f9d2e", "Sentry event #12345").
If evidence is unavailable, note the gap. Missing evidence is itself a contributing factor — it means monitoring or logging is insufficient.
Step 3: Build the Timeline
Construct a chronological sequence of events from first cause to resolution.
Timeline format:
[TIME or RELATIVE] [EVENT] [SOURCE]Example:
14:32 Deploy triggered for v2.4.1 — CI pipeline
14:34 Migration ran: dropped column `user.legacy_id` — deploy log
14:35 Error rate spiked to 40% — Datadog alert
14:36 On-call paged — PagerDuty
14:41 Root cause identified: API still reading `legacy_id` — Sentry stack trace
14:44 Rollback initiated — deploy log
14:47 Error rate returned to baseline — DatadogIf exact timestamps are unavailable, use relative times (T+0, T+5min, etc.) or sequence markers (Step 1, Step 2, etc.).
Every event should have a source citation. Events without citations are hypotheses, not facts — mark them as [inferred].
Step 4: Root Cause Analysis
Use the 5 Whys method. Start from the observable failure and ask "why" until you reach a systemic root cause.
Distinguish:
- Trigger — the immediate event that caused the failure (e.g., "a deploy was pushed")
- Root cause — the systemic condition that made the failure possible (e.g., "there was no pre-deploy check that the API was backward-compatible with the migration")
The trigger is usually obvious. The root cause requires 3-5 "why" iterations.
Example:
Why did the service fail? → API threw 500 errors
Why did the API throw errors? → It referenced a column that no longer exists
Why did the column not exist? → The migration dropped it
Why was an incompatible migration deployed? → Migration and API were deployed in the wrong order
Why were they deployed in the wrong order? → The deploy process has no dependency ordering — ROOT CAUSEState the root cause in one sentence at the end. It should be a systemic failure, not a human error.
Step 5: Contributing Factors
List conditions that made the incident possible or worse. These are not the root cause but they amplified the impact or lowered the barrier to failure.
Common contributing factors:
- Missing tests (unit, integration, or regression)
- Missing monitoring or alerting (silent failures)
- No rollback plan or procedure
- Unclear ownership (nobody knew they were responsible)
- Technical debt (fragile code that couldn't tolerate the change)
- Process gaps (no review step, no staging environment)
- Documentation rot (runbook was wrong or missing)
Each contributing factor should be a complete sentence explaining the condition, not just a label.
Step 6: Impact Assessment
Quantify what was affected. Be specific.
- Duration — when did the incident start? When was it resolved? Total time impacted.
- Scope — which systems, services, users, or data were affected?
- User impact — errors seen, requests failed, features unavailable. Percentage or absolute numbers if available.
- Data impact — any data lost, corrupted, or exposed? If so, what and how much?
- Downstream effects — did dependent systems fail? Were customers charged incorrectly? Did alerts fire?
If impact is unknown, say so explicitly. Unknown impact is worse than known bad impact — it means observability is broken.
Step 7: Prevention
For each root cause and contributing factor, write a concrete prevention item.
Prevention items must be:
- Specific — name the exact file, system, or step to change
- Actionable — someone could pick this up as a ticket today
- Proportional — a 30-minute outage doesn't need six months of infrastructure work
Format:
[PRIORITY] [ACTION] [RATIONALE]Priorities: P0 (do before next deploy), P1 (do this sprint), P2 (backlog, important), P3 (nice to have)
Example:
P0 Add pre-deploy validation that checks API compatibility with pending migrations Prevents deploy-order failures
P1 Add integration test covering migration + API together Would have caught this before deploy
P2 Add column-existence check to startup health endpoint Surfaces this class of failure in seconds, not minutes
P3 Document deploy order dependency in runbook Reduces future debugging timeDo NOT write preventions that amount to "be more careful," "add more documentation," or "review more thoroughly" without naming the specific artifact to create.
Step 8: Deliver Report
Print the postmortem report inline to the user as structured markdown. NEVER save it to a file inside the project being investigated — the incident repo must stay clean. If the user explicitly asks for a persisted copy, save it under ~/.claude/postmortems/<project>-<YYYYMMDD-HHMMSS>.md, not in the project. Adapt length to severity.
Full report (outage, data-loss, security):
# Postmortem: [Brief Incident Title]
**Date:** YYYY-MM-DD
**Severity:** outage | degradation | data-loss | deploy-failure | bug | security
**Status:** resolved | ongoing | mitigated
## Summary
[One paragraph. What happened, when, and impact. Written for someone unfamiliar with the system.]
## Timeline
| Time | Event | Source |
|------|-------|--------|
| ... | ... | ... |
## Root Cause
[One sentence root cause]
### 5 Whys
1. Why did X? → Because Y
2. Why Y? → Because Z
...
Root cause: [systemic condition]
## Contributing Factors
- [Factor 1]
- [Factor 2]
## Impact
- **Duration:** X minutes / hours
- **Scope:** [what was affected]
- **User impact:** [quantified if possible]
- **Data impact:** [none | quantified]
## Prevention
| Priority | Action | Rationale |
|----------|--------|-----------|
| P0 | ... | ... |
| P1 | ... | ... |Abbreviated report (bug, degradation, low-severity):
# Postmortem: [Brief Incident Title]
**Date:** YYYY-MM-DD **Severity:** bug
## What Happened
[2-3 sentences: trigger, root cause, resolution]
## Timeline
[Key events only, prose format acceptable]
## Root Cause
[One sentence]
## Prevention
- [Specific action]
- [Specific action]Error Handling
- No evidence available — Proceed with what the user described. Mark all timeline entries as
[inferred]. Note that the first prevention item should be "add logging/monitoring so this is diagnosable next time." - Incident still ongoing — Set status to
ongoing. Skip impact duration and root cause if not yet determined. Focus on timeline and immediate mitigation actions. - Ambiguous severity — Default to the more severe classification. Over-preparing a postmortem wastes less time than under-preparing one.
- User provides git repo or log files — Read them. Don't ask the user to summarize — that defeats the purpose.
Examples
Example 1: Deploy failure
Input: /postmortem deployed a migration that dropped a column the API still used — had to roll back, 12 minutes of errors
Output: Full report. Timeline from deploy trigger to rollback. Root cause: no pre-deploy API/migration compatibility check. Contributing factors: missing integration test, no staging environment parity. Impact: 12 minutes, ~40% error rate. Prevention: P0 add compatibility check, P1 add integration test.
Example 2: Bug investigation
Input: /postmortem users are seeing stale prices — cache not invalidating after updates
Output: Abbreviated report. Root cause traced via git log to a cache key change that broke invalidation. Prevention: add a test that updates a price and asserts the cache returns the new value within 5 seconds.
Example 3: Data loss
Input: /postmortem ran a migration without a backup, dropped the wrong table
Output: Full report. Status: resolved (or ongoing if data not recovered). Impact section emphasizes data loss quantification. Prevention leads with P0: add pre-migration backup step to deploy runbook, enforce with a migration script wrapper that refuses to run without a recent backup.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

