Skip to main content

Claude Prompt to Build an AI Code Review Bot for PRs

Build a GitHub bot that auto-reviews pull requests: inline comments, severity levels, custom repo rules, incremental review, and stats.

Füllen Sie die Platzhalter aus

Edit the values, then copy your finished prompt.

Ihr Prompt
prompt.txt

                                

What this prompt does

This prompt builds a GitHub pull-request review bot on [model_provider] that automatically reviews code changes. It triggers on PR open and push events, fetches the diff and changed-file context, and runs a review prompt checking for [review_criteria]. Comments land inline on specific lines with a severity tag — critical, warning, suggestion, or nitpick.

The structure works because an AI reviewer is only useful if the team does not mute it. Incremental review (only re-reviewing new changes on later pushes), respecting a .codereviewignore file, and loading custom rules from [config_file] keep the noise down. Token-budget management batches large PRs and skips generated files, while the false-positive tracking in the stats dashboard is what keeps the reviewer accurate over time instead of annoying after a week.

The summary comment ties the review together. Alongside inline notes, the bot posts an overall assessment with an approve or request-changes recommendation, so a reviewer can read the headline before diving into individual lines. Severity tagging across [review_criteria] means genuine bugs and security issues stand out from style nitpicks, which is exactly the signal-to-noise balance that determines whether developers act on the bot's feedback or scroll past it.

When to use it

  • You want an automated first pass on every PR before human reviewers spend time.
  • You need inline, line-level comments with severity rather than one vague summary.
  • You want custom per-repo rules loaded from [config_file] so the reviewer matches your standards.
  • You need incremental review so re-pushes do not re-flag the same lines.
  • You want to exclude generated or vendored paths from review.
  • You want stats on issues found and false-positive rate to tune the reviewer.

Example output

Expect a deployable review bot as a [deployment_type]: webhook or Action trigger logic, diff-fetching code, a tuned review prompt covering [review_criteria], inline comment posting with severity levels, a summary comment with an approve or request-changes recommendation, [config_file] parsing, and a stats dashboard. It usually includes the prompt-engineering notes for accurate, non-annoying reviews.

Pro tips

  • Scope [review_criteria] to what matters most for your team; reviewing everything at once produces noisy, low-signal comments.
  • Lean on incremental review so contributors are not re-pinged about lines they already saw on the previous push.
  • Use [config_file] to encode repo-specific rules — naming conventions, banned patterns — so the bot reflects your standards, not generic defaults.
  • Keep generated and vendored files out via .codereviewignore; reviewing them wastes tokens and floods the PR.
  • Track false-positive rate from day one. A reviewer that cries wolf gets muted, and then it reviews nothing.
  • Tune severity thresholds so nitpicks stay low-priority and criticals are genuinely worth blocking on.
  • Lean on the summary comment to give a clear approve or request-changes signal, so reviewers get the headline at a glance.
  • Batch large diffs within the token budget so big PRs still get reviewed instead of silently skipped.

Frequently Asked Questions

Will the bot spam every PR with comments?
It is designed specifically to avoid that. Severity levels keep nitpicks low-priority, incremental review stops re-flagging unchanged lines, and the false-positive dashboard lets you tune accuracy. A noisy reviewer gets muted, so keeping signal high is the explicit goal.
Can I customize the rules per repository?
Yes. Custom rules load from `[config_file]` in the repo root, so each repository can enforce its own conventions on top of the shared `[review_criteria]`. This lets one bot serve repos with different standards without hardcoding rules into the bot itself.
How does it handle very large pull requests?
Token-budget management batches large PRs and skips generated files so the review stays within model limits and stays affordable. Incremental review also helps, since subsequent pushes only review new changes rather than re-reading the entire diff each time.
Does it need a server to run?
Not necessarily. The default `[deployment_type]` is a self-contained GitHub Action, which runs in CI with no separate server to maintain. You can also deploy it as a webhook service if you prefer, but the Action keeps infrastructure minimal.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

Mehr in AI Chatbot & Agent Building Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support