Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Before starting ANY significant task (feature build, refactor, integration, migration, or architectural change), first imagine the project has failed. Generate 3-5 specific failure scenarios, assess risk levels, identify mitigations, then adjust the implementation plan. Use when the user is about to start a non-trivial coding task.
.claude/skills/adityapeshave-sophos-pre-mortem/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 871% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 28% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 18% | 0% |
Elite engineers instinctively ask "how could this fail?" before writing code. The common failure mode is the opposite - jumping to implementation, discovering problems mid-way, patching reactively. This skill encodes prospective hindsight: imagine failure, then prevent it.
Gary Klein's research on prospective hindsight shows teams who imagine failure identify 30% more risks than teams who just "plan carefully." The mental shift from "how do we succeed?" to "why did we fail?" unlocks different thinking.
Activate before ANY task involving:
Do NOT start writing code. First, run analysis:
bashpython scripts/analyse_risk.py --task "<task description>" --path .
Or manually assess by examining:
Imagine it's 2 weeks later. The task failed. Ask: "Why did it fail?"
Generate 3-5 specific failure scenarios. For each:
| Component | Description | |-----------|-------------| | Scenario | Concrete failure description | | Likelihood | HIGH / MEDIUM / LOW | | Impact | What breaks if this happens | | Detection | How would we know it failed | | Mitigation | How to prevent or reduce risk |
Common failure patterns to consider:
Integration failures:
Data failures:
Logic failures:
Operational failures:
Format output as:
Pre-mortem Analysis: [Task Name]
If this fails in 2 weeks, it's probably because:
1. HIGH: [Scenario]
Impact: [What breaks]
Mitigation: [How to prevent]
2. HIGH: [Scenario]
Impact: [What breaks]
Mitigation: [How to prevent]
3. MED: [Scenario]
Impact: [What breaks]
Mitigation: [How to prevent]
4. MED: [Scenario]
Impact: [What breaks]
Mitigation: [How to prevent]
5. LOW: [Scenario]
Impact: [What breaks]
Mitigation: [How to prevent]
Adjusted Plan:
[Reordered implementation addressing HIGH risks first]
Proceed with this plan?Reorder the implementation plan to:
Do NOT proceed until user confirms. They may:
HIGH - Must mitigate before proceeding:
MEDIUM - Mitigate or explicitly accept risk:
LOW - Note but proceed:
User: "Add Stripe payment integration"
Pre-mortem Analysis: Stripe Payment Integration
If this fails in 2 weeks, it's probably because:
1. HIGH: Webhook signature validation wrong
Impact: Payments process but our system never knows - orders stuck in limbo
Detection: Customer complaints about "paid but not delivered"
Mitigation: Test webhooks with Stripe CLI locally before writing business logic
2. HIGH: No idempotency keys
Impact: Network retry causes duplicate charges
Detection: Customer charged twice, refund requests
Mitigation: Implement idempotency keys from the start, not retrofitted
3. HIGH: Test vs live key confusion
Impact: Real charges in development, or test mode in production
Detection: Angry customers or "payments not working" in prod
Mitigation: Env validation on startup, assert key prefix matches environment
4. MED: Missing error states in UI
Impact: User sees spinner forever, retries, double charge
Detection: Support tickets, rage clicks in analytics
Mitigation: Design loading/error/success states before API integration
5. MED: No payment logging
Impact: Can't debug failed payments, refund disputes unwinnable
Detection: "We have no record of this" situations
Mitigation: Log every payment event with correlation ID
Adjusted Plan:
1. Set up Stripe CLI + webhook endpoint (test signature validation)
2. Implement idempotency key generation
3. Add environment validation (key prefix checks)
4. Build payment service with full logging
5. Create UI states (loading/error/success)
6. Then: actual payment flow implementation
7. End-to-end test with Stripe test cards
Proceed with this plan?User: "Fix the typo in the error message"
This is a trivial change (single string edit). Pre-mortem not needed.
Proceeding directly.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 22,893 | 15,721 | -31% | 1 | 1 | 0% | 3,827 | 4,306 | +13% | 0 | 0 | — |
case-02 | fail→pass | 19,812 | 16,153 | -18% | 1 | 1 | 0% | 3,191 | 4,160 | +30% | 0 | 0 | — |
case-03 | pass→pass | 18,621 | 16,312 | -12% | 1 | 1 | 0% | 3,127 | 4,111 | +31% | 0 | 0 | — |
case-04 | fail→pass | 2,675 | 2,940 | +10% | 1 | 1 | 0% | 223 | 2,166 | +871% | 0 | 0 | — |
case-05 | fail→fail | 6,796 | 15,326 | +126% | 1 | 1 | 0% | 1,174 | 4,029 | +243% | 0 | 0 | — |
case-06 | fail→fail | 2,450 | 3,476 | +42% | 1 | 1 | 0% | 429 | 2,125 | +395% | 0 | 0 | — |
case-07 | fail→pass | 14,936 | 11,582 | -22% | 1 | 1 | 0% | 2,405 | 3,086 | +28% | 0 | 0 | — |
case-08 | fail→fail | 17,306 | 15,577 | -10% | 1 | 1 | 0% | 2,766 | 4,247 | +54% | 0 | 0 | — |
case-09 | fail→pass | 21,361 | 11,624 | -46% | 1 | 1 | 0% | 3,672 | 3,609 | -2% | 0 | 0 | — |
case-10 | pass→pass | 19,470 | 12,494 | -36% | 1 | 1 | 0% | 3,367 | 3,572 | +6% | 0 | 0 | — |
case-11 | fail→pass | 20,586 | 11,298 | -45% | 1 | 1 | 0% | 2,906 | 3,432 | +18% | 0 | 0 | — |
case-12 | pass→pass | 18,640 | 8,666 | -54% | 1 | 1 | 0% | 2,856 | 2,988 | +5% | 0 | 0 | — |
case-13 | fail→fail | 17,538 | 14,436 | -18% | 1 | 1 | 0% | 2,855 | 4,031 | +41% | 0 | 0 | — |
case-14 | pass→pass | 17,197 | 14,993 | -13% | 1 | 1 | 0% | 3,069 | 4,084 | +33% | 0 | 0 | — |
case-15 | fail→fail | 17,489 | 14,828 | -15% | 1 | 1 | 0% | 2,720 | 4,128 | +52% | 0 | 0 | — |
case-16 | pass→fail | 18,773 | 14,570 | -22% | 1 | 1 | 0% | 2,899 | 3,857 | +33% | 0 | 0 | — |
case-17 | fail→fail | 17,507 | 12,170 | -30% | 1 | 1 | 0% | 2,744 | 3,579 | +30% | 0 | 0 | — |
case-18 | fail→pass | 18,994 | 13,440 | -29% | 1 | 1 | 0% | 2,963 | 3,750 | +27% | 0 | 0 | — |
case-19 | fail→pass | 17,205 | 13,681 | -20% | 1 | 1 | 0% | 2,766 | 3,804 | +38% | 0 | 0 | — |
case-20 | pass→pass | 19,283 | 12,989 | -33% | 1 | 1 | 0% | 3,200 | 3,802 | +19% | 0 | 0 | — |
case-21 | fail→fail | 20,078 | 20,491 | +2% | 1 | 1 | 0% | 3,072 | 4,214 | +37% | 0 | 0 | — |
case-22 | fail→fail | 20,504 | 14,020 | -32% | 1 | 1 | 0% | 2,968 | 3,889 | +31% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.