Repository navigation
feat: opt-in adversarial review + TDD enforcement gates - #933
Closed
fernandoxavier02 wants to merge 1 commit into
Closed
fernandoxavier02 wants to merge 1 commit into
fernandoxavier02 wants to merge 1 commit into
Conversation
## Problem Long execution runs without intermediate review produce compounding errors. The current flow (implementer → spec review → quality review) catches spec and quality issues, but misses security vulnerabilities, unhandled edge cases, and architecture regressions. TDD compliance is recommended but never verified. ## Solution Add two optional quality gates to `subagent-driven-development` and `executing-plans`, activated by user choice before execution begins: ### 1. TDD Enforcement Gate - Dispatches a TDD verifier after implementer reports DONE - Verifier inspects git history to confirm Red-Green-Refactor cycle - Three outcomes: VERIFIED, PARTIAL (proceed with note), NOT FOLLOWED (blocker) ### 2. Adversarial Review Gate - Spawns specialized adversarial agents IN PARALLEL after quality review passes - Agent count scales with task complexity (LOW=1, MEDIUM=2, HIGH=3): - Security reviewer: injections, auth bypass, data leaks - Edge-case reviewer: boundary values, error paths, state corruption - Architecture reviewer: SOLID, DRY, coupling (HIGH complexity only) - Zero context from implementation session (fresh eyes catch more) - Auto-fix loop: fix agent → re-review, max 3 iterations, then escalate ### Opt-in UX User is asked ONCE before execution with 4 options: (a) Both TDD + Adversarial (b) TDD only (c) Adversarial only (d) Neither (original fast mode) ## Files New: - `skills/subagent-driven-development/tdd-verifier-prompt.md` - `skills/subagent-driven-development/adversarial-security-prompt.md` - `skills/subagent-driven-development/adversarial-edge-cases-prompt.md` - `skills/subagent-driven-development/adversarial-architecture-prompt.md` - `skills/subagent-driven-development/adversarial-fix-prompt.md` - `skills/subagent-driven-development/tests/test_skill_integrity.py` (42 tests) Modified: - `skills/subagent-driven-development/SKILL.md` — full adversarial flow - `skills/executing-plans/SKILL.md` — inline TDD + adversarial self-check ## Testing 42 structural integrity tests validate: file existence, frontmatter, cross-references, opt-in gates, complexity classification, adversarial flow controls, prompt template structure, red flags, and cost documentation. ``` python -m unittest discover -s skills/subagent-driven-development/tests/ -v Ran 42 tests in 0.019s — OK ``` Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Owner
|
I would encourage you to build your own Adversarial Review Skills plugin. As currently built, this isn't a great fit for superpowers. |
Closed
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Motivation
Long autonomous execution runs without intermediate adversarial review produce compounding errors — especially security vulnerabilities, unhandled edge cases, and architecture regressions. The current spec + quality review gates catch what was requested and whether it's clean, but not whether it's safe or robust.
TDD is recommended in the implementer prompt but never verified. This PR adds actual verification via git history analysis.
Changes
New files (5 adversarial agent prompts + 1 test suite)
tdd-verifier-prompt.mdadversarial-security-prompt.mdadversarial-edge-cases-prompt.mdadversarial-architecture-prompt.mdadversarial-fix-prompt.mdtests/test_skill_integrity.pyModified files
subagent-driven-development/SKILL.mdexecuting-plans/SKILL.mdDesign Decisions
Opt-in, not opt-out: Extra gates cost tokens and time. Users should consciously choose the quality level they need. Asked once before execution, applied to all tasks.
Parallel dispatch: Adversarial agents run simultaneously (not sequentially) to minimize wall-clock time. A HIGH complexity task spawns 3 agents in one message.
Complexity-based scaling: LOW tasks (config, simple UI) get 1 reviewer. MEDIUM (APIs, business logic) get 2. HIGH (auth, payments, data mutations) get 3. You pay only for what the task needs.
Zero context isolation: Adversarial agents receive ZERO context from the implementation session. They see only the task spec and files changed. This prevents complacency bias.
Fix loop cap: Max 3 iterations of fix → re-review. On 3rd failure, escalate to human instead of looping forever. If 3 attempts can't fix it, it's a design problem.
Separate fix agent: A fresh agent (not the original implementer) applies fixes. This avoids cognitive bias toward the original approach.
Cost Impact
Test plan
python -m unittest discover -s skills/subagent-driven-development/tests/ -v)🤖 Generated with Claude Code