Skip to content

Review pull requests with repo context

An assistant reads the diff, related files and your team's guidelines, then leaves review notes.

Recommended: InnovatorAutomationDocuments

Best for

  • Teams with a review backlog
  • Leads enforcing coding guidelines
  • Projects with many first-time contributors

What you need

  • Your code host with API access
  • Written team coding guidelines
  • A test suite that runs on each pull request

Starter prompt

Copy it, fill in the parts in square brackets, and paste it into the AI assistant your organisation allows.

You are a code reviewer for [repository]. Review the diff below using our guidelines: [paste guidelines]. Also read the related files provided. Comment only on: possible bugs, missing error handling, security risks, missing tests and clear guideline breaks. For each comment, give the file, line, the problem and a suggested fix. Do not comment on style that our linter already checks. If the diff looks correct, say so briefly. Diff: [paste diff]. Related files: [paste files].

How to use it

  1. 1.Write the guidelines

  2. 2.Try it by hand

  3. 3.Connect the code host

  4. 4.Keep humans approving

  1. 1

    Write the guidelines

    Put your team's review rules in one document. Keep them specific, such as how errors must be logged.

  2. 2

    Try it by hand

    Run the prompt on ten merged pull requests and compare its notes with what reviewers actually caught.

  3. 3

    Connect the code host

    Let the assistant fetch the diff and related files, and post comments marked as automated suggestions.

  4. 4

    Keep humans approving

    A person still approves every merge. Remove rules that only produce noise.

Watch out. The assistant can miss real bugs and flag false ones. Treat its notes as a first pass, and keep human approval required for every merge.

What you end up with

Faster reviews with consistent first-pass notes, and people focused on design questions.

Read why AI matters in software engineering

Related use cases