---
name: build-review
description: Review a drafted Introspection agent (Recipe) with fresh-context reviewers, fix what they find, and package it as a pull request the owner can review. Use when the approved cases have run as local tasks on the current Recipe.
metadata:
  min-cli-version: "0.73.0"
  next: "deploy-connect"
---

# Build: review

Check the draft as someone who wasn't in the conversation would, fix what they find, and hand the owner a pull request they can review without having followed the work.

## Before you start

- **Check the stage.** No approved cases in `evals/cases/` means `build-brainstorm`. Every approved case needs a run of the current Recipe: a `code` case a local task's folder under `runs/`, a `person` case a run folder under `runs/` with its transcript approved. A `later` case, or a `code` case with a Harbor task, needs no run here: it waits for deploy-test or improve. A case without one means `build-draft` isn't finished: go back and run it, as it says, before reviewing anything.
- **Check the branch.** `pr/<name>` has the cases (`evals/cases/`), the design (`docs/DESIGN.md`, Parts A and B) and the Recipe, and build-draft's last commit records the case results. If any is missing, go back to the step that makes it.
- **Tools:** the `introspection` CLI (`npm i -g @introspection-ai/cli`). No login unless the repository is the Introspection hosted one.

## 1. Check the state

Use build-draft's last runs when nothing in the Recipe has changed since (`git status` and the commits since say so); never run an unchanged commit again. Otherwise run `introspection check` and each case's local task once yourself, as build-draft's smoke tests say, and use their results.

## 2. Review with fresh context

build-draft starts this review, without waiting, in the same turn as its smoke tests; when it has, wait for those reviewers' replies rather than starting others. Run the review in `reviewer` subagents, each briefed as [agents/reviewer-brief.md](../../agents/reviewer-brief.md) says: the repository checked out at the commit under review, in a worktree of its own outside the repository (`git worktree add <scratch folder>/review-<short sha> <commit>`) so fixes made meanwhile don't move it, its questions and the reply format. [The review questions](references/review-questions.md) fill the brief and cover the design against the cases, the Recipe against the design, what a stranger would misread, the situations no case covers, and, when Part B names an original, what it does that the Recipe doesn't.

- **Size the review to the Recipe.** For a small one (a few cases, no tools, no documents, no connections), one `reviewer` with all the questions. Otherwise one `reviewer` per question, all started in the same turn.
- **The original gets its own reviewer,** with the copy's path. A reviewer reads nothing outside the repository, except the copy of the original in `files/` that Part B names.
- **"Reviewers unavailable" is never a reason to skip review.**

## 3. Fix what blocks

Fix what blocks, and run the affected cases again. Record what wasn't fixed and why. Don't change an approved case yourself.

- **A gap against the original, or a situation no case covers, is the owner's decision, not a fix:** ask in the pull request's summary, about each one by name, whether it should become a case.
- **A finding that needs the owner's decision** (a case that seems wrong, a default they should see) goes in the pull request's summary as a question.

## 4. Check nothing private is committed

No client documents (case inputs are referenced by hash), no credentials, no tokens. The branch is local until deploy, so remove anything found with a new commit:

```sh
git rm <file>
```

Squash this build's own commits only if a pushed branch would still carry it. Never delete `.git` or start the history again, and say in the pull request what you removed. Public material the owner pointed you to (a job posting, a public guide) isn't private: keep only the part the agent needs.

## 5. Package the pull request

Write `docs/PULL_REQUEST.md` with [the description template](references/pr-description.md), open it for the owner with `show_artifact`, and commit it on `pr/<name>`. Don't push or ask where the Recipe should live: the branch stays local until deploy, which asks that with its other questions and opens the pull request there.

## Guardrails

- **Bounded:** at most the four review questions, each pass with a time limit (about five minutes), and at most two rounds of fix-then-re-review. Anything still open after that goes into the pull request description as an open item, not another loop.
- **One run per change.** After a fix, re-run `introspection check` and the affected cases once. Review isn't a second draft: don't tune the agent's instructions against one output and run it again, since that fits the agent to a single run. If a case still fails, record it in Part B and the pull request as an open item.
- **Reviewers only report.** Findings come back as text; only this step edits the repository, so one reviewer can't undo another's work.
- **No real data, credentials or pushes during review.** Reviewers read the repository; they don't run the agent against real connections or push anything.
- **Never widen access to finish a review.** If a pass can't reach something (a permission prompt, a missing tool), record that and continue; never ask the owner for broader access or use paths outside the repository.
- **The repository holds only what the Recipe needs.** Working files a run left behind (scratch scripts, test outputs, copies of inputs) are a blocking finding: remove them, and keep run outputs under a gitignored folder, since anything in the package ships with the agent.

## Done when

- No working files are left in the repository outside what the Recipe needs.
- `introspection check` passes, and every case passes on its last local task or has a written reason in Part B.
- No reviewer finding is left blocking.
- The pull request exists (or the hosted branch is pushed) with a description a business owner can read.
- Then, when deploy already ran beside it, hand over the chat link; otherwise go to `deploy-connect` straight away: deploy connects what the Recipe needs, asks where it lives, lands it there, creates its runtime and gives the owner its chat.
