Adversarial Review
Structured Devil's Advocate analysis that surfaces hidden flaws, edge cases, and blind spots.
Rules (Absolute)
- Default to finding problems. Conduct rigorous analysis across all three vectors. Report every genuine issue found — do not downplay or omit real concerns. If thorough analysis yields fewer than 3 issues, that is a legitimate outcome indicating strong work. Never inflate minor observations to fill a quota, and never fabricate concerns.
- Attack the strongest points. Don't waste time on trivial issues. Target the parts the author is most confident about — that's where hidden assumptions live.
- Separate severity levels. Not all issues are equal. Clearly distinguish critical from minor.
- Propose alternatives. Every criticism must include a concrete alternative or mitigation.
- Steel-man first. Before attacking, state the strongest version of why the current approach was chosen. This prevents straw-man critiques.
- No ad hominem. Critique the work, not the author. Be sharp but constructive.
Ambiguous Input Handling
If the subject under review is unclear or too broad, ask one clarifying question before proceeding. Do not review a vague target. Examples of ambiguous input that should trigger a clarification question:
- "Review my project" (which aspect? architecture? security? specific files?)
- "Is this okay?" with no context (what is "this"?)
- A topic so broad that a meaningful adversarial review would be unfocused
One question. Get the answer. Then proceed.
Process
Phase 1: Steel-Man
Before any criticism, articulate:
- Why was this approach chosen? (Best possible justification)
- What does it optimize for? (Performance? Simplicity? Time-to-market?)
- Under what conditions is this the right choice?
This ensures the subsequent critique is intellectually honest, not reflexive opposition.
Phase 2: Adversarial Attack (3 Vectors)
Apply three independent attack vectors simultaneously:
Vector A: Logical Soundness
Scope: Does the REASONING hold? Examine premises, conclusions, logical flow.
- Are there logical contradictions or circular reasoning?
- Are conclusions actually supported by the stated premises?
- What unstated assumptions does the reasoning depend on?
- Is there confirmation bias in the evidence selection?
Do NOT examine implementation structure — that's Vector C.
Vector B: Edge Case Assault
Scope: Does it SURVIVE reality? Test against real-world conditions.
- What happens at boundaries? (empty input, max load, concurrent access, zero state)
- What's the failure mode? (graceful degradation vs. catastrophic failure)
- What happens in 6 months? (scaling, maintenance burden, team changes)
- What would a malicious actor exploit?
Test behavior and outcomes, not internal structure.
Vector C: Structural Integrity
Scope: Is the STRUCTURE sound? Examine architecture and design.
- Does each component have a single, clear responsibility?
- Where are the coupling points and dependency chains?
- What is the weakest structural link?
- Which component, if changed, would cause the most cascading failures?
Examine architecture, not logical reasoning.
Phase 3: Severity Classification
Classify every finding:
| Severity |
Symbol |
Meaning |
Action Required |
| Critical |
🔴 |
Will cause production issues, security vulnerabilities, or data loss |
Must fix before merge/deploy |
| Major |
🟠 |
Significant risk, performance issue, or maintainability problem |
Should fix, blocking for merge |
| Minor |
🟡 |
Code smell, style issue, or small optimization opportunity |
Consider fixing, non-blocking |
| Note |
💡 |
Observation, alternative approach, or future consideration |
Informational only |
Phase 4: Counter-Proposal
For each Critical and Major finding, provide:
- What's wrong (1-2 sentences)
- Why it matters (concrete impact)
- Suggested fix (code snippet or approach)
- Trade-off of the fix (nothing is free — what does the fix cost?)
Output Format
## Adversarial Review: [Subject]
### Steel-Man
> [Why this approach makes sense — strongest justification]
### Findings
#### 🔴 Critical: [Title]
**Vector:** [Logical Soundness / Edge Case / Structural Integrity]
**What:** [Description]
**Impact:** [Concrete consequence]
**Fix:** [Proposed solution]
**Trade-off:** [Cost of the fix]
#### 🟠 Major: [Title]
...
#### 🟡 Minor: [Title]
...
#### 💡 Note: [Title]
...
### Summary
| Severity | Count |
|----------|-------|
| 🔴 Critical | N |
| 🟠 Major | N |
| 🟡 Minor | N |
| 💡 Note | N |
### Verdict
[PASS / PASS WITH CONDITIONS / FAIL]
- [If PASS WITH CONDITIONS: list required changes]
- [If FAIL: list blocking issues]
### Verdict Criteria
- **FAIL**: Any Critical finding with no viable short-term mitigation, OR 3+ Major findings
- **PASS WITH CONDITIONS**: Any Critical finding with viable mitigation, OR 1-2 Major findings
- **PASS**: No Critical findings, no Major findings. Minor and Notes only.
These thresholds ensure consistent verdicts across invocations.
### Hidden Assumptions Exposed
- [Assumption 1 that the current approach relies on]
- [Assumption 2 that could invalidate the approach if wrong]
Quality Calibration
BAD Adversarial Review (Don't Do This)
## Adversarial Review: User Auth Module
### Steel-Man
> It works.
### Findings
#### 🟡 Minor: Variable naming
**Vector:** Structural Integrity
**What:** Some variables could be named better.
**Impact:** Readability.
**Fix:** Rename them.
**Trade-off:** Time.
#### 🟡 Minor: Could add more comments
**Vector:** Structural Integrity
**What:** Code could use more comments.
**Impact:** Future developers might be confused.
**Fix:** Add comments.
**Trade-off:** None.
#### 🟡 Minor: Consider using TypeScript
**Vector:** Logical Soundness
**What:** TypeScript would catch type errors.
**Impact:** Fewer runtime bugs.
**Fix:** Migrate to TypeScript.
**Trade-off:** Migration effort.
### Verdict: PASS
Why this is bad:
- Steel-man is lazy — no genuine engagement with design intent
- All findings are shallow nitpicks, not substantive concerns
- No Critical or Major issues even considered — no real stress-testing happened
- Vectors are misapplied ("variable naming" is not Structural Integrity)
- Fixes are vague ("rename them", "add comments") with no specifics
- "Consider using TypeScript" is a preference, not a flaw found through analysis
GOOD Adversarial Review (Do This)
## Adversarial Review: User Auth Module
### Steel-Man
> JWT-based stateless auth was chosen to avoid session storage overhead and
> enable horizontal scaling. The 15-minute access token + 7-day refresh token
> split balances security against UX friction. Using bcrypt with cost factor 12
> is a well-established choice for password hashing. This design optimizes for
> scalability and simplicity in a microservices context.
### Findings
#### 🔴 Critical: No refresh token rotation enables silent session hijacking
**Vector:** Edge Case
**What:** Refresh tokens are long-lived (7 days) and not rotated on use.
A stolen refresh token grants persistent access for the full 7-day window
with no detection mechanism.
**Impact:** An attacker who intercepts one refresh token (via XSS, network
sniffing, or device access) maintains access even after the user changes
their password, since token revocation is not implemented.
**Fix:** Implement refresh token rotation: issue a new refresh token on
each refresh, invalidate the previous one, and maintain a token family
chain to detect reuse (which indicates theft).
**Trade-off:** Requires server-side storage for the token family chain,
partially negating the "stateless" benefit. Adds ~50ms per refresh request.
#### 🟠 Major: Rate limiting uses in-memory store, lost on restart
**Vector:** Structural Integrity
**What:** Login rate limiting uses a Map() that resets on process restart.
**Impact:** An attacker can bypass rate limiting by timing attempts around
deploys or crashes. In a multi-instance deployment, each instance has its
own counter, effectively multiplying the allowed attempts by instance count.
**Fix:** Move rate limit state to Redis with TTL-based expiry.
**Trade-off:** Adds Redis as an infrastructure dependency for the auth
service. ~2ms latency per rate limit check.
### Verdict: PASS WITH CONDITIONS
- Must implement refresh token rotation before production deploy
- Should migrate rate limiting to shared store before scaling to >1 instance
Why this is good:
- Steel-man genuinely engages with the design rationale and trade-offs
- Findings target real security risks, not style preferences
- Each finding has specific, concrete impact (not "readability" or "confusion")
- Fixes include implementation direction AND quantified trade-offs
- Vectors are correctly applied and don't overlap
- Verdict follows directly from the severity thresholds
Specialized Modes
Code Review Mode
When reviewing code (files, PRs, diffs):
- Read all changed files with the Read tool
- Check for OWASP Top 10 vulnerabilities
- Verify error handling completeness
- Assess test coverage of edge cases
- Review naming, structure, and abstraction levels
Architecture Decision Mode
When reviewing architecture/design decisions:
- Evaluate scalability assumptions
- Test with 10x and 100x current load mentally
- Check for single points of failure
- Assess vendor lock-in risks
- Consider team capability alignment
PR Review Mode
When reviewing pull requests:
- Focus on behavioral changes, not style
- Check for breaking changes to public APIs
- Verify backward compatibility
- Assess rollback strategy
- Check migration paths for data changes
When to Use
- Before merging any significant PR
- Before committing to an architecture decision
- When evaluating third-party dependencies
- When someone says "this should be fine"
- When stakes are high and mistakes are expensive
- After completing implementation, before calling it done
When NOT to Use
- Trivial changes (typos, formatting)
- When exploration is needed first (use
swing-research)
- When generating alternatives (use
swing-options)
- When you need neutral, exhaustive analysis without a verdict
- Personal preferences or subjective design choices
Integration Notes
- With swing-clarify: Run swing-clarify first on ambiguous requests before invoking this skill. Clarified scope produces better results.
- With swing-options: After adversarial review reveals problems, use swing-options to generate alternative approaches
- With swing-research: Use research to verify claims made during review (e.g., "is this really a security risk?"). For a full-rigor workflow:
swing-research → swing-review
- With orchestrator strategy team: Complements the strategy team's Devil's Advocate agent with structured methodology
1---2name: swing-review3description: Devil's Advocate stress-testing for code, architecture, PRs, and decisions. Surfaces hidden flaws through structured adversarial analysis with metacognitive depth. Use for high-stakes review, stress-testing choices, or when the user wants problems found deliberately. NOT for routine code review. Triggers on "스트레스 테스트", "stress test", "devil's advocate", "반론", "이거 괜찮아", "문제 없을까", "깊은 리뷰", "critical review", "adversarial".4---5
6# Adversarial Review
7
8Structured Devil's Advocate analysis that surfaces hidden flaws, edge cases, and blind spots.
9
10
11## Rules (Absolute)
12
131. **Default to finding problems.** Conduct rigorous analysis across all three vectors. Report every genuine issue found — do not downplay or omit real concerns. If thorough analysis yields fewer than 3 issues, that is a legitimate outcome indicating strong work. Never inflate minor observations to fill a quota, and never fabricate concerns.
142. **Attack the strongest points.** Don't waste time on trivial issues. Target the parts the author is most confident about — that's where hidden assumptions live.
153. **Separate severity levels.** Not all issues are equal. Clearly distinguish critical from minor.
164. **Propose alternatives.** Every criticism must include a concrete alternative or mitigation.
175. **Steel-man first.** Before attacking, state the strongest version of why the current approach was chosen. This prevents straw-man critiques.
186. **No ad hominem.** Critique the work, not the author. Be sharp but constructive.
19
20## Ambiguous Input Handling
21
22If the subject under review is unclear or too broad, **ask one clarifying question before proceeding.** Do not review a vague target. Examples of ambiguous input that should trigger a clarification question:
23- "Review my project" (which aspect? architecture? security? specific files?)
24- "Is this okay?" with no context (what is "this"?)
25- A topic so broad that a meaningful adversarial review would be unfocused
26
27One question. Get the answer. Then proceed.
28
29## Process
30
31### Phase 1: Steel-Man
32
33Before any criticism, articulate:
34- **Why was this approach chosen?** (Best possible justification)
35- **What does it optimize for?** (Performance? Simplicity? Time-to-market?)
36- **Under what conditions is this the right choice?**
37
38This ensures the subsequent critique is intellectually honest, not reflexive opposition.
39
40### Phase 2: Adversarial Attack (3 Vectors)
41
42Apply three independent attack vectors simultaneously:
43
44#### Vector A: Logical Soundness
45**Scope: Does the REASONING hold?** Examine premises, conclusions, logical flow.
46- Are there logical contradictions or circular reasoning?
47- Are conclusions actually supported by the stated premises?
48- What unstated assumptions does the reasoning depend on?
49- Is there confirmation bias in the evidence selection?
50Do NOT examine implementation structure — that's Vector C.
51
52#### Vector B: Edge Case Assault
53**Scope: Does it SURVIVE reality?** Test against real-world conditions.
54- What happens at boundaries? (empty input, max load, concurrent access, zero state)
55- What's the failure mode? (graceful degradation vs. catastrophic failure)
56- What happens in 6 months? (scaling, maintenance burden, team changes)
57- What would a malicious actor exploit?
58Test behavior and outcomes, not internal structure.
59
60#### Vector C: Structural Integrity
61**Scope: Is the STRUCTURE sound?** Examine architecture and design.
62- Does each component have a single, clear responsibility?
63- Where are the coupling points and dependency chains?
64- What is the weakest structural link?
65- Which component, if changed, would cause the most cascading failures?
66Examine architecture, not logical reasoning.
67
68### Phase 3: Severity Classification
69
70Classify every finding:
71
72| Severity | Symbol | Meaning | Action Required |
73|----------|--------|---------|-----------------|
74| Critical | `🔴` | Will cause production issues, security vulnerabilities, or data loss | Must fix before merge/deploy |
75| Major | `🟠` | Significant risk, performance issue, or maintainability problem | Should fix, blocking for merge |
76| Minor | `🟡` | Code smell, style issue, or small optimization opportunity | Consider fixing, non-blocking |
77| Note | `💡` | Observation, alternative approach, or future consideration | Informational only |
78
79### Phase 4: Counter-Proposal
80
81For each Critical and Major finding, provide:
821. **What's wrong** (1-2 sentences)
832. **Why it matters** (concrete impact)
843. **Suggested fix** (code snippet or approach)
854. **Trade-off of the fix** (nothing is free — what does the fix cost?)
86
87## Output Format
88
89```markdown
90## Adversarial Review: [Subject]
91
92### Steel-Man
93> [Why this approach makes sense — strongest justification]
94
95### Findings
96
97#### 🔴 Critical: [Title]
98**Vector:** [Logical Soundness / Edge Case / Structural Integrity]
99**What:** [Description]
100**Impact:** [Concrete consequence]
101**Fix:** [Proposed solution]
102**Trade-off:** [Cost of the fix]
103
104#### 🟠 Major: [Title]
105...
106
107#### 🟡 Minor: [Title]
108...
109
110#### 💡 Note: [Title]
111...
112
113### Summary
114| Severity | Count |
115|----------|-------|
116| 🔴 Critical | N |
117| 🟠 Major | N |
118| 🟡 Minor | N |
119| 💡 Note | N |
120
121### Verdict
122[PASS / PASS WITH CONDITIONS / FAIL]
123- [If PASS WITH CONDITIONS: list required changes]
124- [If FAIL: list blocking issues]
125
126### Verdict Criteria
127- **FAIL**: Any Critical finding with no viable short-term mitigation, OR 3+ Major findings
128- **PASS WITH CONDITIONS**: Any Critical finding with viable mitigation, OR 1-2 Major findings
129- **PASS**: No Critical findings, no Major findings. Minor and Notes only.
130These thresholds ensure consistent verdicts across invocations.
131
132### Hidden Assumptions Exposed
133- [Assumption 1 that the current approach relies on]
134- [Assumption 2 that could invalidate the approach if wrong]
135```
136
137## Quality Calibration
138
139### BAD Adversarial Review (Don't Do This)
140```
141## Adversarial Review: User Auth Module
142
143### Steel-Man
144> It works.
145
146### Findings
147
148#### 🟡 Minor: Variable naming
149**Vector:** Structural Integrity
150**What:** Some variables could be named better.
151**Impact:** Readability.
152**Fix:** Rename them.
153**Trade-off:** Time.
154
155#### 🟡 Minor: Could add more comments
156**Vector:** Structural Integrity
157**What:** Code could use more comments.
158**Impact:** Future developers might be confused.
159**Fix:** Add comments.
160**Trade-off:** None.
161
162#### 🟡 Minor: Consider using TypeScript
163**Vector:** Logical Soundness
164**What:** TypeScript would catch type errors.
165**Impact:** Fewer runtime bugs.
166**Fix:** Migrate to TypeScript.
167**Trade-off:** Migration effort.
168
169### Verdict: PASS
170```
171
172**Why this is bad:**
173- Steel-man is lazy — no genuine engagement with design intent
174- All findings are shallow nitpicks, not substantive concerns
175- No Critical or Major issues even considered — no real stress-testing happened
176- Vectors are misapplied ("variable naming" is not Structural Integrity)
177- Fixes are vague ("rename them", "add comments") with no specifics
178- "Consider using TypeScript" is a preference, not a flaw found through analysis
179
180### GOOD Adversarial Review (Do This)
181```
182## Adversarial Review: User Auth Module
183
184### Steel-Man
185> JWT-based stateless auth was chosen to avoid session storage overhead and
186> enable horizontal scaling. The 15-minute access token + 7-day refresh token
187> split balances security against UX friction. Using bcrypt with cost factor 12
188> is a well-established choice for password hashing. This design optimizes for
189> scalability and simplicity in a microservices context.
190
191### Findings
192
193#### 🔴 Critical: No refresh token rotation enables silent session hijacking
194**Vector:** Edge Case
195**What:** Refresh tokens are long-lived (7 days) and not rotated on use.
196A stolen refresh token grants persistent access for the full 7-day window
197with no detection mechanism.
198**Impact:** An attacker who intercepts one refresh token (via XSS, network
199sniffing, or device access) maintains access even after the user changes
200their password, since token revocation is not implemented.
201**Fix:** Implement refresh token rotation: issue a new refresh token on
202each refresh, invalidate the previous one, and maintain a token family
203chain to detect reuse (which indicates theft).
204**Trade-off:** Requires server-side storage for the token family chain,
205partially negating the "stateless" benefit. Adds ~50ms per refresh request.
206
207#### 🟠 Major: Rate limiting uses in-memory store, lost on restart
208**Vector:** Structural Integrity
209**What:** Login rate limiting uses a Map() that resets on process restart.
210**Impact:** An attacker can bypass rate limiting by timing attempts around
211deploys or crashes. In a multi-instance deployment, each instance has its
212own counter, effectively multiplying the allowed attempts by instance count.
213**Fix:** Move rate limit state to Redis with TTL-based expiry.
214**Trade-off:** Adds Redis as an infrastructure dependency for the auth
215service. ~2ms latency per rate limit check.
216
217### Verdict: PASS WITH CONDITIONS
218- Must implement refresh token rotation before production deploy
219- Should migrate rate limiting to shared store before scaling to >1 instance
220```
221
222**Why this is good:**
223- Steel-man genuinely engages with the design rationale and trade-offs
224- Findings target real security risks, not style preferences
225- Each finding has specific, concrete impact (not "readability" or "confusion")
226- Fixes include implementation direction AND quantified trade-offs
227- Vectors are correctly applied and don't overlap
228- Verdict follows directly from the severity thresholds
229
230## Specialized Modes
231
232### Code Review Mode
233When reviewing code (files, PRs, diffs):
234- Read all changed files with the Read tool
235- Check for OWASP Top 10 vulnerabilities
236- Verify error handling completeness
237- Assess test coverage of edge cases
238- Review naming, structure, and abstraction levels
239
240### Architecture Decision Mode
241When reviewing architecture/design decisions:
242- Evaluate scalability assumptions
243- Test with 10x and 100x current load mentally
244- Check for single points of failure
245- Assess vendor lock-in risks
246- Consider team capability alignment
247
248### PR Review Mode
249When reviewing pull requests:
250- Focus on behavioral changes, not style
251- Check for breaking changes to public APIs
252- Verify backward compatibility
253- Assess rollback strategy
254- Check migration paths for data changes
255
256## When to Use
257
258- Before merging any significant PR
259- Before committing to an architecture decision
260- When evaluating third-party dependencies
261- When someone says "this should be fine"
262- When stakes are high and mistakes are expensive
263- After completing implementation, before calling it done
264
265## When NOT to Use
266
267- Trivial changes (typos, formatting)
268- When exploration is needed first (use `swing-research`)
269- When generating alternatives (use `swing-options`)
270- When you need neutral, exhaustive analysis without a verdict
271- Personal preferences or subjective design choices
272
273## Integration Notes
274
275- **With swing-clarify:** Run swing-clarify first on ambiguous requests before invoking this skill. Clarified scope produces better results.
276- **With swing-options:** After adversarial review reveals problems, use swing-options to generate alternative approaches
277- **With swing-research:** Use research to verify claims made during review (e.g., "is this really a security risk?"). For a full-rigor workflow: `swing-research` → `swing-review`
278- **With orchestrator strategy team:** Complements the strategy team's Devil's Advocate agent with structured methodology