37.3 Planning, executing, and critiquing roles

Overview and links for this section of the guide.

Separation of Concerns

Do not ask the same model to write code and check it in the same turn. It has "completion bias"—it tends to think its own output is correct.

Pattern: 1. **Planner:** "Here is the roadmap." 2. **Executor:** "I wrote the code." 3. **Critic:** "I found a bug in line 5. Fix it."

The Critic

The Critic prompt should be mean. "You are a harsh code reviewer. Find security flaws. If none, say 'PASS'."

This adversarial dynamic improves quality significantly.

Where to go next