Skip to content

Add doubt-driven-development skill#139

Merged
addyosmani merged 3 commits intoaddyosmani:mainfrom
federicobartoli:feat/doubt-driven-development
May 9, 2026
Merged

Add doubt-driven-development skill#139
addyosmani merged 3 commits intoaddyosmani:mainfrom
federicobartoli:feat/doubt-driven-development

Conversation

@federicobartoli
Copy link
Copy Markdown
Contributor

@federicobartoli federicobartoli commented May 7, 2026

What

Adds a doubt-driven-development skill: an in-flight adversarial-review posture distinct from post-hoc gates like /review. Every non-trivial decision passes through CLAIM → EXTRACT → DOUBT → RECONCILE → STOP, bounded at three cycles before escalating to the user.

Why a skill (not a command, not a persona)

/review and the code-reviewer persona produce PR-level verdicts after the artifact has congealed. This skill catches wrong directions while course-correction is still cheap. The naming follows the *-driven-development convention already established in this repo (TDD, SDD) — methodology, not tooling. Orchestration sits in the main session, respecting references/orchestration-patterns.md (personas don't invoke other personas).

The repo currently has no skill covering in-flight verification of non-trivial decisions: code-review-and-quality is post-hoc, and source-driven-development verifies framework facts rather than the author's reasoning about the artifact. This skill fills that gap.

Cross-model escalation

Optional, user-authorized, designed safety-first:

  • Offered in every interactive cycle. The agent surfaces the choice; the user decides whether the artifact warrants the cost.
  • Skipped (and announced) in non-interactive contexts — CI, /loop, scheduled runs. External CLIs are never invoked without explicit authorization.
  • Read-only sandbox by default. codex exec --sandbox read-only and gemini --approval-mode plan, both verified against local installs (Codex 0.128.0, Gemini 0.41.2). The artifact under review may itself contain prompt-injection.
  • Prompt via stdin, not -p "...". Artifacts routinely contain backticks and $(...); shell interpolation is unsafe.

Test evidence

Applied the skill to its own commits as the integration test:

  • Cycle 1 (single-model): the adversarial review surfaced 16 findings. Reconcile classified ~12 as actionable and the rest as noise — the reviewer-as-rubber-stamp failure mode is itself a documented red flag.
  • Cycle 2 (cross-model): Codex 0.128.0 ran the adversarial review in a read-only sandbox with the prompt piped via stdin, and independently surfaced the safety cluster — sandbox flags, shell-escaping, persona-template conflict, and CLI-name leakage in the README — including regressions the same-model reviewer had missed. The Gemini 0.41.2 invocation shape (gemini --approval-mode plan -p "" < prompt.md) was verified locally so the SKILL.md example is a working command, not a guess; Gemini was not used as a second reviewer.
  • All findings — safety cluster and consistency follow-ups — are folded into this PR.

Files changed

  • skills/doubt-driven-development/SKILL.md — new skill
  • README.md — table entry and skill description
  • skills/using-agent-skills/SKILL.md — discovery flowchart, quick reference, and Lifecycle Sequence position 7
  • CLAUDE.md — listed under Build phase

Codifies adversarial fresh-context review as an in-flight development
posture, distinct from /review (post-hoc PR-level verdict). Every
non-trivial decision passes through a 5-step cycle (CLAIM → EXTRACT →
DOUBT → RECONCILE → STOP) before standing.

Cross-model escalation is described as a contract, not as hardcoded
CLI invocations — the skill instructs the agent to ask the user which
external tool to use and how, since CLI syntax (Gemini, Codex, etc.)
changes and varies by environment.

Updates README skill listing (count, Build table, project tree),
CLAUDE.md Skills by Phase, and using-agent-skills flowchart + Quick
Reference for discoverability parity with the existing skills.
@federicobartoli federicobartoli force-pushed the feat/doubt-driven-development branch 3 times, most recently from 64d2b05 to 940f932 Compare May 7, 2026 18:33
Folds in the safety and consistency findings surfaced by running
the skill against itself in two cycles (single-model adversarial
review + cross-model verification via Codex).

Cross-model escalation is now offered in every interactive cycle,
and the CLI invocation path uses a read-only sandbox with prompts
piped through stdin to neutralize shell-escaping and prompt-injection
risks (verified against Codex 0.128.0 and Gemini 0.41.2 locally).

Internal consistency fixes from the adversarial self-review: the
adversarial prompt explicitly overrides persona templates; the
persona roster is referenced rather than duplicated; the Step 2
'Claim' bullet is renamed Assertion to disambiguate from the Step 1
CLAIM block; the manual fallback in Loading Constraints is labeled
as a degraded last-resort path; the forward reference to Step 3 is
anchored; the Verification checklist no longer contains an item not
derivable from the Process; and using-agent-skills's Lifecycle
Sequence now includes the skill at position 7.
@federicobartoli federicobartoli force-pushed the feat/doubt-driven-development branch from 940f932 to 97e12d0 Compare May 7, 2026 18:44
@federicobartoli federicobartoli marked this pull request as ready for review May 7, 2026 18:47
Resolves README.md conflict by taking main's wording ("entry points.
The pack includes 21 skills total") and Meta section, both landed in
PR addyosmani#142 while this PR was open. The doubt-driven-development row in
the Build table and the directory tree entry auto-merged cleanly.
@addyosmani
Copy link
Copy Markdown
Owner

Really enjoyed reading this one.

The "in-flight posture, not post-hoc verdict" part is what makes the whole skill click, and you held the line on it cleanly. Especially the bits explaining how doubt-driven differs from /review, SDD, and TDD's RED step.

Going to merge as-is - if anything wobbles in practice I'll follow up with a polish PR, but you've done the careful version of this and I don't want to nitpick it. Thanks for the patience on the review queue.

@addyosmani addyosmani merged commit 4c585c3 into addyosmani:main May 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants