# code-review: audit ↔ fix group loop.
# auditor gates (finds P0-P3), developer fixes, auditor re-verifies until APPROVED or max_rounds.
name: code-review
description: Audit ↔ fix loop (auditor gates, developer fixes, re-verify)
input: prompt
agents:
  auditor:
    tools: [read, grep, find, ls]
    model: sonnet
    thinking: high
    isolated: true
    schema:
      verdict: APPROVED|REVISE
      findings: array
  developer:
    tools: [read, grep, find, ls, write, bash]
    model: sonnet
    thinking: medium
groups:
  review:
    phases: [review, fix]
phases:
  - id: review
    agent: auditor
    prompt: "Audit the diff for correctness, security, performance, and clarity. Return findings P0-P3 + verdict."
  - id: fix
    agent: developer
    prompt: "Fix the audit findings using TDD."
loops:
  review:
    until: approved
    fail_on: [P0, P1, P2]
    max_rounds: 5
    protocol: canonical-delta
