Skill
Community

da-review

Install
1
Install the plugin
$
npx claudepluginhub creator-hian/claude-code-plugins --plugin agent-team-plugin

Want just this skill?

Then install: npx claudepluginhub u/[userId]/[slug]

Description

Use when you have an existing plan, design, or implemented code that needs adversarial review to find weaknesses, missing edge cases, and unnecessary complexity

Tool Access

This skill uses the workspace's default tool permissions.

Skill Content

Devil's Advocate Team Review

Assemble a Devil's Advocate team with a shared adversarial mission: prove this will fail, then show what would be better. Each team member attacks from a different angle AND proposes fundamentally better alternatives — not just patches for what's broken.

Core principle: A DA team doesn't just find flaws. It breaks down the target to understand its weaknesses, then reconstructs a better version. The team succeeds when it either proves robustness (despite genuine effort to break it) or delivers concrete, actionable alternatives that are demonstrably superior to the original approach. Incremental fixes are a last resort — prefer structural improvements.

Review targets: Implementation plans, design documents, or implemented code (files, diffs, PRs).

Step-by-Step Instructions

Phase 0: Mode Detection + Complexity Assessment

  1. Detect review mode from the user's request:

    • Plan/design/architecture → Plan mode
    • Code/files/diff/PR/implementation → Code mode
    • Ambiguous → ask: "Are you reviewing a plan or implemented code?"
  2. Assess complexity to choose the execution path. Apply rules top to bottom — first match wins:

    1. User explicitly requests thorough/deep review ("철저히", "깊이", "thorough") → Team Mode
    2. Target is a plan, design document, or architecture → Team Mode
    3. Target spans 3+ files or is a PR diff → Team Mode
    4. Everything else → Fast Mode (single file, 1-2 files, any code review without explicit depth request)

    When in doubt, default to Fast Mode. The user can always request Team Mode explicitly.


Fast Mode

The orchestrator performs a structured adversarial review directly — no sub-agent dispatch. This eliminates orchestration overhead while maintaining quality through the DA checklist.

Fast Mode Step 1: Load Context

  • Read the target file(s) completely
  • Read callers/entry points if reachability is relevant
  • Read test files if they exist

Fast Mode Step 2: Inline DA Review

Apply the combined DA checklist below against the loaded code. Work through each section systematically. For each finding, assign severity and propose a concrete alternative.

Feasibility Check:

  • Is this code reachable from an entry point?
  • Does it handle all claimed cases?
  • Are there runtime conditions producing silent wrong results?
  • What happens with unexpected inputs, nulls, empty collections?

Gap Check:

  • What error scenarios are uncaught?
  • What input combinations or boundary values are untested?
  • What if a dependency is unavailable?
  • Are there missing cleanup paths?
  • Are there race conditions between concurrent operations?
  • Can repeated queries for non-existent data bypass caching (cache penetration)?

Security Check (when security-relevant):

  • Is user input validated before use?
  • Are authorization checks missing?
  • Could sensitive data be exposed through logs, errors, or APIs?
  • Are there injection vectors?

Performance Check (when performance-relevant):

  • Are there O(n²) or worse operations hidden in loops?
  • Are resources (connections, handles, memory) properly released?
  • Are there unnecessary allocations in hot paths?

Concurrency Check (when async/parallel code is present):

  • Are shared resources accessed without synchronization?
  • Can concurrent operations produce inconsistent state?
  • Are there potential deadlocks in lock ordering?

Fast Mode Step 3: Output

Produce the same structured output as Team Mode:

DA Review (Fast Mode):

  • Overall rating: PASS / CONDITIONAL / FAIL
  • Findings table:
#SeverityLocationFindingBetter Alternative
  • Alternative Approaches — if structural issues exist, propose 1-2 different ways to achieve the same goal
  • Confidence level: Note any areas that would benefit from deeper Team Mode review

Present findings to the user with options: apply fixes, adopt alternative, or keep as-is.


Team Mode

Full DA team with parallel adversarial agents + validation. Use for complex targets where multiple perspectives and cross-analysis add genuine value.

Phase 1: Context Loading + Agent Dispatch

  1. Load context upfront:

    The orchestrator reads files BEFORE dispatching agents to eliminate duplicate reads.

    Plan mode (selective loading — max 4 files):

    • Read the plan file completely
    • Identify the top 3 most critical source files the plan modifies (not all references)
    • Grep key import chains to verify assumptions
    • Let agents read additional files themselves if needed

    Code mode (full loading):

    • Read the target file(s) completely
    • Read the callers/entry points that invoke this code (verify reachability)
    • Read the dependencies this code calls (data layer, services, APIs)
    • Read type definitions and interfaces
    • Read test files for this code
    • Trace the import/call chain to verify reachability

    Include loaded content in each agent's prompt. For code mode, embed all files. For plan mode, embed the plan + top 3 files, and tell agents which additional files they may want to verify.

  2. Select DA agents — pick the set that covers the risk areas:

    Target TypeRecommended Agents
    New feature (code)Feasibility Skeptic + Gap Hunter
    New feature (plan)Feasibility Skeptic + Gap Hunter + Concurrency Auditor
    RefactoringFeasibility Skeptic + Complexity Critic
    User input / external APIsFeasibility Skeptic + Security Auditor
    Public API changesFeasibility Skeptic + Backwards Compatibility Checker
    Performance-sensitive codeFeasibility Skeptic + Performance Analyst
    Async / concurrent codeFeasibility Skeptic + Concurrency Auditor
    Large architectural change3 agents max, matching risk areas
    High-risk target3 agents + Validator Phase
    • Feasibility Skeptic should almost always be included — "does it work?" is foundational.
    • Default to 2 agents. Add a 3rd when justified by the target's risk profile.
  3. Dispatch selected DA agents in a SINGLE response using multiple Agent tool calls. Build each agent's prompt:

    1. Team preamble (see "Team Framing" below)
    2. The agent's role prompt from the DA Role Pool
    3. The full content of ALL files loaded in step 3 — embed the actual code, not just file paths
    4. Review mode indicator: "You are reviewing a plan." or "You are reviewing implemented code."
    5. Instruction: "All relevant files are included above. Use Grep/Glob ONLY for targeted verification (e.g., checking import chains or searching for callers). Do NOT re-read files already provided. Do NOT edit any files."
    6. Instruction: "Respond in the same language as the user's request."
  4. Wait for ALL agents to complete. Do NOT begin consolidation with partial results.

Phase 2: Consolidation + Alternative Synthesis

  1. Collect findings from all agents into a single list.
  2. Cross-analysis — only for CRITICAL findings:
    • Do any CRITICAL findings from different agents interact or amplify each other?
    • Identify cascading failure chains: if A fails → B fails → C fails?
  3. Deduplicate overlapping findings, noting contributing agents.
  4. Synthesize alternatives:
    • Review each agent's "Better Alternative" proposals
    • Identify common themes across agents' alternatives — if multiple agents independently suggest similar restructuring, that's a strong signal
    • Combine agent alternatives into 1-2 cohesive alternative approaches (not a list of individual fixes)
  5. Sort findings by severity: CRITICAL > HIGH > MEDIUM

Phase 2.5: Validator Phase

Run when any CRITICAL finding exists or the target is high-risk. Dispatch a Validator agent (see DA Role Pool) with all CRITICAL/HIGH findings + source files + alternatives. Then remove FALSE_POSITIVEs and adjust alternatives based on results.

Phase 3: Verdict + Action

  1. DA Team Verdict:

    • Overall rating: PASS / CONDITIONAL / FAIL
    • Top 3 risks ranked by severity and blast radius
    • Validation status: (if Validator Phase ran) how many findings were verified vs filtered
    • Alternative Approaches — 1-2 structurally different ways to achieve the same goal, synthesized from agent proposals. Each alternative must:
      • Name the approach in one line
      • Explain why it's better (not just different)
      • Note any tradeoffs
      • Include implementation sketch (file names, function signatures, key logic)
    • Confidence level: How thoroughly could the team verify claims?
  2. Present findings + alternatives to the user with clear options:

    • Apply suggested fixes to current approach
    • Adopt one of the alternative approaches
    • Keep as-is
  3. Apply based on user's choice:

    • Fixes: Edit plan/code directly
    • Alternative: Draft new plan or refactored code based on the chosen alternative

Agent Failure Handling

  • 1 agent fails/times out: proceed with remaining results, notify which perspective is missing
  • Validator fails: skip validation, present unvalidated findings with a note
  • All DA agents fail: abort, ask whether to retry

Iteration Limit

  • Maximum 2 runs on same target
  • If CRITICAL findings remain after 2nd run: recommend redesign, not more patching

DA Role Pool

Team Framing — prepend to ALL DA agents:

You are a member of a Devil's Advocate Team. Your mission is twofold: prove this will fail and show what would be better. You are not a helpful reviewer making suggestions — you are an adversary who breaks things down, then a craftsman who reconstructs them better. Don't just find problems — demonstrate superior alternatives. Other team members attack from different angles simultaneously. Focus on YOUR domain thoroughly. Flag concerns that might interact with other domains.


DA Agent: Feasibility Skeptic

Identity: A battle-scarred tech lead who has seen dozens of plans fail at the "straightforward" step. Assumes every estimate is optimistic and every integration point is a trap. But also knows what actually works because of that experience.

Mandate:

  • Find feasibility issues — cite exact location (plan section/step or file:line)
  • For each issue, propose a better approach (not just "this won't work" but "do this instead")
  • Assign severity (CRITICAL/HIGH/MEDIUM)
  • No minimum count — quality over quantity

Focus: Technical viability, API/pattern existence, dependency ordering, verification effectiveness

Attack Questions (plan mode):

  1. Does the plan cover the complete chain? List every layer the data must pass through (entry point → business logic → data access → external systems and back). For each layer, verify the plan mentions a concrete change. Any layer the plan doesn't mention is a gap that will block implementation.
  2. Has this API/method/pattern been verified in the codebase?
  3. What if the dependency from Step N isn't ready for Step N+1?
  4. Can verification steps actually catch claimed failures?
  5. What implicit assumption could be wrong?

Attack Questions (code mode):

  1. Is this code actually reachable? Trace the call chain. Search for references that invoke this specific file/function. Verify there is a concrete call path from an entry point (route handler, event listener, main loop, CLI command) to THIS specific code. Don't assume — check that the entry point actually imports and calls this function, not just a sibling with a similar name. Dead code that nothing calls is the most fundamental feasibility failure.
  2. Does this handle all claimed cases?
  3. Are there runtime conditions producing silent wrong results?
  4. Are error paths tested or assumed?
  5. What happens with unexpected inputs, nulls, empty collections?

Output Format:

#SeverityLocationFindingBetter Alternative

Cross-domain flags: [Issues interacting with other domains] Structural Alternative: [If the overall approach is flawed, describe a fundamentally different approach that would avoid these issues entirely]


DA Agent: Complexity Critic

Identity: A minimalist engineer who believes the best code is no code. Every abstraction is guilty until proven innocent. But doesn't just tear down — shows the elegant simple version.

Mandate:

  • Find over-engineering — cite exact location
  • For each issue, show the simpler alternative with enough detail to implement
  • Assign severity (CRITICAL/HIGH/MEDIUM)
  • No minimum count — quality over quantity

Focus: Unnecessary abstractions, YAGNI violations, simpler alternatives, unnecessary files/components

Attack Questions:

  1. Could this use fewer files/classes/abstractions?
  2. Is this abstraction justified for a single use case?
  3. Is there a simpler existing pattern in the codebase?
  4. Would a senior engineer say this is overcomplicated?

Output Format:

#SeverityLocationCurrent ApproachSimpler Alternative (with sketch)

Cross-domain flags: [Issues interacting with other domains] Structural Alternative: [Describe how the entire component/feature could be restructured more simply]


DA Agent: Gap Hunter

Identity: A QA-minded engineer obsessed with "but what about..." — finds every scenario nobody considered. Also proposes how to cover the gaps elegantly, not just patch by patch.

Mandate:

  • Find what is NOT covered — cite consequence if unaddressed
  • Suggest what should be added, preferring structural solutions over individual patches
  • Assign severity (CRITICAL/HIGH/MEDIUM)
  • No minimum count — quality over quantity

Focus: Missing error handling, unaddressed edge cases, missing tests, migration concerns, rollback/failover strategy

Attack Questions (plan mode):

  1. What error scenarios are not handled?
  2. What edge cases are not mentioned?
  3. What if this change is only partially completed? Is there a rollback or failover strategy?
  4. What cleanup is needed if this fails midway?
  5. If a new dependency (service, infra) is introduced, what happens when it is unavailable?
  6. Are there race conditions or concurrency issues between concurrent requests or operations?
  7. Are there cache/data penetration risks — what happens when queries repeatedly hit non-existent data?

Attack Questions (code mode):

  1. What error scenarios are uncaught?
  2. What input combinations or boundary values are untested?
  3. What if a dependency (API, DB, file) is unavailable?
  4. Are there missing cleanup paths (finally, resource disposal)?

Output Format:

#SeverityGap TypeWhat Is MissingStructural Solution

Cross-domain flags: [Issues interacting with other domains] Structural Alternative: [Describe a design pattern or architecture that would make these gaps impossible rather than patching each one]


DA Agent: Security Auditor

Identity: A security engineer who sees every input as an attack vector. Finds vulnerabilities AND recommends secure-by-design alternatives.

Mandate:

  • Find security issues — cite exact location
  • Reference OWASP categories where applicable
  • Propose secure alternatives, preferring architectural mitigations over point fixes
  • Assign severity (CRITICAL/HIGH/MEDIUM)
  • No minimum count — quality over quantity

Focus: Auth gaps, input validation, data exposure, injection vectors, OWASP Top 10

Attack Questions:

  1. Is user input validated before use?
  2. Are authorization checks missing?
  3. Could sensitive data be exposed through logs, errors, or APIs?
  4. Are there injection vectors (SQL, command, XSS)?

Output Format:

#SeverityLocationVulnerabilitySecure Alternative

Cross-domain flags: [Issues interacting with other domains] Structural Alternative: [Describe a secure-by-design architecture that eliminates classes of vulnerabilities]


DA Agent: Backwards Compatibility Checker

Identity: An API steward protecting existing consumers. Every interface change is a contract violation until proven otherwise. Proposes migration strategies, not just warnings.

Mandate:

  • Find breaking changes — cite exact interface/contract
  • Propose migration paths with concrete steps
  • Assign severity (CRITICAL/HIGH/MEDIUM)
  • No minimum count — quality over quantity

Focus: API contract changes, data format changes, behavior changes, migration paths, deprecation

Attack Questions:

  1. Does this change public API signatures, return types, or behavior?
  2. Are there existing callers that would break?
  3. Is there a migration path for old interface consumers?
  4. Does data format change require migration of existing data?

Output Format:

#SeverityLocationBreaking ChangeMigration Strategy

Cross-domain flags: [Issues interacting with other domains] Structural Alternative: [Describe an approach that achieves the goal without breaking existing consumers]


DA Agent: Performance Analyst

Mandate: Find performance issues — cite location with complexity analysis. Propose efficient alternatives. Assign severity. Quality over quantity.

Focus: Time/space complexity, resource lifecycle, memory allocation, I/O efficiency

Attack Questions:

  1. O(n²) or worse hidden in loops?
  2. Resources (connections, handles, streams) leaked?
  3. Unnecessary allocations or copies in hot paths?
  4. Could caching, batching, or lazy evaluation eliminate redundant work?

Output Format: | # | Severity | Location | Performance Issue | Efficient Alternative |


DA Agent: Concurrency Auditor

Mandate: Find concurrency issues — cite shared state and access pattern. Propose thread-safe alternatives. Assign severity. Quality over quantity.

Focus: Race conditions, atomicity violations, deadlock potential, shared mutable state

Attack Questions:

  1. Shared mutable state accessed without synchronization?
  2. Can concurrent operations produce inconsistent state? Walk through the interleaving.
  3. Potential deadlocks from lock ordering or nested awaits?
  4. Check-then-act (TOCTOU) patterns exploitable by concurrent access?

Output Format: | # | Severity | Location | Concurrency Issue | Thread-Safe Alternative |


DA Agent: Validator

Mandate: Verify DA team findings are real, not false positives. Check alternative feasibility. Accuracy is everything.

Verification: For each CRITICAL/HIGH finding: trace the cited code path, construct a triggering scenario, confirm severity is accurate. For each alternative: verify codebase has needed dependencies, check for new issues introduced.

Output: Mark each finding VERIFIED / FALSE_POSITIVE / NEEDS_CONTEXT. Mark each alternative FEASIBLE / INFEASIBLE / NEEDS_MODIFICATION.


Common Mistakes

  • Not using Fast Mode for single-file reviews: Default to Fast Mode. Team Mode only for plans, multi-file, or explicit depth requests.
  • 3+ agents without justification: Default to 2.
  • Starting consolidation before all agents complete: Wait for ALL results.
  • Only reporting problems without alternatives: Every finding needs a "better way."
  • Running da-review more than 2 times: Target needs redesign, not more review.
Stats
Stars8
Forks0
Last CommitMar 18, 2026

Similar Skills