The build was green and all 72 tests passed, but there was still a regression sitting in the diff, on the only code path that actually ships.
This was KICK’s Apple TV app. KICK, powered by Easygo, streams live to millions of viewers around the world, and the TV is one of the screens they can watch on. I'd just refactored a ViewModel to break an ugly coupling. A video player was reaching into a shared object to borrow a channel ID it had no reason to own. The fix was clean. It compiled, the suite went green, and I was ready to call it done. What I'd missed was that removing that shared object left a SwiftUI view holding its state the wrong way — an unowned @ObservedObject where it needed a @StateObject. That’s a well-known way to lose state. It was on the flag-off path, which is the version that goes to the App Store.
Neither I nor the tests caught it, but an agent whose only job was to try to break my work did. Most of what I read about multi-agent setups is about throughput: “10x your workflow with subagents” or “why the top 1% use development loops”. Spin up five engineers, fan out the work, go faster. That’s useful, but I don’t think it’s where most of the value is. Three engineer agents running in parallel will give you more code, sooner. They’ll also give you plausible-but-wrong code sooner, because nothing in that setup is trying to prove the code wrong.
An agent team becomes more trustworthy when something independent is actively looking for mistakes.
Two roles, and they're not the same
I run two adversarial roles in Claude Code, and it matters that they're separate jobs:
A very simple prompt might be:
You're coordinating a team of agents to refactor the
Streaming Chat parser.
Create four agents with distinct responsibilities:
- Swift engineer: Implement the refactor.
- Test writer: Define expected behaviour and write tests.
- QA: Validate the implementation against the requirements.
- Devil's advocate: Independently review the changes,
looking for regressions, incorrect assumptions and
failure scenarios.
Follow this development loop:
Tester → Engineer → QA → Devil's advocate
Keep the devil's advocate isolated from the other agents'
reasoning. Give it the requirements and final diff so it
can evaluate the work independently.
As coordinator, evaluate the devil's advocate's findings.
Check whether each issue is genuine before accepting it.
If a finding is valid, send the work through the loop again.
Repeat until the implementation passes validation and no
unresolved critical issues remain.
They find different things. On that same refactor, QA wrote new tests for the rewritten ViewModel. Straight away it pointed out something I’d skated past: the old tests couldn’t be reused, because I’d changed how the ViewModel published its state without really registering it. The tests were built on assumptions the refactor had broken, and the person who made the change is the one least likely to see that. The state ownership bug came from the devil’s advocate. If I’d merged the two roles into one “reviewer”, I’m fairly sure I’d have lost one of those findings.
“But it’s the same model”
This would be an obvious objection. If the engineer agent missed the bug, why would a critic running on the same model, with the same training, catch it?
I think it comes down to where the critic starts from and what it’s asked to do. The critic benefits from seeing the work with fresh context and a different objective, and three things about that position do the work. Fresh context gives the critic a different starting point. The engineer has spent the session building an approach and explaining why it should work. The critic gets the requirements and the final diff, so it has to judge what's there without inheriting that explanation. That gives it a chance to question assumptions the engineer has stopped noticing.
Role isolation beats one long chain. You could tell a single agent "now review your own work", but it's still anchored to the reasoning it just produced, and the review inherits the assumptions that caused the miss. A separate agent starts without that history, giving it a better chance of challenging those assumptions. Keeping the agents isolated is what allows them to approach the same problem independently.
And the prompt inverts the goal. The engineer is told “make it work”. The devil's advocate is told the opposite: “find what's broken, assume it's guilty, try to refute it”. It’s the same model with the opposite objective, which changes what surfaces:
Review this diff adversarially. Your job is to find defects, not to bless the work. Assume something is wrong and prove it. Rank what you find, cite the exact line, and give the failure scenario.That’s a very different request from “please check my code”, which produces a very different output.
Codifying the devil’s advocate
Skills can make that role more focused. Rather than relying on a generic instruction to find bugs, I can give the devil's advocate specific things to look for. A Swift concurrency skill might tell it to investigate actor isolation, shared mutable state and suspension points. A SwiftUI skill might focus on state ownership, view identity and lifecycle issues. A testing skill might challenge whether the tests actually exercise the production code path. The agent still has to reason about the diff, but the skills give it a more deliberate way to look for problems.
---
name: devils-advocate
description: Adversarial code review focused on finding defects and regressions.
---
# Devil's Advocate
Your job is to challenge the implementation. Assume defects exist
and look for evidence.
## Review
- Read the diff with fresh context.
- Look for regressions, incorrect assumptions and edge cases.
- Check Swift concurrency, state ownership and lifecycle behaviour.
- Identify untested paths, particularly production configurations.
- Challenge suspicious findings from other tools.
## Findings
For each issue, report:
- File and line number.
- The defect and how it could fail.
- Severity and suggested fix.
Only report issues supported by evidence. Dismiss false positives
and explicitly state when no actionable defects are found.
There's nothing particularly clever in that skill. It gives the agent a job, a few areas to investigate, and a standard for reporting findings. The important part is that it has to explain how something could fail. A list of hypothetical problems nobody can reproduce or act on isn’t much use.
Useful, not noisy
A critic stops being useful in one of two ways: it either approves everything, or it flags everything. Mine did neither. Instead it ran twice across that session, once on the rewrite and once on the decoupling, and both times came back "ship, with fixes", each with a specific, actionable defect and a one-line remedy.
On the decoupling pass, the finding was a SwiftUI state ownership issue. The view was holding a ViewModel using @ObservedObject when it needed @StateObject. The critic identified the risk: the ViewModel could be recreated as SwiftUI rebuilt the view, losing its state. It also pointed to the flag-off path, the one actually shipping to users. It was a small fix, but missing it could have caused a real problem.
In the same pass, an impact analysis tool was screaming "CRITICAL — 442 affected symbols". That looked alarming until the critic traced it back to transitive imports. The number was technically correct, but it didn't represent 442 things that needed fixing, so the critic dismissed it.
That's the sort of output I want from a review. A specific defect, an explanation of how it could fail, and a suggested fix. Just as importantly, the judgement to recognise when something that looks dangerous actually isn't.
What it changes about my own review
Running the critic before reviewing the code myself changes how I approach the final review. The critic runs before I do, so by the time a diff reaches me, something has already tried to break it, and I'm reading a pre-attacked artefact with its known weak points already surfaced, not raw output I have to distrust from scratch.
It’s the same idea behind human code review: whoever wrote the code shouldn’t be the one who signs it off. We’re a small team on KICK’s Apple apps, though, so a lot of the time the author is the only person around. That's exactly when an independent pass goes from nice-to-have to the only review that happens. The difference is that I can run that review at every step, without waiting for someone else to become available.
"You'd have caught that in review anyway"
Maybe, but I doubt it. I wrote the code, and I’d bring the same blind spot I had while writing it to reviewing it an hour later. Being the author is exactly what stops you seeing it. The critic approaches the code without the assumptions I made while writing it, giving it a chance to spot things I've overlooked.
When it's not worth it
Most changes don’t need a team. If I’m renaming a property, nudging some SwiftUI padding or changing button copy, I just do it. It’s unlikely you’ll need four agents debating “Retry” versus “Try Again”.
The adversarial pass earns its place when a mistake is expensive or hard to see, and on tvOS that list is longer than you'd expect. The focus engine decides where the remote takes you next, and getting it subtly wrong strands someone on a screen they can't leave. Player state has to survive backgrounding, dropped networks and channels going offline mid-stream. Plenty of it runs across actor boundaries, so the bug waits for unlucky timing to show up.
So I save it for shipping-path logic, anything involving concurrency, and refactors that touch a dozen call sites. The more a mistake could break, the bigger the team.
The honest limit
The critic and the engineer are the same model, so they share blind spots. Some mistakes won’t surface however fresh the context or adversarial the prompt, because both agents get them wrong in the same way. A critic improves the odds, but it doesn’t remove the risk. I still read the final diff myself, and on the paths that really matter I don’t hand that off. The cost is an extra pass or two of compute. Weighed against a regression reaching production, that’s an easy call.
Agents can clearly write the code. The real question is whether you can trust what comes back, and on KICK’s Apple apps that’s the standard we work to. A better engineer agent won’t get you there on its own, but adding something whose job is to disagree goes a long way.