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.
Review pull requests with repo context
An assistant reads the diff, related files and your team's guidelines, then leaves review notes.
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.Write the guidelines
2.Try it by hand
3.Connect the code host
4.Keep humans approving
- 1
Write the guidelines
Put your team's review rules in one document. Keep them specific, such as how errors must be logged.
- 2
Try it by hand
Run the prompt on ten merged pull requests and compare its notes with what reviewers actually caught.
- 3
Connect the code host
Let the assistant fetch the diff and related files, and post comments marked as automated suggestions.
- 4
Keep humans approving
A person still approves every merge. Remove rules that only produce noise.
What you end up with
Faster reviews with consistent first-pass notes, and people focused on design questions.
Related use cases
Understand an unfamiliar codebase faster
Get a plain explanation of a module, its data flow and the risky parts before you change it.
Generate and verify tests with agents
One agent writes tests for changed code, another runs them and a third checks they are meaningful.
Answer staff questions from hospital SOPs
An assistant that answers from your own SOPs and policies, and shows the section it used.