A shepherd for your agent PRs: review profiles on GitHub, step by step
Open-source tool review-shepherd moves GitHub agent PRs from draft to merge using AI classifiers, test suites, and 12-month commit-based approvals.
By Dillip Chowdary • Dec 03, 2026 • Source: renatobudinich.com

At a glance
- Product
- review-shepherd
- License
- Open source
- Bot account
- review-shepherd[bot]
- AI review tools
- CodeRabbit or chief
- Blocking round limit
- 3 consecutive rounds
- Commit history window
- 12 months
In this post
An open-source tool called review-shepherd automates GitHub pull requests from draft to merge, bringing in human reviewers only when a bug would be expensive, according to renatobudinich.com's report. Instead of routing every coding-agent pull request to an engineer, the program sorts changes into review profiles based on modified paths and AI-answered questions. The quickest setup is to point a coding agent at the companion review-shepherd repository, which includes agent instructions.
This article walks through the stage-by-stage lifecycle, the repository files and GitHub App configuration required, the YAML syntax for matching profiles, and the commit-history rules that govern approvals. It is written for engineering teams and repository maintainers who want to review coding-agent pull requests on GitHub without stalling human reviewers on low-risk changes.
01Stage-by-stage draft to merge flow
Every pull request begins as a draft so human reviewers can safely ignore unfinished work. The shepherd matches the pull request to applicable profiles using its changed files and an AI classifier's yes-or-no answers. Continuous integration then runs the test suites specified by every matched profile, while an AI review tool such as CodeRabbit or chief checks for issues that should block the merge.
Teams can run the AI review in parallel with the test suite to save time. If the AI review raises a blocking finding, the pull request remains a draft until the author resolves it, with a limit of three consecutive rounds. Once both the tests and the AI review pass, the shepherd promotes the pull request out of draft status.
If a matched profile requires human sign-off, a developer who knows the affected code reviews the change, and any requested changes send the pull request back to draft. Profiles can also require a QA tester to try the change and approve it. When all requirements are satisfied, the shepherd's status check turns green and the pull request can merge.
02Repository files and GitHub App setup
Setting up the shepherd requires adding a handful of files under the repository's .github directory and configuring two settings on GitHub. Maintainers write their own rules in .github/review-profiles.yml, while copying the shepherd's code into .github/review-shepherd/ and adding .github/pull_request_template.md for agent drafts. Two GitHub Actions workflows, review-check.yml and review-decide.yml, handle profile matching, test execution, labeling, draft transitions, and final check posting, alongside .coderabbit.yaml if CodeRabbit is used.
On GitHub, the shepherd acts through a dedicated GitHub App bot account named review-shepherd[bot]. Maintainers also configure a branch ruleset that blocks merging until the review-shepherd/decision check is green and accepts that check only from the bot account. Because GitHub cannot count approvals per profile natively, the shepherd tracks all profile requirements internally and prevents a pull request from loosening its own rules by reading configuration from main.
03Path and classifier review profile rules
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
Each entry in .github/review-profiles.yml defines a match section and a require section, and a pull request inherits the combined requirements and labels of every profile it matches. Under match, any_file_in triggers when at least one changed file falls under listed paths, while every_file_in triggers only when all changed files match. For conditions that file paths cannot capture, ask_classifier poses single-topic yes-or-no questions such as "Does this change who can move funds?" in one AI call, where a yes adds the profile.
Profiles can also include three optional prose fields—description, bug_cost, and blocks_merge—which serve as context for the AI review and classifier rather than matching conditions. Under require, teams specify test suites via checks, toggle ai_review, and set GitHub organization team approvals. Below is the four-profile example for a blockchain company, where every profile except docs receives an AI review.
| Profile | Matches a PR when | Tests | Who approves |
|---|---|---|---|
| critical | Contracts, consensus, signing, migrations, CI config, or classifier flags fund movement or signing | Unit, invariant, fuzz; mutation on the diff | 2 from protocol; if author is new, both must know the code |
| user-facing | Web app or wallet UI, or classifier flags user-visible or signing changes | Unit, end-to-end | 1 engineer, 1 from qa |
| standard | Nothing above | Unit, types, linters | Nobody; if author is new, 1 who knows the code |
| docs | Only docs and Markdown files | Link check | Nobody; no AI review |
04Author history and Microsoft study safeguards
To decide when extra scrutiny is warranted, profiles can check whether the pull request author or potential reviewers have committed to the changed files' folders within the last 12 months. Setting knows_the_code to true restricts eligible team approvers to people with a recent commit in those folders, falling back to any team member if nobody qualifies. An if_author_is_new block adds extra approval rules whenever the author lacks a commit in the changed folders over that 12-month window.
This design follows a Microsoft study by Bird et al. (FSE 2011), which found more failures in components with more minor contributors and recommended that "changes made by minor contributors should be reviewed with more scrutiny." In the blockchain example's critical profile, .github/ and .coderabbit.yaml are included in any_file_in alongside contracts/, consensus/, signer/, and db/migrations/. That ensures any change to the shepherd's own rules or CodeRabbit settings requires two approvals from the protocol team, plus an approval with knows_the_code enabled when the author is new.
05GitHub App permissions and branch rulesets
The review-shepherd[bot] GitHub App needs read and write permissions on Pull requests, Issues, Commit statuses, and Contents so it can apply labels, promote drafts, request reviewers, and post its decision check. It also requires read permission on organization Members to query GitHub team rosters through the API. Maintainers install the App on the target repository only and store its private key inside a GitHub environment restricted to the main branch.
On every push, the two workflows ensure the pull request starts as a draft, evaluate matching profiles, and keep human reviewers out of the loop until tests and AI checks clear. If a human reviewer requests changes after promotion, the workflows demote the pull request back to draft and restart the cycle.
Note: On a private repository, GitHub environments and branch rulesets require a paid plan, and team approvals require a GitHub organization.
Frequently asked questions
How does review-shepherd prevent a pull request from weakening its own review rules?
The shepherd reads its profile configuration from the main branch and stores the GitHub App's private key in an environment restricted to main. A GitHub branch ruleset also requires the review-shepherd/decision check to come exclusively from review-shepherd[bot].
What happens if a pull request fails the AI review or a human requests changes?
If CodeRabbit or chief flags a blocking finding, the pull request stays in draft status until fixed, up to three rounds in a row. If a human reviewer requests changes after promotion, the shepherd demotes the pull request back to draft and restarts the cycle.
How does the 12-month commit history rule work for new authors?
When an author has no commit in the changed files' folders over the last 12 months, the if_author_is_new block can add extra approval rules. Setting knows_the_code to true limits approvals to team members who have committed to those folders in the past 12 months.
What GitHub plan features are needed for private repositories?
On a private repository, GitHub environments and branch rulesets require a paid plan. Team-based approvals also require a GitHub organization.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement