Back/Claude
AdvancedClaude

Build iOS Apps with a Dueling AI Agent Workflow

Use a 'dueling agent' system with two AI personas, a builder and a reviewer, to write and review code. This workflow mimics a real-world engineering team to improve code quality, security, and architectural soundness.

From How I AI

How I AI: Daniel Roth’s Dueling Agent Workflow for Building iOS Apps

with Claire Vo

Build iOS Apps with a Dueling AI Agent Workflow

Tools Used

Claude

Anthropic AI assistant

02Step-by-Step Guide
1

Create Your AI Engineering Team

In separate Claude Code chat windows, set up two AI personas. 'Bob the Builder' is a lean builder who plans first. 'Ray the Reviewer' is a senior engineer focused on security and quality who must approve Bob's work.

Prompt:
For Bob: 'Bob is a 'lean builder' who plans first, builds in modules, documents everything, and MUST run everything by Ray, the review agent.' For Ray: 'Ray is a 'senior software engineer' focused on security and quality. He reviews Bob's plans and code, and is explicitly told to push back and say 'no' when necessary.'
Pro Tip: Keep the two chats open side-by-side in your terminal to easily manage the handoff between them.
2

Assign a Task to Bob the Builder

Give Bob a clear task, such as implementing a new feature. Provide any necessary context, like a planning document, by using the '@' symbol to reference the file in your prompt.

3

Initiate Code Review with Ray

Once Bob generates his implementation plan, copy the entire plan and paste it into the chat with Ray the Reviewer for analysis and feedback.

Pro Tip: This manual copy-paste step is crucial. It forces you to read the plan and the feedback, helping you learn and catch potential issues yourself.
4

Get Approval and Start Building

After Ray reviews the plan and provides feedback (e.g., pointing out edge cases or security risks), copy Ray's feedback back to Bob and give him the green light to start writing the code.

5

Integrate and Test in Xcode

Copy the code generated by Bob and paste it into Xcode. Use Xcode's tools to clean the build (command+shift+K), build the app (Control+B), and run it in the simulator for testing.

Pro Tip: Always work in separate branches for new features to avoid merge conflicts with your main codebase.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready