agentleFS
stevancrisstevancris/sre-ai-agent/skills/postmortem/SKILL.md

postmortem

Skill0 starsChanged 5 months agoMITView on GitHub

Create blameless postmortems after incidents are resolved. Use when an incident is over, during post-incident review, or when writing a retrospective. Covers timeline reconstruction, contributing factor analysis, action item generation, and distribution. Trigger keywords: postmortem, post-mortem, post incident review, PIR, retrospective, blameless, lessons learned, what went wrong, action items, incident review, follow-up, write up, incident report.

44 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use hypothesis-driven-debugging, status-report and 9 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.
  • Sturla22Skill

    hypothesis-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

  • AnthropicSkill

    status-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

  • seongjaeryuSkill

    organize

    Organize knowledge into Sets

    Also in 3 projects that use this

  • SaluteYBSkill

    skill-eval

    Evaluate, tune, and regression-check AgentSkills. Use when creating a new skill or improving an existing one and you need structured should-trigger, should-not-trigger, boundary-case, and execution-quality examples. Also use when auditing overlapping skills and sharpening trigger descriptions before release.

    Also in 3 projects that use this

  • neurofooSkill

    premortem

    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

  • OpenAISkill

    threat-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

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 40 edited versions we read keep these.

  • 4

    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
  1. Very specific:

    Before loading context files, check if context/CONTEXT.md exists in the current directory.

    line 17
  2. Distinctive:

    Use the answers inline for this session.

    line 29
  3. Very specific:

    Read context/CONTEXT.md for persona.

    line 38
  4. Distinctive:

    junior-sre: add a "What I learned" section at the end with educational notes.

    line 100
  5. Distinctive:

    After the postmortem is written and distributed, always prompt:

    line 109
  6. Very specific:

    If the user already ran knowledge-capture during the incident, confirm the pattern exists in skills/knowledge-base/patterns/ and prompt …

    line 118
  7. Distinctive:

    Never close a postmortem with "we will be more careful next time."

    line 144

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Postmortem Skill

Setup Check

Before loading context files, check if context/CONTEXT.md exists in the current directory.

If context/CONTEXT.md exists — read it and proceed normally.

If context/CONTEXT.md does not exist — this skill was installed standalone (e.g. via npx skills add). Ask the user these questions before proceeding:

  1. Role — junior-sre / senior-sre / sre-manager (shapes output depth and tone)
  2. Cloud provider — aws / gcp / azure / on-prem / hybrid
  3. Observability stack — e.g. Datadog, Prometheus+Grafana, New Relic
  4. Company name and primary services affected (if relevant to this task)

Use the answers inline for this session. For persistent setup across all skills, suggest:

pipx install sre-agent
sre-agent init

Instructions

Step 1: Load Context and Incident Data

Read context/CONTEXT.md for persona. Ask the user for:

  • Incident name / ID
  • Incident timeline (or pull from incident-response skill if available)
  • Severity classification
  • Affected services and estimated user impact
  • Resolution summary

Step 2: Reconstruct the Timeline

Build a complete chronological timeline with these milestone markers:

  • [STARTED] — when did the problem actually begin (may predate detection)
  • [DETECTED] — when did monitoring or a user report alert the team
  • [ACKNOWLEDGED] — when did someone start working on it
  • [IDENTIFIED] — when was the root cause identified
  • [MITIGATED] — when was user impact stopped (may differ from root cause fix)
  • [RESOLVED] — when was the system fully restored

Calculate and highlight:

  • Time to Detect (TTD): DETECTED − STARTED
  • Time to Acknowledge (TTA): ACKNOWLEDGED − DETECTED
  • Time to Mitigate (TTM): MITIGATED − ACKNOWLEDGED
  • MTTR: RESOLVED − STARTED

Step 3: Root Cause Analysis

Apply the five-whys technique. Start from the customer-facing symptom and ask "why" iteratively until reaching a systemic or process-level cause.

Format:

Why 1: Why did users see 503 errors?
  → Because the API pods were crashing.
Why 2: Why were the API pods crashing?
  → Because they ran out of memory.
Why 3: Why did they run out of memory?
  → Because a memory leak was introduced in the v2.3.1 deploy.
Why 4: Why was the memory leak not caught before deploy?
  → Because the staging environment does not run load tests.
Why 5: Why does staging not run load tests?
  → Because we have no automated load testing in CI.
Root Cause: No automated load testing in CI allowed a memory leak to reach production.

Step 4: Contributing Factor Analysis

Categorize contributing factors across four dimensions:

  • Detection gaps — why was it hard to detect or took too long?
  • Response gaps — why did response take longer than it should have?
  • Process gaps — what process or procedure failed or was missing?
  • Tooling gaps — what tooling limitation made this worse?

Step 5: Generate Action Items

For each gap identified, generate a SMART action item:

  • What: specific change to make
  • Why: which gap it closes
  • Owner: team or role responsible (do not name individuals; assign to roles)
  • Due: relative date (e.g., "2 weeks", "next sprint")
  • Priority: P0 (blocks similar incident) / P1 (reduces risk significantly) / P2 (improvement)

Step 6: Produce the Postmortem Document

Fill in the template from references/postmortem-template.md.

Persona adjustments:

  • sre-manager: prepend an executive summary with: total downtime, estimated revenue impact (if known), number of users affected, and top 1–2 action items.
  • junior-sre: add a "What I learned" section at the end with educational notes.

Step 7: Distribution

Recommend the distribution list based on severity:

  • P0: all engineering, customer success, executive team, shared to public status page
  • P1: engineering team, engineering manager, customer success
  • P2/P3: SRE team and service owners

Step 8: Close the Knowledge Loop (MANDATORY)

After the postmortem is written and distributed, always prompt:

"Postmortem complete. Before we close — run knowledge-capture to save this as a searchable pattern. Next time this happens, any SRE on the team can resolve it faster."

This step converts the postmortem (written for humans, looking backward) into a knowledge-base pattern (written for the agent, looking forward). The two documents serve different purposes and both are needed.

If the user already ran knowledge-capture during the incident, confirm the pattern exists in skills/knowledge-base/patterns/ and prompt them to enrich it with any additional detail from the postmortem (dead ends, prevention action items, MTTR).


Examples

Example postmortem action items

PriorityActionOwnerDue
P0Add memory usage alert at 80% thresholdSRE team1 week
P0Add load test to staging CI pipelineBackend team2 weeks
P1Add canary deployment step for all servicesPlatform team1 month
P2Document memory leak debugging runbookSRE team2 weeks

Guidelines

  • Postmortems are blameless: do not name individuals, only systems, processes, and teams.
  • The root cause should always be a systemic issue, never "human error." ("Human error" is always a symptom — the root cause is why the error was possible.)
  • Action items without owners and due dates will not get done; enforce SMART format.
  • The five-whys should reach a process or systemic level by Why 4 or 5.
  • Never close a postmortem with "we will be more careful next time."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.