Inversion Protocol
"All I want to know is where I'm going to die, so I'll never go there."
— Charlie Munger
What This Skill Does
The Inversion Protocol is a meta-cognitive reasoning layer that improves the
quality of every decision an AI agent makes. It works by inserting a rapid
backwards-thinking checkpoint before significant actions.
Most skills give bots new capabilities. This skill makes all existing
capabilities work better by catching errors, hallucinations, wrong assumptions,
and overengineered solutions before they happen.
This skill has zero dependencies and zero runtime cost. It is pure reasoning
enhancement — no APIs, no binaries, no environment variables, no external
services.
When to Activate
Apply the Inversion Protocol before any action where being wrong matters:
- - Writing or modifying code
- Running destructive or irreversible commands
- Debugging a problem (especially when stuck)
- Making architectural or design decisions
- Answering questions where accuracy is critical
- Performing multi-step workflows
- Any situation where the user has corrected you before
Do NOT apply to trivial actions like reading files, listing directories, or
responding to greetings. The protocol is for moments of consequence.
The Three Lenses
When the protocol activates, apply these three lenses in order. Each takes
only seconds but catches entirely different classes of errors.
Lens 1: Inversion (The Reverse Engineer)
Ask: "How would I deliberately CREATE this problem?"
Instead of asking "how do I fix this?", ask "how would I break this on
purpose?" The answers reveal root causes that forward-thinking misses entirely.
Mechanics:
- 1. State the problem or goal clearly in one sentence
- Invert it: describe 3 specific ways you would cause this exact failure
- Check: are any of those failure patterns present in the current situation?
- If yes — you've found your root cause. Address it directly.
Example — Debugging slow code:
- - Forward thinking: "Let me profile and optimize hot paths"
- Inversion: "How would I make code slow on purpose?"
- Add unnecessary nested loops over large datasets
- Make redundant database/API calls inside loops
- Block the main thread with synchronous operations
- Skip caching and recompute everything every time
- - Check the codebase for these exact anti-patterns
- Result: finds the N+1 query problem in 30 seconds instead of 30 minutes
Example — Writing an API endpoint:
- - Forward thinking: "Let me implement the happy path"
- Inversion: "How would I make this API as insecure as possible?"
- Accept unsanitized input directly into queries
- Return full error stack traces to the client
- Skip authentication and rate limiting
- Log sensitive data in plaintext
- - Check: am I accidentally doing any of these?
- Result: catches security issues during development, not in production
Lens 2: Premortem (The Time Traveler)
Ask: "It's tomorrow and this completely failed. What went wrong?"
The premortem technique (created by psychologist Gary Klein) exploits a cognitive
bias: people are better at explaining past events than predicting future ones.
By framing the failure as already having happened, you unlock failure modes your
brain would otherwise suppress.
Mechanics:
- 1. Assume your planned action has already been executed and it failed
- Generate the 3 most likely reasons for the failure
- For each reason, determine: can I verify this won't happen BEFORE acting?
- If verifiable — verify it. If not — add a safeguard.
Example — Refactoring a function:
- - Planned action: Extract shared logic into a helper function
- Premortem: "The refactor shipped and broke production. Why?"
- The function had hidden side effects I didn't notice (most likely)
- Other code depended on the exact return shape, not just the value
- The test suite doesn't cover the edge case this function handles
- - Verify: Read all callers. Run the tests. Check for side effects.
- Result: Discovers the function mutates a global config object — would have
caused a subtle production bug
Example — Answering a technical question:
- - Planned action: Provide a solution using library X
- Premortem: "The user tried my solution and it didn't work. Why?"
- Library X's API changed in a recent version I'm not aware of
- The user's environment has constraints I didn't ask about
- My solution works in isolation but conflicts with their existing code
- - Verify: Acknowledge version uncertainty. Ask about constraints. Caveat the
answer.
- - Result: Provides a robust answer instead of a confident-but-wrong one
Lens 3: Via Negativa (The Razor)
Ask: "What is the ONE thing I absolutely must NOT do here?"
Inspired by Nassim Taleb's principle that removing harm is more powerful than
adding good. In complex systems, avoiding the worst mistake matters more than
finding the best solution. This lens prevents catastrophic errors.
Mechanics:
- 1. Identify the single most damaging mistake possible in this situation
- Explicitly confirm you are not about to make that mistake
- If you are — stop and reconsider your entire approach
Example — Database migration:
- - Via Negativa: "The ONE thing I must NOT do?"
- Drop or alter a column that other services depend on without coordination
- - Check: Am I about to do this? → Yes, the
users.email column is referenced
by the auth service
- - Result: Prevents a cascading multi-service outage
Example — Responding to a frustrated user:
- - Via Negativa: "The ONE thing I must NOT do?"
- Give the same answer they've already rejected, reworded
- - Check: Is my new response materially different? → No, it's basically the same
approach with different syntax
- - Result: Forces a genuinely new approach instead of rephrasing failure
Integration Patterns
Pattern A: Full Protocol (Complex Decisions)
For architectural choices, multi-file refactors, debugging sessions where you're
stuck, or high-stakes operations:
CODEBLOCK0
Pattern B: Quick Check (Routine Actions)
For writing functions, running commands, or standard responses — a 5-second
mental check:
CODEBLOCK1
Pattern C: Stuck Mode (When Progress Has Stalled)
When the agent has tried multiple approaches and none work, or the user has
corrected the same type of mistake more than once:
CODEBLOCK2
What This Skill Does NOT Do
- - It does not add tools or API integrations
- It does not require any environment variables, config, or dependencies
- It does not slow down the agent perceptibly (seconds per check)
- It does not override the user's instructions
- It does not apply to trivial actions
- It is not a safety filter or content policy — it improves decision QUALITY
Why This Works (The Cognitive Science)
- 1. Confirmation bias countermeasure: Humans and LLMs naturally seek evidence
that confirms their first instinct. Inversion forces consideration of
disconfirming evidence.
- 2. Prospective hindsight: Klein's research showed that premortems increase
the ability to identify failure reasons by 30% compared to standard
"what could go wrong?" thinking.
- 3. Subtraction over addition: Taleb's Via Negativa recognizes that in
complex systems, avoiding the worst outcome (robustness) is more valuable
than optimizing for the best outcome.
- 4. Second-order thinking: The protocol naturally produces second-order
consequences that first-pass reasoning misses.
Composability
The Inversion Protocol enhances every other skill in the ecosystem:
- - Code skills → catch bugs before they're written
- DevOps skills → prevent misconfigured deployments
- Research skills → avoid confirmation-biased searches
- Communication skills → prevent tone-deaf responses
- Financial skills → catch risky trades before execution
- Automation skills → prevent runaway processes
It is a force multiplier, not a replacement for any existing capability.
逆向协议
我只想知道自己会死在何处,这样我就永远不会去那里。
— 查理·芒格
该技能的作用
逆向协议是一个元认知推理层,能够提升AI智能体做出的每一个决策的质量。其工作原理是在重大行动之前插入一个快速的逆向思维检查点。
大多数技能赋予机器人新的能力。而本技能通过在实际发生错误、幻觉、错误假设和过度设计的解决方案之前捕捉它们,使所有现有能力更好地发挥作用。
本技能零依赖、零运行时成本。 它是纯粹的推理增强——无需API、无需二进制文件、无需环境变量、无需外部服务。
何时激活
在对错至关重要的任何行动之前应用逆向协议:
- - 编写或修改代码
- 运行破坏性或不可逆的命令
- 调试问题(尤其是卡住时)
- 做出架构或设计决策
- 回答准确性至关重要的问题
- 执行多步骤工作流
- 用户曾纠正过你的任何情况
不要应用于读取文件、列出目录或回应问候等琐碎操作。该协议适用于关键时刻。
三个透镜
当协议激活时,按顺序应用这三个透镜。每个只需几秒钟,但能捕捉完全不同类型的错误。
透镜1:逆向(反向工程师)
问:我该如何故意制造这个问题?
不要问我该如何修复这个问题?,而是问我该如何故意破坏它?答案会揭示正向思维完全忽略的根本原因。
机制:
- 1. 用一句话清晰陈述问题或目标
- 将其逆向:描述3种你会导致这个确切失败的具体方式
- 检查:当前情况中是否存在这些失败模式?
- 如果是——你已经找到了根本原因。直接解决它。
示例——调试慢速代码:
- - 正向思维:让我分析性能并优化热点路径
- 逆向:我该如何故意让代码变慢?
- 在大数据集上添加不必要的嵌套循环
- 在循环内进行冗余的数据库/API调用
- 用同步操作阻塞主线程
- 跳过缓存,每次都重新计算所有内容
- - 在代码库中检查这些确切的反模式
- 结果:30秒内找到N+1查询问题,而不是30分钟
示例——编写API端点:
- - 正向思维:让我实现快乐路径
- 逆向:我该如何让这个API尽可能不安全?
- 将未净化的输入直接接受进查询
- 向客户端返回完整的错误堆栈跟踪
- 跳过身份验证和速率限制
- 以明文记录敏感数据
- - 检查:我是否无意中做了这些中的任何一个?
- 结果:在开发期间而不是生产环境中发现安全问题
透镜2:事前验尸(时间旅行者)
问:现在是明天,这件事完全失败了。哪里出了问题?
事前验尸技术(由心理学家加里·克莱因创建)利用了一种认知偏差:人们更擅长解释过去的事件而非预测未来的事件。通过将失败框架化为已经发生,你解锁了大脑通常会抑制的失败模式。
机制:
- 1. 假设你的计划行动已经执行并且失败了
- 生成3个最可能的失败原因
- 对于每个原因,确定:我能否在行动前验证这不会发生?
- 如果可以验证——就去验证。如果不能——添加一个保障措施。
示例——重构一个函数:
- - 计划行动:将共享逻辑提取到辅助函数中
- 事前验尸:重构已发布并破坏了生产环境。为什么?
- 该函数有我没注意到的隐藏副作用(最可能)
- 其他代码依赖于确切的返回结构,而不仅仅是值
- 测试套件没有覆盖这个函数处理的边缘情况
- - 验证:阅读所有调用者。运行测试。检查副作用。
- 结果:发现该函数修改了一个全局配置对象——本会导致一个微妙的线上bug
示例——回答技术问题:
- - 计划行动:使用库X提供解决方案
- 事前验尸:用户尝试了我的解决方案但没成功。为什么?
- 库X的API在我不知道的最近版本中发生了变化
- 用户的环境有我没问到的限制条件
- 我的解决方案在隔离环境中有效,但与他们的现有代码冲突
- - 验证:承认版本不确定性。询问限制条件。对答案添加说明。
- 结果:提供稳健的答案,而不是自信但错误的答案
透镜3:减法之道(剃刀)
问:在这里我绝对绝对不能做的一件事是什么?
受纳西姆·塔勒布原则的启发——消除伤害比增加好处更强大。在复杂系统中,避免最严重的错误比找到最佳解决方案更重要。这个透镜防止灾难性错误。
机制:
- 1. 识别这种情况下可能造成的最具破坏性的单一错误
- 明确确认你即将犯这个错误
- 如果是——停下来,重新考虑你的整个方法
示例——数据库迁移:
- 在没有协调的情况下删除或修改其他服务依赖的列
- - 检查:我即将这样做吗?→ 是的,users.email列被认证服务引用
- 结果:防止级联的多服务宕机
示例——回应沮丧的用户:
- 给出他们已经拒绝过的相同答案,只是换种说法
- - 检查:我的新回应是否有实质不同?→ 没有,基本上是相同的方法,只是语法不同
- 结果:迫使采用真正的新方法,而不是重新表述失败
集成模式
模式A:完整协议(复杂决策)
适用于架构选择、多文件重构、卡住的调试会话或高风险操作:
[逆向协议 — 完整]
目标:{一句话描述我要做的事情}
逆向:我该如何导致这个问题?
- 1. {失败模式1}
- {失败模式2}
- {失败模式3}
当前情况中存在?{是/否 + 详情}
事前验尸:它失败了。为什么?
- 1. {最可能的原因}
- {第二可能的原因}
- {第三可能的原因}
行动前可验证?{验证步骤}
减法之道:我绝对不能做的一件事?
→ {要避免的灾难性错误}
我即将这样做吗?{是/否}
决策:{继续 / 调整方法 / 停下来重新思考}
模式B:快速检查(常规操作)
适用于编写函数、运行命令或标准回应——一个5秒的心理检查:
[逆向 — 快速]
逆向:{一种我会导致失败的方式}
事前验尸:{一个可能出错的原因}
剃刀:{绝对不能做的一件事}
→ {继续 / 调整}
模式C:卡住模式(当进展停滞时)
当智能体尝试了多种方法都不奏效,或者用户多次纠正同一类型的错误时:
[逆向协议 — 卡住模式]
我一直在尝试:{描述}
我目前的方法:{列出已尝试的方法}
完整逆向:我该如何保证这永远不成功?
- 1. {反方法1}
- {反方法2}
- {反方法3}
我是否无意中做了这些中的任何一个?{分析}
重新框架:如果问题不是{我认为的那样}
而是{逆向框架}呢?
该技能不做的事情
- - 不添加工具或API集成
- 不需要任何环境变量、配置或依赖
- 不会明显减慢智能体速度(每次检查只需几秒)
- 不会覆盖用户的指令
- 不适用于琐碎操作
- 不是安全过滤器或内容策略——它提高决策质量
为什么有效(认知科学)
- 1. 确认偏误对策:人类和LLM自然倾向于寻找证实第一直觉的证据。逆向迫使考虑否定性证据。
- 2. 前瞻性后见之明:克莱因的研究表明,与标准的可能出什么问题?思维相比,事前验尸将识别失败原因的能力提高了30%。
- 3. 减法优于加法:塔勒布的减法之道认识到,在复杂系统中,避免最坏结果(稳健性)比优化最佳结果更有价值。
- 4. 二阶思维:该协议自然产生一阶推理所遗漏的二阶后果。
可组合性
逆向协议增强了生态系统中所有其他技能:
- - 代码技能 → 在bug被写出之前捕捉它们
- DevOps技能 → 防止配置错误的部署
- 研究技能 → 避免确认偏误的搜索
- 沟通技能 → 防止不合时宜的回应
- 金融技能 → 在执行前捕捉风险交易
- 自动化技能 → 防止失控进程
它是一个力量倍增器,而不是任何现有能力的替代品。