Code ReviewReadiness Guide

Readiness Guide: What the Agent Needs Besides a Token

A GitHub token and a repository are enough for Code Review to run. They are not enough for it to be useful. The agent has no memory of how your team works beyond what three sources tell it on every run:

  1. The diff and PR metadata (always available, nothing to configure).
  2. Whatever your repository’s own AGENTS.md / CONTRIBUTING.md says (free — read automatically if present).
  3. The review policy your team configures in Dashboard → Code Review → Review rules (the only part that requires someone to actually fill something in).

If (2) and (3) are both empty, the agent still reviews — generically, against no team-specific standard, with no sense of what you’ve already decided is fine. The findings won’t be wrong so much as untailored: it will flag things your team settled a year ago and miss things only someone who knows the codebase’s history would catch.

This guide is the checklist for (2) and (3), organized by who on the team actually holds each answer.

Minimum (works today)Recommended (useful today)
AccessRepo + GitHub tokenSame, plus a webhook secret (optional, but enables signature verification)
Review criteriaNone — defaults to all six reviewer domains, suggestion-level findings, no exclusionsWritten instructions, coding standards, tuned severity/exclusions (below)
Repository docsNoneAn up-to-date AGENTS.md or CONTRIBUTING.md in the repo root
OwnershipWhoever connected the repoA named owner who revisits the policy after the first 1–2 weeks of findings

Running with only the left column is a reasonable way to try it on a low-risk repo. Running it that way on a production or customer-facing repo and expecting signal instead of noise is not.

Who supplies what

Repository owner / admin — access only

This is the part most teams already get right:

  • A GitHub personal access token with repo scope.
  • A webhook pointed at https://api.bahulam.ai/api/github/webhook (setup steps below).
  • A webhook secret (recommended, not required), so deliveries are signature-verified instead of trusted on sight.
  • A decision on auto-review (on by default) and posting mode — a formal PR review, or a lighter-weight issue comment.

None of this tells the agent anything about the code. It only tells it when to run and how to speak when it’s done.

Setting up the webhook

  1. In the repository on GitHub, go to Settings → Webhooks → Add webhook.
  2. Set Payload URL to https://api.bahulam.ai/api/github/webhook.
  3. Leave Content type at GitHub’s default (application/x-www-form-urlencoded).
  4. Secret — recommended, but not required. If you set one, deliveries are signature-verified. If you leave it blank, signature verification is skipped and the endpoint can’t confirm a delivery really came from GitHub.
  5. Under “Which events would you like to trigger this webhook?”, choose Let me select individual events and tick these four, the minimum:
    • Pull requests
    • Pull request reviews
    • Pull request review comments
    • Pull request review threads
  6. Keep Active checked and click Add webhook.

GitHub delivers these events as they happen (a PR opened or updated, a review submitted, a comment added, and so on). Whether the agent acts on a given event is controlled by your Review rules, such as review_on_comments and review_on_reviews.

Engineering / team lead — day-to-day review criteria

This is the input with the highest return on the time it takes to write, and it’s usually the one skipped. In Review rules:

  • Instructions — plain-language priorities for this repository. Concrete and specific beats broad. Compare:

    Vague (little effect): “Review for code quality and best practices.”

    Concrete (changes what gets flagged): “This service owns billing writes — any new DB write outside billing/’s existing transaction helpers should be flagged as critical. We intentionally don’t unit-test the admin CLI in scripts/; don’t flag missing tests there. TODO comments are tracked in Jira, not here — don’t raise them as findings.”

  • Coding standards — naming, error-handling, logging, and library conventions specific to the repo (forbidden patterns, required helpers, “we use structlog, not print,” etc.). If this already lives in CONTRIBUTING.md, you don’t need to duplicate it here — the agent reads that file directly (see below) — but anything that file doesn’t say yet belongs in this field until it does.

  • Reviewer domains — which of the six matter for this repo. A pure frontend repo may not need security-reviewer on every PR; a repo touching auth, payments, or PII should never turn it off.

  • Excluded paths — generated code, vendored dependencies, lockfiles, migrations, fixtures. Every path the agent doesn’t need to read is a path that can’t produce a false positive.

  • Minimum severity and max findings — the noise dial. Start permissive for the first week, read what comes back, then tighten. A team that ignores the bot within a month almost always started too loud.

  • Review depth — contextual (fast, reads only directly relevant code) or deep (follows additional dependency links while a concrete risk is unresolved). Most repos want contextual; reserve deep for small, high-blast-radius repos where the cost of a slower review is worth it.

Architect — structural context

Architects usually aren’t filling in the same form the team lead is; their contribution is making sure the right documents exist for the agent to consult, since a free-text field can’t hold an architecture doc and the agent treats long context as a reference, not something to read in full on every run:

  • Context files — a short, curated list of paths (architecture overviews, ADRs, API/data-model contracts) the agent should consult when a change touches that area — not a dump of the whole /docs folder. Unused context that’s never relevant to a given diff just adds noise to what the agent might read; a long, unfocused list is worse than a short, accurate one.
  • The canonical pattern for comparison. consistency-reviewer checks a changed integration against a concrete peer — it needs to be findable (named in instructions or context files), not just “the codebase in general.”
  • A documentation coverage target, if the repo is a library or has a public API surface — the percentage of new/modified functions expected to carry documentation. Leave this unset for application code where it isn’t a meaningful signal.

Engineering manager / director — policy and risk tolerance

The inputs here aren’t fields so much as decisions that should get made once, explicitly, rather than drift in by accident:

  • What “critical” means for this org. Security impact? Data loss? Compliance exposure (SOC2, PCI, HIPAA)? The severity label the agent attaches is only as meaningful as a shared definition behind it — write that definition down somewhere the leads configuring minimum_severity can see it.
  • Compliance-sensitive repos get the strictest defaults, not the most exclusions. It’s tempting to exclude noisy paths from a regulated repo to quiet the bot down; don’t exclude anything that touches auth, payments, or regulated data just to reduce findings count — exclude the genuinely irrelevant paths (generated code, fixtures) instead.
  • Whether discussion participation is worth the cost. The webhook always delivers comment and review events; review_on_comments / review_on_reviews decide whether they trigger a run, making the agent responsive in PR conversations at the cost of a run per discussion event. Decide this per repo, not globally.
  • Who owns tuning. The first two weeks of findings on a newly connected repo should have a named reader, not just a bot posting into silence. If nobody is accountable for adjusting instructions/severity after seeing real output, the policy never improves past its defaults.

None of the above requires engineering effort beyond writing text into a form and keeping two repository files current. The return is specific to each repository’s actual risks, instead of generic advice every AI reviewer gives by default.

Don’t forget AGENTS.md / CONTRIBUTING.md

The agent is explicitly instructed to consult your repository’s own AGENTS.md or CONTRIBUTING.md for convention and architecture questions, in addition to whatever you configure in Review rules. This is the cheapest lever on this entire page:

  • If one of these files already exists and is current, Code Review benefits from it immediately — no settings change needed.
  • If it’s stale (describes a pattern the team no longer follows, references a removed module), the agent will cite stale guidance as if it were current. A stale CONTRIBUTING.md is worse than none — review it before relying on it, not after noticing the bot quoting it.
  • If it doesn’t exist, writing one benefits every human contributor too, not only the agent. This is usually a better first move than writing a long Instructions field from scratch.

Pre-launch checklist

Before turning on auto-review for a team (not just a personal test repo):

  • Token with repo scope, saved under the correct repository.
  • Webhook configured and subscribed to the four minimum events (Pull requests, Pull request reviews, Pull request review comments, Pull request review threads). A secret is recommended, not required.
  • AGENTS.md / CONTRIBUTING.md exists and reflects current practice — or an explicit decision that it doesn’t yet and Instructions/Coding standards will carry that weight instead.
  • Instructions written by whoever leads the team, naming at least the things you’ve already decided not to flag (the fastest way to kill trust in the tool is a finding about something the team settled months ago).
  • Reviewer domains chosen deliberately, not left at the default six if some genuinely don’t apply.
  • Excluded paths cover generated code, vendored dependencies, and lockfiles at minimum.
  • Minimum severity and max findings set, with an owner who will revisit them after the first real week of output.
  • For regulated/high-risk repos: an explicit, written definition of what “critical” means, agreed above the team-lead level.
  • A named owner for the first two weeks of findings — someone whose job is to tune the policy, not just read the comments.