Edison SinaniAI implementation architectBook a call

AI Team Playbook / Rule 8 of 12

AI review first, and filtered

Every pull request gets an automated review before a human looks at it, and the reviewer is told what not to report.

Contents

The playbook

  1. Overview

Before code

  1. 1Write the constitution first
  2. 2One instruction file, under 200 lines
  3. 3Prose is advice, hooks are enforcement
  4. 4Three gates before any code
  5. 5A walkable demo before any screen

Building

  1. 6One task, one worktree, one pull request
  2. 7Every contract has a file and two tests

Reviewing

  1. 8AI review first, and filtered
  2. 9Human review by risk tier
  3. 10Done means the evidence is in the pull request

Over time

  1. 11Measure five numbers from day one
  2. 12Protect the people who are still learning

Appendix

  1. AInstall checklist
  2. BOther tools, limits and sources
  3. CTightening the process
  4. DRun the agent with no entitlements

Get the kit

Who owns it
The lead sets it up and tunes it. The author of each pull request answers every Important finding.
In the kit
.github/workflows/ai-review.yml.claude/agents/reviewer.md.claude/skills/review/
Enforced by
The workflow runs on every non-draft pull request. The definition of done requires every Important finding to be fixed or answered.

Why

An unfiltered automated reviewer makes things worse. In one industrial study, the average time to close a pull request rose from five hours and 52 minutes to eight hours and 20 minutes after an LLM-based reviewer was introduced, even though developers resolved 73.8 percent of its comments [10]. HubSpot added a second “judge” agent whose only job is to filter the first reviewer’s comments for succinctness, accuracy and actionability before anything is posted, and calls it the single most important factor in the reviewer’s effectiveness [9].

Filtered, it works. Uber’s reviewer covers more than 90 percent of the roughly 65,000 changes landed each week, and engineers rate 75 percent of its comments useful, because the team built filtering, validation and deduplication stages behind it [8]. The first pass absorbs the volume that rule 6 creates, so the human queue stays flat.

How

The workflow runs Claude Code as a GitHub Action on every non-draft pull request. The prompt is the filter. It reads the instruction file, the constitution, the review policy and the spec the pull request names, then reports only these:

1. Important: the change does not do what the PR's Verification
   section claims, or the evidence is missing.
2. Important: a cited requirement has no test that would fail
   without this change.
3. Important: a contract changed without both guard tests changing.
4. Important: anything named after a test case or a fixture value.
5. Important: a constitution non-negotiable is broken, or a
   deliberate deviation in the design is "fixed".
6. Important: secrets, unhandled null paths, swallowed exceptions,
   a schema change without a migration.
7. Nit: at most three, only where the fix is one line.

Do not comment on style the linter covers. Do not summarize the diff.

Four rules keep it trusted. Start with Important findings only and at most three small ones. Watch the time to close a pull request, and if it rises, the reviewer is too chatty, not the developers too slow. The author answers every Important finding with a fix or a one-line reason, and the dismissed ones are the data for tuning. Tune it in the repository: Anthropic’s managed review reads a REVIEW.md, Cursor’s Bugbot reads .cursor/BUGBOT.md, Codex reads a section of AGENTS.md.

The writer and the reviewer are different sessions. When one agent both writes and reviews code in the same session, it grades its own homework. The kit’s reviewer agent runs before the pull request is opened, with fresh context and read-only access. It checks the same list as the workflow, plus whether files outside the task’s Touches list were changed and whether the documents the change made wrong were updated. Findings are tagged Important or Nit, with no praise and no summary of the diff.

References

  1. 8Uber Engineering, "uReview: Scalable, Trustworthy GenAI for Code Review at Uber", 2025. www.uber.com/blog/ureview/
  2. 9HubSpot Engineering, "Automated Code Review: The 6-Month Evolution", 2026. product.hubspot.com/blog/automated-code-review-the-6-month-evolution
  3. 10Umut Cihan et al., "Automated Code Review In Practice", ICSE 2025, Software Engineering in Practice track. arXiv 2412.18531. arxiv.org/abs/2412.18531