Skip to content
Back to skills

Incident Commander

ASecurity

Runs production incident response and writes the review: classifies severity from impact data, rebuilds timelines with gap checks, and drafts postmortems and PIRs with findings that name each missing owner, deadline or cause. Use when an incident is declared or just closed, when you need a severity call, a timeline from multi-source events, a postmortem, comms templates or an RCA.

  • 1,271 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 27, 2026
data-aipythongobashdebuggingsecuritydocumentation

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add borghei/Claude-Skills --skill incident-commander --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Incident Commander?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Incident Commander
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/borghei-incident-commander/badge)](https://www.skillsdirectory.com/skills/borghei-incident-commander)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: incident-commander
description: >
  Runs production incident response and writes the review: classifies severity from impact data,
  rebuilds timelines with gap checks, and drafts postmortems and PIRs with findings that name each
  missing owner, deadline or cause. Use when an incident is declared or just closed, when you need a
  severity call, a timeline from multi-source events, a postmortem, comms templates or an RCA.
license: MIT + Commons Clause
metadata:
  version: 1.2.0
  author: borghei
  category: engineering
  domain: incident-response
  tier: POWERFUL
  updated: 2026-11-08
  tags: [incident-response, severity-classification, rca, postmortem]
  python-tools: severity_classifier.py, timeline_reconstructor.py, postmortem_generator.py, incident_classifier.py, incident_timeline_builder.py, pir_generator.py
  tech-stack: python, json, markdown
---
# Incident Commander

Run a production incident from declaration to post-incident review: set severity, coordinate response and comms, rebuild the timeline, and write a review whose action items prevent a repeat. The agent's judgment drives the live incident; the scripts score, structure and draft.

## When to Use

- An incident is active: decide severity, establish command, mitigate, communicate.
- An incident is over: reconstruct the timeline, find root causes, assign action items.
- Designing escalation paths, comms templates, response playbooks or SLA/error-budget policy.

## Clarify First

Settle the inputs that change the work. When one is missing and would not change the result, use a sensible default and say which.

- **Active or post-incident?** Active: ask only for impact (who and how many are affected, revenue, data or security exposure) and what is already being done, then give severity and the first comms. Do not start an RCA during an active incident.
- **Post-incident:** the event sources (alerts, chat, deploys) and the format the organisation uses for reviews.
- **RCA method** (post-incident only): 5 Whys for a single causal chain, Fishbone for many contributing factors, Bow Tie for safety/security-style incidents.

If the user wants a result straight away, produce it and state your assumptions at the top.

## Workflow

### Active incident

1. Set severity from impact, using the matrix below. The scorer helps but does not decide; when in doubt, pick the higher severity and downgrade later.
2. Name the incident commander, open the channel, post the first internal update and (SEV1/SEV2) the status page within the response window.
3. Mitigate before diagnosing: roll back the last change, fail over, shed load. Record every action with a timestamp.
4. Update on the cadence for the severity until resolved; then declare resolved and schedule the review.

| Severity | Typical impact | First response | Update cadence |
|----------|----------------|----------------|----------------|
| SEV1 | Core service down, > 75% of users, data loss, or a security breach with customer data | Immediate; IC within 5 min; execs within 15 min | Every 15 min |
| SEV2 | Major degradation, 25-75% of users, no workaround, high revenue impact | Within 15 min | Every 30 min |
| SEV3 | Partial degradation, < 25% of users, workaround exists | Within 1 h | Every 2 h |
| SEV4 | Cosmetic or internal, no customer impact | Next business day | As needed |

Full criteria, escalation paths and examples: [references/incident_severity_matrix.md](references/incident_severity_matrix.md).

### Post-incident review

1. Rebuild the timeline from every source and check the gaps (no events for long stretches usually mean missing data, not inactivity).
2. Compute MTTD / time to mitigate / MTTR and compare with your targets.
3. Find root causes and contributing factors with the chosen RCA method; blameless, about systems and decisions.
4. Write action items that would have prevented or shortened this incident, each with an owner, priority and deadline.
5. Validate the review before sharing: every action item has an owner, every timeline gap is explained, and the root cause is a mechanism, not "human error".

## Quick Start

Run from the skill folder. Every command reads your JSON; nothing is built in.

```bash
python3 scripts/severity_classifier.py assets/sample_incident_data.json --fail-on SEV2
```

Real output (trimmed):

```
SEVERITY: SEV2 (Major)
Composite Score: 0.707
  Revenue Impact             raw=1.000  weight=0.25  weighted=0.250
  User Impact Scope          raw=0.805  weight=0.25  weighted=0.201
...
Read: impact fields given: affected_regions, affected_users_percentage, customer_facing, ... Not provided (defaults assumed): none.
VERDICT: SEV2
```

(exit code 1 because SEV2 is at or above `--fail-on SEV2`.) The other commands:

```bash
python3 scripts/incident_classifier.py --input assets/sound_incident_classification.json --format text   # keyword triage, advisory
python3 scripts/timeline_reconstructor.py --input assets/sound_timeline_events.json --format text --gap-analysis
python3 scripts/incident_timeline_builder.py assets/sound_incident_events.json
python3 scripts/postmortem_generator.py assets/sound_postmortem_data.json --format markdown
python3 scripts/pir_generator.py --incident assets/sound_pir_data.json --rca-method fishbone --action-items
```

## Tools Overview

Use one tool per job. Two input schemas are in play; pick the tool that matches the data you have.

| Job | Primary tool | Input | Alternative |
|-----|--------------|-------|-------------|
| Severity | `severity_classifier.py <file>`: weighted revenue, user scope, data/security, criticality, blast radius; escalation path | Shared incident schema (`assets/sample_incident_data.json`). Needs `incident` plus at least one `impact` field; it will not score a title alone | `incident_classifier.py --input <file>`: keyword triage from `{description, service, affected_users, business_impact}`. Exits 2 when the text matches no severity keyword and gives no percentage or impact level |
| Timeline | `timeline_reconstructor.py --input <events.json>`: merges multi-source events, phases, gaps; reports how many events it read and skipped | List of `{timestamp, source, type, message, severity, actor}` (`assets/sound_timeline_events.json`) | `incident_timeline_builder.py <file>`: MTTD/MTTR and comms from the shared schema (MTTD needs a `trigger` event before the first detection, else N/A) |
| Review | `postmortem_generator.py <file>`: summary, timing metrics vs internal heuristic targets (a missed target is a finding, exit 1), a 5-Whys worksheet of generic prompts you answer yourself, coverage gaps, per-item findings | Shared schema with `incident.title` and `resolution.root_cause` or `contributing_factors` | `pir_generator.py --incident <file> --rca-method {five_whys,fishbone,timeline,bow_tie}`: PIR from the flat schema in `assets/sound_pir_data.json` |

`pir_generator.py` organises the cause data you supply: `root_cause` (or `technical_details.root_cause`), `contributing_factors`, `five_whys`, `action_items` (or `preliminary_action_items`) with `owner`, `priority`, `deadline`. It does not guess causes from keywords. `--action-items` drafts an item (labelled suggested, no owner) for each stated cause that no supplied item mentions. `--rca-method timeline` needs `--timeline <timeline_reconstructor JSON output>`.

Timing targets in `postmortem_generator.py` (for example 30 min to detect a SEV2) and the 15/30-minute gap thresholds are internal heuristics, not industry surveys. Replace them with your own SLOs.

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Clean: no findings |
| 1 | Findings the user must act on: gaps, missing owners/deadlines/phases, or (`severity_classifier.py`, `incident_classifier.py`) a severity at or above `--fail-on SEV1\|SEV2\|SEV3` |
| 2 | Unusable input: missing file, bad JSON, wrong shape, no events, no impact data, no cause data. One-line message on stderr, never a traceback |

Without `--fail-on` the two severity tools exit 0 for any classified severity. All tools accept `--format text|json` (`markdown` where listed in `--help`); `--json` is an alias. Text and markdown output end with a verdict line (`PASS`, `FIX n issues`, or the severity).

## Anti-Patterns

**Mistake:** Letting the keyword classifier set severity during a live incident.
**Why it happens:** A number with a percentage looks authoritative.
**Instead:** Decide from impact with the matrix; use the scorers to check yourself and to document why.

**Mistake:** Root-causing while the service is still down.
**Why it happens:** Engineers want to understand before they act.
**Instead:** Mitigate first (rollback, failover, feature flag off); investigate once users are no longer affected.

**Mistake:** Action items without owners or dates, or "be more careful".
**Why it happens:** The review meeting runs out of time.
**Instead:** Each item names an owner, a deadline and the mechanism it changes (a test, an alert, a guardrail). The review is not done until that is true.

## Files

- `scripts/`: the six tools above (three primary, three alternatives).
- `assets/contract.json`: the 25 runs the contract checker executes (`python3 scripts/skill_contract_check.py --skill engineering/incident-commander` from the repo root).
- `assets/sound_*` (exit 0), `assets/sample_*` and `assets/flawed_*` (exit 1), `assets/malformed_*` (exit 2): one set per tool. `simple_incident.json` and `simple_timeline_events.json` are minimal extra inputs. `incident_report_template.md`, `runbook_template.md` are blank templates.
- `expected_outputs/`: reference outputs for the samples (timestamps differ per run).

## Reference Documentation

Load the reference that matches the task — keep this file lean and pull detail on demand:

- **[references/response-playbooks.md](references/response-playbooks.md)** — quick-start commands, the detection-to-resolution and post-incident-review workflows, escalation management, anti-patterns, and tool troubleshooting. Read when running an incident end-to-end or using the scripts.
- **[references/incident-response-framework.md](references/incident-response-framework.md)** — PagerDuty/Google SRE/Atlassian framework comparison, role definitions (IC, Comms, Ops, Scribe, SME, Liaison), communication protocols, escalation matrix, and the 7-phase incident lifecycle. Read when designing the response process or assigning roles.
- **[references/incident_severity_matrix.md](references/incident_severity_matrix.md)** — full SEV-1 to SEV-4 impact criteria, response requirements, escalation paths, classification guidelines, decision tree, and examples. Read when classifying or calibrating severity.
- **[references/communication_templates.md](references/communication_templates.md)** — ready-to-use internal, executive, customer, status-page, escalation, and resolution templates by severity. Read when drafting any incident communication.
- **[references/rca_frameworks_guide.md](references/rca_frameworks_guide.md)** — step-by-step 5 Whys, Fishbone, Timeline, and Bow Tie frameworks with templates, selection guidance, and anti-patterns. Read when performing root cause analysis.
- **[references/sla-management-guide.md](references/sla-management-guide.md)** — SLI/SLO/SLA hierarchy, error-budget policy, burn-rate alerting, breach handling, and incident-to-SLA mapping with worked examples. Read when assessing or communicating SLA impact.

## Scope & Limitations

**Covers:** severity classification, timeline reconstruction, post-incident reviews, RCA frameworks, escalation and communication templates, SLA/error-budget tracking. Tools are offline and deterministic; they read JSON and write text, JSON or Markdown.

**Does not cover:** monitoring and alerting setup (`engineering/observability-designer`), security forensics (`engineering/senior-secops`), deployment and rollback execution (`engineering/release-orchestrator`), or debugging the underlying fault (`engineering/bug-diagnosis`).

Files in this skill

  • README.md7.4 KB
  • SKILL.md9.5 KB
  • assets/incident_report_template.md4.5 KB
  • assets/runbook_template.md9.5 KB
  • assets/sample_incident_classification.json610 B
  • assets/sample_incident_data.json11 KB
  • assets/sample_incident_pir_data.json3.2 KB
  • assets/sample_timeline_events.json7.6 KB
  • assets/simple_incident.json161 B
  • assets/simple_timeline_events.json734 B
  • expected_outputs/incident_classification_text_output.txt1.5 KB
  • expected_outputs/pir_markdown_output.md3.2 KB
  • expected_outputs/simple_incident_classification.txt1.3 KB
  • expected_outputs/timeline_reconstruction_text_output.txt3.2 KB
  • references/communication_templates.md14.6 KB
  • references/incident-response-framework.md25.5 KB
  • references/incident_severity_matrix.md8.7 KB
  • references/rca_frameworks_guide.md15.3 KB
  • references/sla-management-guide.md23 KB
  • scripts/incident_classifier.py34.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data-ai →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.