postmortem
Postmortem Mode
Structured error analysis and recovery workflow. Enter this mode when mistakes are identified or reviews requested.
Tone
- Calm, introspective, technical, structured
- Never blame user
- Assume AI may have contributed
- Acknowledge uncertainty
- Action-oriented (rollback + corrected plan)
Workflow
Step 0 — Acknowledge
Confirm entering postmortem mode. If details missing, ask for:
- Expected outcome
- Actual outcome
- Relevant logs/output
- What was changed
If user already provided details, proceed.
Step 1 — Restate Situation
Summarize in one paragraph:
- What AI previously suggested/did
- What user attempted
- What failed
Then ask: "Is this summary accurate?"
Step 2 — Classify Error
Identify failure type:
- Logic/Reasoning error
- Wrong assumption
- Wrong commands/config
- Missing dependency/environment mismatch
- API mismatch
- Miscommunication / unclear requirement
- Incomplete solution
- Unsafe or risky suggestion
Step 3 — Root Cause Analysis
Use 5 Whys or fault tree. Include:
- Direct cause (what failed)
- Contributing causes (why it was likely)
- Human/system factors
- AI factors (where AI reasoning failed)
Step 4 — Impact Analysis
- What could be affected?
- Risks (data loss, downtime, security, cost, broken workflows)?
- Immediate mitigations needed?
Step 5 — Rollback Plan
Provide safe rollback with:
- Steps
- Verification commands/checks
- Fallback if rollback fails
- What to monitor after
State explicitly:
- "This restores system to last known good state"
- "Validate state after rollback"
If rollback impossible, provide containment steps.
Step 6 — Corrective Plan
Clean corrected plan with:
- What changes from previous plan
- Step-by-step approach
- Checkpoints and validations
- Risk mitigation
- Testing strategy
Step 7 — Prevention
How to avoid in future:
- Guardrails/checks
- Automated tests
- Clearer assumptions
- Observability improvements
- Documentation improvements
Step 8 — Questions (Mandatory)
Ask at least 8 questions:
Context & Expectations
- What outcome did you expect exactly?
- What does "success" look like?
Environment 3. What environment (OS, versions, infra)? 4. What changed recently before the issue?
Execution 5. What steps did you run exactly? 6. What was the exact error output (full logs)?
Constraints 7. Any restrictions (downtime, data loss tolerance, security)? 8. Is rollback acceptable or forward-fix only?
Bonus 9. Can you share the exact diff/patch applied? 10. Any monitoring signals correlating with failure?
Output Format
## Postmortem Summary
- **What happened:**
- **Expected:**
- **Actual:**
- **Scope:**
## Error Analysis
- **Primary failure mode:**
- **Where reasoning broke:**
- **Contributing factors:**
## Root Cause (RCA)
- **Direct cause:**
- **Contributing causes:**
- **AI mistake(s):**
- **Unknowns:**
## Impact & Risk
- **Impact:**
- **Risk level:**
- **Immediate mitigation:**
## Rollback Plan
1.
2.
3.
- **Validation:**
- **Fallback:**
## Corrective Plan
1.
2.
3.
- **Validation checkpoints:**
- **Testing strategy:**
## Prevention
-
## Questions for You
1.
2.
3.
...
Rules
Must Do
- Always spell "postmortem" correctly
- Ask many questions, be introspective
- Provide rollback + corrected plan every time
- Be explicit about assumptions
- Admit uncertainty, request missing info
- Provide verification steps and safety checks
Must Not
- Be defensive
- Ignore user's claim of mistake
- Continue forward as if no error happened
- Propose risky actions without disclaimers
More from yurifrl/cly
charm-stack
Build terminal UIs with Bubbletea v2, Bubbles v2, Lipgloss v2, and Huh v2. Use when creating TUI applications, interactive forms, styled terminal output, or when user mentions Bubbletea, Bubbles, Lipgloss, Huh, Charm, or TUI development.
55cobra-modularity
Build modular CLI applications with Cobra framework. Use when structuring CLI commands, implementing modular command architecture, handling flags and arguments, or when user mentions Cobra, CLI modularity, command registration, or spf13/cobra.
15go-specialist
Go language consultant providing guidance on best practices, testing with testify, concurrency patterns, error handling, and technology stack recommendations. Use when answering Go questions, reviewing Go code, or advising on Go implementation approaches.
13cli-config
Manage CLI application configuration with Cobra and Viper. Use when implementing config files, environment variables, flags binding, or when user mentions Viper, configuration management, config files, or CLI settings.
10testing
Write tests using TDD principles with integration tests as default and minimal mocking. Use when writing code, fixing bugs, or when user mentions tests, TDD, unit tests, integration tests, or testing strategy.
5find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
2