跳到正文
Skillpedia
任务与项目107k · #771

doubt-driven-development

它能做什么

在执行重要决定之前对其进行检查。它会让一位“审查者”分析你写好的或计划中的内容。这位审查者的任务是找出问题,而不是直接通过。这有助于确保一切正确、安全,尤其是在关键场景中。

适用场景

  • ✓当你为项目做出重要的架构决定时。
  • ✓当你编写复杂的代码,或修改关键部分的代码时。
  • ✓当你提出一个不那么显而易见的判断时,比如“这是安全的”或“这会有很好的性能”。

技能链接

https://github.com/addyosmani/agent-skills/blob/main/skills/doubt-driven-development/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/addyosmani/agent-skills/blob/main/skills/doubt-driven-development/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请审查这个决定:“新的身份验证方式可以抵御常见攻击。”检查其中是否存在漏洞或错误的假设。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会把重要的部分(artifact,即成果物)和它必须遵守的规则(contract,即约定)分开。然后,它会请另一个被设定为持批判态度的 AI,依据这些约定找出成果物中的问题。最后,它会把发现的问题和原先写下的内容进行对比。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Doubt-Driven Development

Overview

A confident answer is not a correct one. Long sessions accumulate context that quietly turns assumptions into "facts" without anyone noticing. Doubt-driven development is the discipline of materializing a fresh-context reviewer — biased to disprove, not approve — before any non-trivial output stands.

This is not /review. /review is a verdict on a finished artifact. This is an in-flight posture: non-trivial decisions get cross-examined while course-correction is still cheap.

When to Use

A decision is non-trivial when at least one of these is true:

  • It introduces or modifies branching logic
  • It crosses a module or service boundary
  • It asserts a property the type system or compiler cannot verify (thread safety, idempotence, ordering, invariants)
  • Its correctness depends on context the future reader cannot see
  • Its blast radius is irreversible (production deploy, data migration, public API change)

Apply the skill when:

  • About to make an architectural decision under uncertainty
  • About to commit non-trivial code
  • About to claim a non-obvious fact ("this is safe", "this scales", "this matches the spec")
  • Working in code you don't fully understand

When NOT to use:

  • Mechanical operations (renaming, formatting, file moves)
  • Following a clear, unambiguous user instruction
  • Reading or summarizing existing code
  • One-line changes with obvious correctness
  • Pure tooling operations (running tests, listing files)
  • The user has explicitly asked for speed over verification

If you doubt every keystroke, you ship nothing. The skill applies only to non-trivial decisions as defined above.

Loading Constraints

This skill is designed for the main-session orchestrator, where Step 3 (DOUBT, detailed below) can spawn a fresh-context reviewer.

  • Do NOT add this skill to a persona's skills: frontmatter. A persona that follows Step 3 would spawn another persona — the orchestration anti-pattern explicitly forbidden by ../../references/orchestration-patterns.md ("personas do not invoke other personas").
  • If you find yourself applying this skill from inside a subagent context (where Claude Code prevents nested subagent spawn): the preferred path is to surface to the user that doubt-driven cannot run nested and let the main session handle it. As a last resort only, a degraded self-questioning fallback exists — rewrite ARTIFACT + CONTRACT as a fresh self-prompt with a hard mental separator from your prior reasoning, and walk Steps 1–5. This is not fresh-context review (you carry your own context with you), so flag the result as degraded and prefer escalation whenever the user is reachable.

The Process

Copy this checklist when applying the skill:

Doubt cycle:
- [ ] Step 1: CLAIM — wrote the claim + why-it-matters
- [ ] Step 2: EXTRACT — isolated artifact + contract, stripped reasoning
- [ ] Step 3: DOUBT — invoked fresh-context reviewer with adversarial prompt
- [ ] Step 4: RECONCILE — classified every finding against the artifact text
- [ ] Step 5: STOP — met stop condition (trivial findings, 3 cycles, or user override)

Step 1: CLAIM — Surface what stands

Name the decision in two or three lines:

CLAIM: "The new caching layer is thread-safe under the
        read-heavy workload described in the spec."
WHY THIS MATTERS: a race here corrupts user data and is
                  hard to detect in QA.

If you can't write the claim that compactly, you have a vibe, not a decision. Surface it before scrutinizing it.

Step 2: EXTRACT — Smallest reviewable unit

A fresh-context reviewer needs the artifact and the contract, not the journey.

  • Code: the diff or the function — not the whole file
  • Decision: the proposal in 3–5 sentences plus the constraints it has to satisfy
  • Assertion: the claim plus the evidence that supposedly supports it (kept distinct from the Step 1 CLAIM block, which is the orchestrator's hypothesis under scrutiny)

Strip your reasoning. If you hand over conclusions, you'll get back validation of your conclusions. The unit must be small enough that a reviewer can hold it in mind in one read — if it's a 500-line PR, decompose first.

Step 3: DOUBT — Invoke the fresh-context reviewer

The reviewer's prompt must be adversarial. Framing decides the answer.

Adversarial review. Find what is wrong with this artifact.
Assume the author is overconfident. Look for:
- Unstated assumptions

…
常见问题

什么时候不应该使用它?

对于简单的任务不必使用,比如重命名文件、格式化代码、移动文件、阅读或总结现有代码,或者速度比验证更重要的时候。

什么是“非平凡”的决定?

指涉及复杂逻辑、影响系统的多个部分、做出电脑无法单独验证的判断(比如安全性)、依赖可能随时间流失的信息,或者会带来不可逆后果的决定。

为什么要用一个只找问题的“审查者”?

因为人们审查已完成的内容时,往往更容易直接通过,而不是去找出漏洞。专门负责找问题的审查者能促使大家质疑所有假设,并在问题变大之前发现潜在错误。

详情

作者的原始描述

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operatio

repo: addyosmani/agent-skills

热度

GitHub 星标
107k
排名
#771
许可证
MIT
更新时间
2026/10/13

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能