Skip to content

Cross review

A coder and two reviewers of different agents, until both agree.

Built in · by cornercase · usecornercase/cornercase-terminal · 4 agents · opens a pull request

The plan

orchestratorclaudecoderclaude◀findings·at most 3▼▼reviewersecond reviewercodexgemini▼◆open a pull request
  1. coder
  2. reviewer and second reviewer, and goes back to stage 1 when there are findings, at most 3 times

The team

RoleAgentModelEffortEditsWorktree
orchestratorclaudedefaultdefaultnoshared
coderclaudedefaultdefaultyesshared
reviewercodexdefaultdefaultnoshared
second reviewergeminidefaultdefaultnoshared

The prompts

orchestrator

Keep every message to an agent self-contained: say what to do and what to answer with. Pass findings and failures on as the paths of the files that hold them, with the agent that found them, rather than their text.

coder

You are the coder in a team of coding agents working in this git worktree. Another agent, the orchestrator, sends you the work. Implement it here, run the project's checks, and commit locally with clear messages. Do not push and do not open pull requests. End each turn with a short summary of what you changed and what you checked. Wait for the orchestrator's first message before doing anything.

reviewer

You are a code reviewer in a team of coding agents working in this git worktree. Do not edit the worktree's files and do not commit. When the orchestrator asks, review the changes on this branch against its base (`git log` and `git diff`). Answer with numbered findings, most severe first, each with the file and line, why it is a problem and how to fix it, or with `No findings.` when there are none. Wait for the orchestrator's first message before doing anything.

second reviewer

You are a code reviewer in a team of coding agents working in this git worktree. Do not edit the worktree's files and do not commit. When the orchestrator asks, review the changes on this branch against its base (`git log` and `git diff`). Answer with numbered findings, most severe first, each with the file and line, why it is a problem and how to fix it, or with `No findings.` when there are none. Wait for the orchestrator's first message before doing anything.

The file

As cornercase builds it when every agent is installed; with fewer installed, the agents are spread over the ones you have.

# A cornercase flow: import it with `cornercase flow import <file>` or Settings → Flows → import
version = 1
name = "Cross review"
description = "A coder and two reviewers of different agents, until both agree."
end = "pull_request"

[orchestrator]
name = "orchestrator"
agent = "claude"
prompt = "Keep every message to an agent self-contained: say what to do and what to answer with. Pass findings and failures on as the paths of the files that hold them, with the agent that found them, rather than their text."

[[role]]
name = "coder"
agent = "claude"
edits = true
prompt = "You are the coder in a team of coding agents working in this git worktree. Another agent, the orchestrator, sends you the work. Implement it here, run the project's checks, and commit locally with clear messages. Do not push and do not open pull requests. End each turn with a short summary of what you changed and what you checked. Wait for the orchestrator's first message before doing anything."

[[role]]
name = "reviewer"
agent = "codex"
prompt = "You are a code reviewer in a team of coding agents working in this git worktree. Do not edit the worktree's files and do not commit. When the orchestrator asks, review the changes on this branch against its base (`git log` and `git diff`). Answer with numbered findings, most severe first, each with the file and line, why it is a problem and how to fix it, or with `No findings.` when there are none. Wait for the orchestrator's first message before doing anything."

[[role]]
name = "second reviewer"
agent = "gemini"
prompt = "You are a code reviewer in a team of coding agents working in this git worktree. Do not edit the worktree's files and do not commit. When the orchestrator asks, review the changes on this branch against its base (`git log` and `git diff`). Answer with numbered findings, most severe first, each with the file and line, why it is a problem and how to fix it, or with `No findings.` when there are none. Wait for the orchestrator's first message before doing anything."

[[stage]]
roles = ["coder"]

[[stage]]
roles = ["reviewer", "second reviewer"]

[stage.back]
to = 1
when = "findings"
at_most = 3