premortem
Cognitive immune system for AI agents. Predicts and prevents failures BEFORE they happen using adversarial pre-execution reasoning. Zero dependencies, zero cost, universal quality improvement.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/jcools1977/premortemPremortem — Cognitive Immune System for AI Agents
"The best way to avoid failure is to imagine you've already failed, then work backward." — Adapted from Gary Klein's premortem analysis
What This Skill Does
Premortem is a zero-cost reasoning enhancement that makes every agent action better. Before committing to any significant response, code change, or action, the agent runs a rapid internal "premortem" — it imagines the action has already failed, identifies the most likely causes of failure, and patches them before executing.
This is not a tool. This is not an API. This is a thinking pattern — a cognitive reflex that fires automatically, improving the quality of everything the agent does without any external dependencies.
When to Activate
Run a premortem pass before ANY of these actions:
- Writing or modifying code (especially multi-file changes)
- Executing destructive or irreversible commands
- Providing architectural recommendations
- Answering complex or ambiguous questions
- Making plans with multiple steps
- Generating content the user will publish or share
- Taking actions that affect shared systems (git push, deployments, API calls)
Do NOT premortem trivial actions (reading files, listing directories, simple acknowledgments).
The Premortem Protocol
Phase 1: Snapshot the Intent
Before acting, crystallize what success looks like in one sentence:
INTENT: [What am I trying to achieve for the user?]
Phase 2: Fast-Forward to Failure
Imagine the action has been taken and it FAILED. Generate the top 3 most likely failure modes:
FAILURE MODE 1: [What went wrong?]
FAILURE MODE 2: [What went wrong?]
FAILURE MODE 3: [What went wrong?]
Use these failure lenses to probe different dimensions:
| Lens | What to Check |
|---|---|
| Correctness | Is the output factually/logically wrong? Am I hallucinating? |
| Completeness | Am I missing edge cases, error handling, or requirements? |
| Intent Drift | Have I drifted from what the user actually asked for? |
| Side Effects | Will this break something else? Unintended consequences? |
| Assumptions | What am I assuming that might not be true? |
| Overengineering | Am I adding complexity the user didn't ask for? |
| Security | Does this introduce vulnerabilities (injection, exposure, etc.)? |
| Reversibility | Can the user undo this if it's wrong? |
Phase 3: Inoculate
For each identified failure mode, apply a fix BEFORE executing:
PATCH 1: [How I'm preventing failure mode 1]
PATCH 2: [How I'm preventing failure mode 2]
PATCH 3: [How I'm preventing failure mode 3]
Phase 4: Execute with Confidence
Now take the action, incorporating all patches.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-jcools1977-premortem": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
inversion-protocol
Meta-cognitive reasoning skill that makes any AI agent dramatically better at decision-making by thinking backwards before acting forward. Applies Munger's Inversion, Klein's Premortem, and Taleb's Via Negativa to every significant action. Zero dependencies, zero cost, pure reasoning enhancement. Use this skill when the agent is about to execute code, write files, run commands, answer complex questions, debug issues, make architectural decisions, or perform any action where being wrong has consequences.
ResonanceEngine
Conversational Frequency Matching — reads invisible micro-signals in every conversation and tells the bot exactly how to respond for maximum engagement, conversion, and revenue. Zero API cost. Pure algorithmic intelligence.
phantom-limb
Detects phantom dependencies — references to things that no longer exist, ghost state that lives in the gaps between modules, and invisible wires that connect your code to assumptions nobody remembers making. The codebase equivalent of feeling a limb that's already been amputated.
work-receipt
Generates a detailed receipt of everything you accomplished in a coding session — files changed, problems solved, decisions made, debt incurred, and what's left for tomorrow. The difference between "I worked all day" and "here's exactly what I did and why." Perfect for standups, handoffs, and proving to yourself that you actually got something done.
smart-memory
Zero-cost persistent memory that makes your bot smarter over time. Automatically extracts, stores, and retrieves key facts, preferences, and decisions from conversations using local JSON storage — no external APIs, no cost, just a better bot.