incident-report
Generates structured incident postmortem reports by analyzing git history, recent deployments, code changes, logs, and error patterns. Produces a blameless postmortem with timeline, root cause analysis, impact assessment, remediation actions, and prevention measures. Saves output to project-decisions/ folder. Use when the user says "incident report", "postmortem", "what went wrong", "outage report", "root cause analysis", "RCA", "write a post-mortem", "incident review", "we had an incident", "production issue", or "site went down".
What this skill does
# Incident Report Skill When generating an incident report, follow this structured process. The goal is to produce a blameless postmortem that helps the team learn from what happened and prevents recurrence — not to assign blame. **IMPORTANT**: Always save the output as a markdown file in the `project-decisions/` directory at the project root. Create the directory if it doesn't exist. **PRINCIPLE**: This is a BLAMELESS postmortem. Focus on systems, processes, and conditions — never on individuals. Replace "Person X did wrong" with "The system allowed X to happen without safeguards." ## 0. Output Setup ```bash # Create project-decisions directory if it doesn't exist mkdir -p project-decisions # File will be saved as: # project-decisions/YYYY-MM-DD-incident-[kebab-case-topic].md # Example: project-decisions/2026-02-19-incident-payment-processing-outage.md ``` ## 1. Incident Discovery — Gather the Facts ### Recent Deployments ```bash # Recent deployments / merges to main git log --oneline --merges --since="7 days ago" main 2>/dev/null | head -20 git log --oneline --since="7 days ago" main 2>/dev/null | head -30 # Tags / releases in the last week git tag --sort=-creatordate | head -10 # What was deployed most recently? git log --oneline -1 main git log --format="%H %ai %s" -1 main # Who deployed and when? git log --format="%ai — %an — %s" --since="3 days ago" main | head -20 # Diff between last two deployments LATEST=$(git log --oneline -1 main | cut -d' ' -f1) PREVIOUS=$(git log --oneline -2 main | tail -1 | cut -d' ' -f1) git diff --stat $PREVIOUS $LATEST 2>/dev/null git diff --name-only $PREVIOUS $LATEST 2>/dev/null ``` ### Recent Code Changes ```bash # Files changed in the last 3 days git log --name-only --since="3 days ago" --format="" main 2>/dev/null | sort | uniq -c | sort -rn | head -20 # Most changed files recently (hot spots) git log --name-only --since="7 days ago" --format="" main 2>/dev/null | sort | uniq -c | sort -rn | head -10 # Changes to critical areas (auth, payments, database) git log --oneline --since="7 days ago" -- src/auth/ src/payment/ src/db/ 2>/dev/null | head -10 # Changes to configuration git log --oneline --since="7 days ago" -- "*.config.*" "*.env*" "docker-compose*" "*.yaml" "*.yml" 2>/dev/null | head -10 # Changes to infrastructure git log --oneline --since="7 days ago" -- Dockerfile docker-compose* k8s/ terraform/ .github/workflows/ 2>/dev/null | head -10 # Changes to dependencies git log --oneline --since="7 days ago" -- package.json package-lock.json yarn.lock requirements.txt Gemfile.lock 2>/dev/null | head -10 ``` ### Error Patterns in Code ```bash # Check for error handling in recently changed files for file in $(git diff --name-only $PREVIOUS $LATEST 2>/dev/null); do echo "=== $file ===" grep -n "catch\|except\|rescue\|error\|throw\|panic\|fatal" "$file" 2>/dev/null | head -5 done # Check for recent TODO/FIXME/HACK that might be relevant grep -rn "TODO\|FIXME\|HACK\|XXX\|WORKAROUND\|TEMPORARY" --include="*.ts" --include="*.js" --include="*.py" src/ 2>/dev/null | grep -i "[incident-keyword]" # Check for missing error handling in affected area grep -rn "[incident-area-keyword]" --include="*.ts" --include="*.js" --include="*.py" src/ 2>/dev/null | head -20 # Check for known issues in the area grep -rn "KNOWN.*ISSUE\|BUG\|REGRESSION" --include="*.ts" --include="*.js" --include="*.py" --include="*.md" . 2>/dev/null | head -10 ``` ### Environment & Configuration ```bash # Check environment configuration cat .env.example 2>/dev/null | head -30 # Check for recent config changes git log --oneline --since="7 days ago" -- "*.config.*" "*.env*" config/ 2>/dev/null # Check Docker/infrastructure config cat docker-compose.yml 2>/dev/null | head -50 cat Dockerfile 2>/dev/null | head -30 # Check for health checks grep -rn "health\|readiness\|liveness\|heartbeat" --include="*.ts" --include="*.js" --include="*.py" --include="*.yaml" --include="*.yml" . 2>/dev/null | head -10 # Check monitoring configuration grep -rn "sentry\|datadog\|newrelic\|prometheus\|grafana\|pagerduty\|opsgenie" --include="*.ts" --include="*.js" --include="*.py" --include="*.yaml" --include="*.json" . 2>/dev/null | head -10 ``` ### Database State ```bash # Recent migrations ls -la src/db/migrations/ db/migrations/ migrations/ prisma/migrations/ 2>/dev/null | tail -10 # Recent migration changes git log --oneline --since="7 days ago" -- "**/migrations/**" "prisma/" 2>/dev/null | head -10 # Check for schema changes git diff --name-only $PREVIOUS $LATEST 2>/dev/null | grep -i "migration\|schema\|prisma" ``` ## 2. Incident Classification ### Severity Levels | Level | Name | Definition | Examples | |-------|------|-----------|---------| | **SEV-1** | Critical | Complete service outage affecting all users, data loss, or security breach | Site down, database corruption, credential leak | | **SEV-2** | Major | Significant degradation affecting many users, core functionality broken | Payment processing failing, auth broken for 50%+ users | | **SEV-3** | Minor | Partial degradation affecting some users, workaround available | Search not working, slow page loads, one API endpoint failing | | **SEV-4** | Low | Minimal impact, cosmetic issues, edge case bugs in production | UI glitch, typo, non-critical feature broken for small user segment | ### Incident Categories | Category | Description | |----------|------------| | **Availability** | Service down or unreachable | | **Performance** | Service slow or degraded | | **Data** | Data loss, corruption, or inconsistency | | **Security** | Unauthorized access, data breach, vulnerability exploited | | **Functionality** | Feature broken or behaving incorrectly | | **Integration** | Third-party service failure or miscommunication | | **Infrastructure** | Server, network, DNS, or cloud provider issue | | **Deployment** | Bad deploy, failed rollback, configuration error | | **Capacity** | Resource exhaustion (disk, memory, connections, rate limits) | | **Dependency** | Upstream service failure cascading to our system | ## 3. Timeline Construction Build a precise timeline of events: ``` ## Timeline All times in [timezone — e.g., UTC] | Time | Event | Source | |------|-------|--------| | YYYY-MM-DD HH:MM | [Normal state — last known good] | [monitoring/logs] | | YYYY-MM-DD HH:MM | [Triggering event — deployment, config change, traffic spike] | [deploy log/git] | | YYYY-MM-DD HH:MM | [First symptom — error rate increase, latency spike] | [monitoring] | | YYYY-MM-DD HH:MM | [Detection — alert fired, user report, team noticed] | [PagerDuty/Slack] | | YYYY-MM-DD HH:MM | [Response started — on-call engaged, investigation began] | [Slack/team] | | YYYY-MM-DD HH:MM | [Diagnosis — root cause identified or hypothesized] | [team] | | YYYY-MM-DD HH:MM | [Mitigation action taken — rollback, fix, restart, config change] | [deploy log/git] | | YYYY-MM-DD HH:MM | [Partial recovery — some users restored] | [monitoring] | | YYYY-MM-DD HH:MM | [Full recovery — service fully restored] | [monitoring] | | YYYY-MM-DD HH:MM | [Verification — confirmed stable, monitoring clean] | [monitoring] | | YYYY-MM-DD HH:MM | [Incident closed] | [team] | ``` ### Key Metrics ``` | Metric | Value | |--------|-------| | **Time to detect (TTD)** | X minutes (from trigger to detection) | | **Time to respond (TTR)** | X minutes (from detection to first responder) | | **Time to mitigate (TTM)** | X minutes (from response to mitigation) | | **Time to resolve (TTR)** | X minutes (from trigger to full recovery) | | **Total duration** | X hours X minutes | | **User-facing impact duration** | X hours X minutes | ``` ## 4. Root Cause Analysis ### The 5 Whys Drill down from the symptom to the root cause: ``` 1. WHY did [the incident happen]? → Because [immediate cause] 2. WHY did [immediate cause] happen? → Because [deeper cause] 3. WHY did [deeper cause] happen? → Because [even deeper cause] 4. WHY did [even deeper cause]
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.