npx claudepluginhub creator-hian/claude-code-plugins --plugin agent-team-pluginWant just this skill?
Then install: npx claudepluginhub u/[userId]/[slug]
Use when you have an existing plan, design, or implemented code that needs adversarial review to find weaknesses, missing edge cases, and unnecessary complexity
This skill uses the workspace's default tool permissions.
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
-
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?"
-
Assess complexity to choose the execution path. Apply rules top to bottom — first match wins:
- User explicitly requests thorough/deep review ("철저히", "깊이", "thorough") → Team Mode
- Target is a plan, design document, or architecture → Team Mode
- Target spans 3+ files or is a PR diff → Team Mode
- 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:
| # | Severity | Location | Finding | Better 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
-
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.
-
Select DA agents — pick the set that covers the risk areas:
Target Type Recommended Agents New feature (code) Feasibility Skeptic + Gap Hunter New feature (plan) Feasibility Skeptic + Gap Hunter + Concurrency Auditor Refactoring Feasibility Skeptic + Complexity Critic User input / external APIs Feasibility Skeptic + Security Auditor Public API changes Feasibility Skeptic + Backwards Compatibility Checker Performance-sensitive code Feasibility Skeptic + Performance Analyst Async / concurrent code Feasibility Skeptic + Concurrency Auditor Large architectural change 3 agents max, matching risk areas High-risk target 3 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.
-
Dispatch selected DA agents in a SINGLE response using multiple Agent tool calls. Build each agent's prompt:
- Team preamble (see "Team Framing" below)
- The agent's role prompt from the DA Role Pool
- The full content of ALL files loaded in step 3 — embed the actual code, not just file paths
- Review mode indicator: "You are reviewing a plan." or "You are reviewing implemented code."
- 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."
- Instruction: "Respond in the same language as the user's request."
-
Wait for ALL agents to complete. Do NOT begin consolidation with partial results.
Phase 2: Consolidation + Alternative Synthesis
- Collect findings from all agents into a single list.
- 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?
- Deduplicate overlapping findings, noting contributing agents.
- 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)
- 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
-
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?
-
Present findings + alternatives to the user with clear options:
- Apply suggested fixes to current approach
- Adopt one of the alternative approaches
- Keep as-is
-
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):
- 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.
- Has this API/method/pattern been verified in the codebase?
- What if the dependency from Step N isn't ready for Step N+1?
- Can verification steps actually catch claimed failures?
- What implicit assumption could be wrong?
Attack Questions (code mode):
- 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.
- Does this handle all claimed cases?
- Are there runtime conditions producing silent wrong results?
- Are error paths tested or assumed?
- What happens with unexpected inputs, nulls, empty collections?
Output Format:
| # | Severity | Location | Finding | Better 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:
- Could this use fewer files/classes/abstractions?
- Is this abstraction justified for a single use case?
- Is there a simpler existing pattern in the codebase?
- Would a senior engineer say this is overcomplicated?
Output Format:
| # | Severity | Location | Current Approach | Simpler 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):
- What error scenarios are not handled?
- What edge cases are not mentioned?
- What if this change is only partially completed? Is there a rollback or failover strategy?
- What cleanup is needed if this fails midway?
- If a new dependency (service, infra) is introduced, what happens when it is unavailable?
- Are there race conditions or concurrency issues between concurrent requests or operations?
- Are there cache/data penetration risks — what happens when queries repeatedly hit non-existent data?
Attack Questions (code mode):
- What error scenarios are uncaught?
- What input combinations or boundary values are untested?
- What if a dependency (API, DB, file) is unavailable?
- Are there missing cleanup paths (finally, resource disposal)?
Output Format:
| # | Severity | Gap Type | What Is Missing | Structural 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:
- Is user input validated before use?
- Are authorization checks missing?
- Could sensitive data be exposed through logs, errors, or APIs?
- Are there injection vectors (SQL, command, XSS)?
Output Format:
| # | Severity | Location | Vulnerability | Secure 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:
- Does this change public API signatures, return types, or behavior?
- Are there existing callers that would break?
- Is there a migration path for old interface consumers?
- Does data format change require migration of existing data?
Output Format:
| # | Severity | Location | Breaking Change | Migration 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:
- O(n²) or worse hidden in loops?
- Resources (connections, handles, streams) leaked?
- Unnecessary allocations or copies in hot paths?
- 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:
- Shared mutable state accessed without synchronization?
- Can concurrent operations produce inconsistent state? Walk through the interleaving.
- Potential deadlocks from lock ordering or nested awaits?
- 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.
Similar Skills
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.