post-mortem
Write the canonical engineering record of a fixed bug — root cause, mechanism, fix, validation, and how it slipped through. Use after a debug session lands a validated fix, before closing the bug.
What this skill does
# Post-mortem ## Activation Triggers - `/post-mortem` - "write the post-mortem" / "postmortem" / "RCA" / "root cause analysis" - "document this fix" / "write up the root cause" / "close out this bug" - After `systematic-debug` lands a validated fix — proactively offer to draft one. ## Purpose The canonical engineering record of a bug fix. Written after debugging lands a real fix, for other engineers and future-you who will have forgotten everything in six months. Code identifiers are welcome — this is the artifact that lets the next person recover the mental model fast. For the leadership-facing version of this content, hand the finished post-mortem to `explain-in`. Post-mortem owns the engineering truth; `explain-in` reframes it for stakeholders. ## When NOT to Use - **Bug not fixed or fix not validated.** A post-mortem of a hypothesis is misleading. Refuse, list what's missing, and stop. - **Customer-visible outage or incident.** Those need a separate incident report covering timeline, blast radius, paging history, and comms. This skill is bug-fix scope. Flag and confirm before proceeding. - **Trivial one-liner fix.** The PR description is the record. Don't manufacture ceremony. ## Required Inputs Gate Before writing a single line, confirm all four. If any are missing, list them and stop — do not draft: - [ ] **Reliable repro** — deterministic or high-rate-flake; the next person can run it. - [ ] **Root cause known** — the mechanism is identified, not a hypothesis. - [ ] **Fix identified** — PR, commit, or branch pointer exists. - [ ] **Fix validated** — the original repro now passes; the failing test or workload now succeeds. `systematic-debug`'s breadcrumb ledger is the raw material for all four. Pull from it. ## Structure Use these sections in this order. **Summary, Root cause, Fix, and Validation are mandatory.** The rest are conditional but usually present. ### 1. Summary _(mandatory)_ One paragraph. What broke in user or workload terms. What fixed it in one sentence. Issue ID (if any), PR number, owner. A reader who stops here should have the right answer. ### 2. Symptom What was actually observed — test output, error message, log line, perf number, customer report. Concrete identifiers; don't paraphrase the failure mode. ### 3. Root cause _(mandatory)_ The actual bug mechanism. Code identifiers are expected: function names, file paths, struct fields, branch conditions, commit SHAs. Walk the cause chain end-to-end. This is the most expensive section and the reason the post-mortem exists. Future-you will live or die by how clearly this is written. ### 4. Why it produced the symptom Link root cause to symptom. Often non-obvious — the bug is in one function but the visible failure surfaces hours later in a different layer. Walk the chain so a reader who only knows the symptom can connect it back to the cause without re-deriving it. ### 5. Fix _(mandatory)_ What changed and why it addresses the root cause rather than hiding the symptom. Link to PR or commit. If a prior fix attempt papered over the symptom, name it and explain what was wrong with it — that history is part of the cause. ### 6. How it was found Short. The debugging path: what made the repro deterministic, which tools cracked it, hypotheses tried and rejected with a one-line reason each, and the single experiment that confirmed the cause. (Pull from the `systematic-debug` breadcrumb ledger.) Write it for the next debugger — make it learnable. ### 7. Why it slipped through What allowed this bug to reach the branch, release, or customer. Pick the real reason: - **CI gap** — no test exercises this path or configuration. - **Latent code** — correct when written, broken by a later change in a different file. - **Workload gap** — no real workload reached this code path until now. - **Incomplete prior fix** — a defensive check hid the symptom; root cause was untouched. - **Review miss** — the change was reviewable; the implication wasn't. If the honest answer is "no good reason — this should have been caught," say so. Blameless: describe the gap, not the person. ### 8. Validation _(mandatory)_ How we know the fix works. Concrete: test names, run links, configs tested, perf numbers before and after. If you only validated one configuration, say so explicitly — "validated on X; not retested on other workloads." Don't imply broader coverage than you have. ### 9. Action items Concrete next steps not already in the fix PR. Each item: what + owner + tracking artifact. If there are no action items, write: *"None — the fix is sufficient and no class-of-bug follow-up is warranted."* Don't manufacture action items to look thorough. ## Tone Engineer-to-engineer. Different from `explain-in`: - **Code identifiers are first-class.** Function names, file paths, commit SHAs, line numbers — keep them. The point is that future engineers can grep their way back to the change. - **Mechanism over narrative.** Walk the actual cause chain. Don't soften "a synchronization issue" — name which function skipped which event under which gate. - **Active voice, short paragraphs.** No padding. - **No hedging.** Drop "we believe" / "appears to" / "may have." State it or don't write it. - **Blameless.** Describe the bug, the gap, and the fix. Never "X should have caught this." - **No advocacy.** A post-mortem records what happened and what's next. Arguments for a broader refactor go in a separate proposal — link to it from action items. ## Output Flow 1. Confirm all four required inputs are satisfied. If any are missing, list them and stop. 2. Confirm destination (default: `docx/postmortems/<bug-name>.md`). Other valid targets: issue tracker comment (JIRA, GitHub Issues, Linear), PR description, internal wiki. Shape is the same — only the wrapping changes. 3. Produce the draft as a single block. 4. For issue tracker back-post (JIRA, GitHub Issues, Linear): show the exact payload, wait for explicit "post it" / "go ahead" / "yes," then post. Print-only output needs no approval. 5. Offer the handoff: *"Want a leadership-friendly version? I can hand this to `explain-in`."* Don't do it automatically. ## Worked Example — Partial (JIRA-12345) > **Summary.** Tada's single-stream fast-path skipped a required cross-stream synchronization, causing kernels to launch before scratch-buffer writes were visible. Triggered reliably by dumbModel on LLM-7B fine-tuning, hanging the workload at every eval step. Fixed by removing the unsafe fast-path and adding a device-side null check. JIRA-12345, PR org/platform#5751, owner Alex (Tada team). > > **Root cause.** The single-stream fast-path in `tadaLaunchPrepare` / `tadaLaunchKernel` / `tadaLaunchFinish` (gated on `scheduler->numStreams == 1 && !plan->persistent`) skipped the cross-stream event between `launchStream` and `handle->shared->deviceStream`. dumbModel hits this gate exactly. The kernel launched before IPC publish / scratch-buffer writes on `deviceStream` populated `scratchBuf`. In the kernel: `scratchBuf == NULL` → stray pointer dereference → ring ready-flag read from garbage memory → thread spins forever waiting for a signal that will never arrive. What the engineering record does that a management summary doesn't: names every code identifier, walks the cause chain to the exact gate, calls out the prior failed fix attempt by PR number, and states validation coverage honestly. ## Rules - **Refuse to draft without all four required inputs.** A post-mortem of a hypothesis is worse than no post-mortem. - **Never invent root cause, owner, validation runs, or action items.** If a section's facts aren't there, ask. Don't fill the gap with plausible prose. - **Never strip code identifiers.** They are the index. Reframing for leadership is `explain-in`'s job. - **Blameless.** Gaps and bugs, never people. - **State validation coverage honestly.** Implying broader coverage than you have is the failure mode that breeds repeat regressions. - **Get si
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.