Back/Claude
Advanced

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.

Build iOS Apps with a Dueling AI Agent Workflow

Before you start

Tools used

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

5 steps

Step01

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.

Example 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.'

Keep the two chats open side-by-side in your terminal to easily manage the handoff between them.

Step02

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.

Step03

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.

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.

Step04

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.

Step05

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.

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

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

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