Coding agents have made implementation faster, so pull requests arrive more often and sometimes span hundreds or thousands of changed lines. Faster implementation does not remove the work of checking a change’s purpose, evaluating the approach, and tracing its effects through the rest of the system. When that work takes longer than producing the next change, pull requests begin to queue and review becomes the bottleneck.
Much of the reasoning the reviewers need stays in the coding session, including the original request, approaches the agent abandoned, and decisions the author made along the way. When that context does not reach the pull request, reviewers have to use the diff and ticket alone to understand why the change was made.
Before reviewers spend time on those judgments, our workflow runs automated checks and puts the missing context in the pull request. The plan, decisions, and test evidence travel with the code, so reviewers can focus on behavior and risk with a clear understanding of how the change came together.
Our examples use GitHub Actions to run automated workflows for a Node.js application. The linked source files cover only parts of the workflow, so you will need to adapt and extend them for your own stack and review policy.
The workflow at a glance
This is how a change moves from the initial request to a merged pull request, and how the team uses its review record afterward.
- Plan and review locally: The engineer and coding agent turn the request into a plan and implement it. Before opening a pull request, the agent checks formatting, builds the application, runs tests, and works through any issues raised by a separate AI reviewer.
- Open a pull request with full context: Once the work is committed and pushed, the
/prskill turns the plan, test results, and decisions into a description of the change. The engineer confirms it before the skill opens a draft pull request. - Repeat the checks in continuous integration (CI): GitHub Actions first checks the pull request description. Once that passes, it reruns the project’s checks on the pushed code and adds scans for exposed secrets and security issues.
- Classify risk and set review depth: After the CI checks pass, the workflow looks at which files changed, how much code changed, and how much the engineer has worked in those areas. It assigns a low, medium, or high risk tier that sets the AI review depth and whether someone must approve the pull request.
- Review in CI and resolve every finding: An AI reviewer checks the pushed change using the depth set by its risk tier and reports any problems it can verify. The engineer decides which findings to fix and which to reject with a reason, then updates the pull request for another review.
- Human review and merge: Once automated checks and AI review pass, the engineer marks the draft pull request ready. A human reviewer joins when the risk tier requires approval or someone has requested review, and the pull request can merge after required approvals are given and review conversations are resolved.
- Measure and adjust: After merge, the team records which AI findings were useful or incorrect and any later incidents connected to the change. A monthly report helps them decide which review rules or checks to improve.
1. Plan and review locally
The engineer responsible for the change is the author, whether they write the code or direct a coding agent. Before implementation begins, the author usually starts the grill skill, a file of instructions in the repository that guides the agent through planning.
Planning requires a ticket describing the requested change, which the skill finds in the conversation, branch name, or an existing pull request. If it cannot identify or read the ticket, it asks the author for the missing information. It reads the ticket and AGENTS.md, the repository guide for commands and conventions, then asks one question at a time about scope, edge cases, and assumptions. The answers settle what the change must do, what is out of scope, and how it should behave at the edges.
Once the author has answered the planning questions, the skill writes the agreed acceptance criteria (the conditions for success) and implementation steps to .review/plan.md, a local file excluded from Git. Our version adapts Matt Pocock’s grilling skill by asking questions individually and recording the answers in a written plan.
Run checks and AI review locally
After implementation, the author invokes the self-review skill in the coding session. The coding agent first records what the author asked for, what it tried, the choices it made, and what remains uncertain in .review/session.md. It then uses AGENTS.md to find which project command to run. In our Node.js example, the check script in the package.json excerpt runs Prettier, ESLint, TypeScript type checking, the production build, and tests. The agent fixes any failures before the AI review begins.
Once the checks pass, the coding agent runs the review wrapper, a script that starts a separate AI reviewer with the plan, the session notes, and any decisions recorded during earlier review runs. The AI reviewer follows the review skill. Before the coding agent works through the findings, the wrapper checks that the review finished and returned the required summary, an assessment of each acceptance criterion, and a findings list. The AI reviewer runs without the author’s personal settings or integrations and uses a model from a different family than the coding agent when available, or another model from the same provider when necessary.
The review configuration defines the main review model and the smaller model used for the scout step. Local review uses all four stages below, regardless of the risk tier the pull request receives later. Chapter 4 explains how risk changes the stages used in CI.
- Scout: A smaller model reads the diff and suggests possible issues to investigate.
- Verification: The AI reviewer examines the changed code and any suggestions from the scout, then checks possible issues against related code, tests, and repository rules before reporting them.
- Security: The AI reviewer takes another pass through the changed code using matching rule packs marked with
security: truein their settings. - Critical recheck: The AI reviewer checks the most serious issues again without relying on the earlier review and drops any that do not hold up.
Each issue reported by the AI reviewer is called a finding, and the skill asks the author whether to fix it or reject it with a reason. The coding agent then makes the fix or writes the author’s reason to .review/decisions.json. The skill reruns the checks and review after the findings are handled, and later reviews read the recorded decisions so they do not raise the same rejected issue again.
Give the AI reviewer explicit rules
We give the AI reviewer a small set of repository rules drawn from verified incidents, repeated review feedback, and agreed product constraints. Each rule pack is a file that lists the rules, the files they cover, and an owner responsible for keeping those rules accurate. For example, the AI reviewer loads the payments pack only when a change touches code that handles payments. A general pack uses wildcard ** as its path setting, so the AI reviewer loads it for every change. Rules that tools can check reliably stay in the automated checks, leaving AI and human reviewers to judge questions that require context.
The payments rule pack shows how precise a rule needs to be. Its PAY-3 rule distinguishes money calculations from display-only percentages:
## PAY-3 Money is an integer in minor units (warning)
Monetary amounts are stored, compared and summed as integer minor units,
such as cents. Flag floating-point monetary amounts in those operations.
Display-only percentages that never become monetary amounts are outside
this rule.
In your own packs, record the incident or decision behind each rule so its owner can revisit that reasoning when the rule needs to change.
2. Open a pull request with full context
At the end of local review, the author has a plan, session notes, test results, and reasons for any AI findings they rejected. The important parts of that record need to reach the pull request because the diff alone cannot show why the author chose an approach or why a line that looks wrong is intentional. We put that missing context in the pull request description so reviewers can understand the change before tracing it through the code.
Once the work is committed and the branch is pushed, the author invokes the pr skill to prepare that description. The skill reads the ticket, pushed diff, plan, session notes, test results, and recorded decisions, then fills the five sections in the pull request template. The template brings together the ticket and acceptance criteria, the reason for the change, a summary of the coding session, test results, and explanations for rejected findings. The author checks the proposed description and either confirms it or supplies corrections before the skill opens a draft pull request through the GitHub CLI.
Once /pr opens the draft pull request, GitHub Actions starts the automated workflow. Each job groups the steps needed for one task, such as validating the description or running tests. The first job, validate-pr-description, checks that the description has all five required sections, that the linked ticket can be found, and that any rejected finding includes a reason and code evidence matching the diff. The following chapters explain the other jobs, which begin only after this check passes.
If validation of the description fails, the job adds a needs-intent label, a visible tag showing that the pull request description has not passed the check. The author runs the /pr skill again to correct the description and confirms the proposed changes. Updating the description runs validation again, and the job removes the label when it passes.
3. Repeat the checks in CI
During local review, the coding agent runs the check script shown in the package.json excerpt so it can fix failures before opening the pull request. GitHub Actions repeats those checks in CI because local steps may be skipped or installed dependencies may differ from the lockfile. It also tests the change together with the target branch, the branch the pull request will merge into. Once the pull request passes the description check from chapter 2, GitHub Actions starts the jobs in our pull request validation workflow.
After the description passes validation, two quick jobs run together. secret-scan looks for exposed credentials in the pull request’s commits, while format-lint-typecheck checks formatting, lint rules, and TypeScript types. Both must pass before CI spends time on tests and deeper scans, as the graph below shows.
Four jobs then run in parallel. unit-integration-tests runs unit and integration tests and measures coverage. build-and-browser-tests builds the application and checks critical user journeys in a browser. dependency-vulnerability-scan looks for known vulnerabilities introduced by dependency changes, and static-security-scan checks changed code for security issues without running the application.
- 1
validate-pr-description - 2
Run in parallel after description validation
secret-scanformat-lint-typecheck - 3
Run in parallel after both first checks pass
unit-integration-testsbuild-and-browser-testsdependency-vulnerability-scanstatic-security-scan - 4
Inspect every job result
verify-required-checks
The graph shows the path when all checks pass, but a failure can cause GitHub Actions to skip jobs that depend on the failed one. The final verify-required-checks job uses always() to run anyway, reads each required job’s result, and fails when any expected job did not succeed. After the author fixes the cause and pushes an update, the workflow runs again, and verify-required-checks passes only if all expected jobs succeed. To make these checks a condition for merging, we configure GitHub’s branch protection settings to require a passing result from this job.
Some automated checks, such as full browser suites and whole-repository scans, take too long to run on every pull request, so they can run on a schedule or be triggered manually on demand. When either run fails, the team reviews the failure and fixes the cause.
Make tool failures visible
Configure each tool to fail its job when it finds a problem that should block merging. Before relying on the workflow, use a safe test case to confirm that the problem also makes verify-required-checks fail.
4. Classify risk and set review depth
As Chapter 3 explains, every pull request goes through the same required automated checks. Risk classification then decides which AI review stages run and whether a human must approve the change.
After the verify-required-checks job passes, the pull request validation workflow runs .github/scripts/risk-tier.sh with the target branch’s risk configuration. Each repository can set the values in that file and update them as its code and review policy change. The job adds a visible risk label to the pull request, either risk:low, risk:medium or risk:high, and explains the decision in a pull request comment.
The AI review job in Chapter 5 takes the risk tier produced by classify-risk. Its wrapper passes that tier to the review skill through --risk, and the review configuration selects the stages shown below.
| Risk tier | AI review stages | Human approval |
|---|---|---|
| Low | verify |
None, unless a review is explicitly requested |
| Medium | scout, verify |
One eligible reviewer other than the author approves |
| High | scout, verify, security, verify-critical |
One eligible code owner or lead other than the author approves |
How the classifier chooses a risk tier
The risk configuration sets four checks: total points, total points together with average points per line, the highest file weight, and counted lines. If the checks point to different risk tiers, the classifier assigns the highest one to the whole pull request.
Each added or removed line earns points based on its file’s weight. In our risk configuration, authentication code has a higher weight than less important code to reflect the greater consequences of mistakes there. Lockfiles, snapshots, binary files, and files below the weight cutoff add no counted lines. A pure rename adds no counted lines, but the higher weight of its old or new path can still raise the pull request’s risk tier.
Our risk configuration gives ordinary test files a weight of 0.5, using folder and filename patterns to identify them. Later rules override that weight for specific areas, so tests under src/integrations/ use 2 and tests under tests/payments/ use 8. The last matching rule sets the file’s weight for both scoring and the minimum risk tier.
The author multiplier raises points for files in folders where the author has fewer commits and lowers them where they have contributed more. For each file, the classifier multiplies the number of changed lines by the file’s weight and the author multiplier, then adds those results to get total points. It divides that total by the counted lines to calculate average points per line, using zero when no lines count. Total points reflect the amount of risky change, while average points per line show how concentrated that change is in sensitive code.
When files in the configured code paths change but no test files do, the classifier applies a multiplier to total points. Our risk configuration doubles the total after calculating the average. Reviewers still need to judge whether the tests cover the new behavior.
In our risk configuration, total points below 50 qualify for low risk unless another rule raises the tier. A change qualifies for high risk when its total reaches 300, or when its total reaches 150 and its average reaches 2.5 points per line. Scores that meet neither the low nor high conditions give a medium risk tier, which the file weight and size rules can still raise. A file weight of 2 makes the pull request at least medium risk, while 8 makes it high risk, so even a one-line authentication change is high risk. More than 400 counted lines is high risk and prompts a suggestion to split the pull request.
5. Review in CI and resolve every finding
Local review checks the change before the pull request opens. After the automated checks pass and classify-risk assigns a tier, the pull request validation workflow repeats the review on the pushed code. It uses the same review skill, but reads the ticket criteria, a summary of what the coding agent did, and recorded decisions from the pull request description instead of local notes. The AI reviewer reads the diff, related code, and relevant tests to verify possible issues before reporting them.
Both local and CI reviews run the same repository script, review/run.sh, which loads the committed review skill and configuration. This keeps the reviewer and scout models aligned across both runs. The reviewer model is separate from the coding agent’s model. When available, it comes from a different family, which can help reduce shared blind spots. If a different family is not available, the reviewer uses another model from the same provider. Local review runs all four stages, while CI selects stages according to risk.
Publish the review result
The AI reviewer returns a summary, an assessment of each acceptance criterion, and any verified findings. It marks the result as complete only after running every required review stage and assessing every criterion.
Once the result is marked complete, the workflow runs .github/scripts/post-review.sh to update the summary comment on the pull request and add findings beside the relevant code. For high risk changes, the summary can also highlight specific decisions that need a human reviewer’s judgment.
The ai-review check passes only if the script successfully posts the summary and comments to the pull request and the latest review contains no findings.
Resolve findings and rerun
The author takes the findings back to the coding session and chooses whether to fix or reject each one. The coding agent makes the fixes or records the author’s reasons for rejections in .review/decisions.json. The author then invokes the self-review skill to rerun local checks and review. After committing and pushing any code changes, the author invokes the pr skill to update the pull request description with those decisions.
Each new push or description edit starts a fresh CI run and cancels an older run still in progress. The AI reviewer checks the updated code and decision log. The publishing script leaves threads open for issues the AI reviewer still reports. It closes threads for confirmed fixes or recorded rejections and posts comments for any new findings.
During normal review, clicking Resolve conversation on an AI comment by hand does not clear its finding or make ai-review pass. The AI reviewer must confirm a fix in the code or match a rejection recorded in the decision log.
Finishing the review does not mean the change meets every requirement. If the AI reviewer reports an unmet acceptance criterion, the author must fix the gap or explain why it remains before moving on to human review in Chapter 6.
6. Human review and merge
The risk tier from Chapter 4 determines who needs to approve the change. Low risk needs no human approval unless someone requests it. Medium risk needs one reviewer other than the author, while high risk needs one eligible code owner or project lead.
Assign a reviewer
After the automated checks and AI review pass, the author marks the draft pull request ready. GitHub then reads the CODEOWNERS file from the target branch and requests review from the owners listed for changed files.
The reviewer assignment workflow also runs when the pull request becomes ready and reruns after later updates to the code, description, risk tier, or reviewers. Before assigning anyone as the reviewer, it checks for an eligible code owner in CODEOWNERS and for a suitable reviewer who has already been requested or has reviewed the change. If it finds neither, a medium risk pull request goes to the next person in the team’s reviewer rotation, while a high risk pull request goes to a project lead. If it cannot assign anyone, a lead chooses the reviewer manually.
If the selected reviewer is unavailable, the author chooses a replacement. The assignment job checks that they meet the risk tier’s requirement and leaves them in place if they do.
Review the change
The human reviewer reads the ticket, pull request description, recorded decisions, and AI summary alongside the code. They judge whether the change meets the ticket’s acceptance criteria, fits the surrounding system, and has effects the tests may miss. They leave comments on the pull request for any concern they want the author to address.
The author fixes each concern or explains in the pull request why the change should stay. When code changes, the author returns to the coding session, pushes the fix, and uses the pr skill to update the pull request description. CI reruns before the reviewer looks again. In our process, the human reviewer resolves each conversation after accepting the fix or explanation.
Enforce the merge rules
In our workflow, a pull request can merge only when two checks pass: verify-required-checks and review-requirements. The verify-required-checks job reports whether the automated checks in Chapter 3 passed. The review requirements workflow checks that AI findings have been addressed and unmet acceptance criteria have been fixed or explained. It also checks that any required or requested reviewer has approved the current version of the code, then publishes the review-requirements result.
Branch protection requires both results to pass and all review conversations to be resolved. We leave GitHub’s settings for a fixed number of approvals and mandatory code-owner approval off, so review-requirements can decide who needs to approve based on the risk tier.
The same check normally requires AI review to pass, but it can accept the emergency exception described below. If we also required ai-review directly in branch protection, a failed AI review would still block the merge after a lead authorized the exception.
The workflow runs again when the code or pull request description changes. If the code changes, any required human reviewer must approve the updated change before it can merge.
Handle urgent exceptions
break-glass is an emergency exception for an urgent fix when a technical failure prevents AI review from finishing or publishing. A lead other than the author posts a break-glass: comment naming the latest commit and explaining the failure and urgency. They check any open AI findings against the current code and recorded decisions, reply with the outcome, and resolve those threads by hand. The exception covers only the code the lead checked, so a new push requires them to check the updated code and name the new commit in their comment.
The workflow verifies the comment before allowing review-requirements to pass without a successful AI review. Someone other than the author must still approve, even for low risk, and medium and high risk retain their reviewer requirements from Chapter 4. Automated checks must pass and all review conversations must be resolved, while any finding the lead cannot settle or active request for changes still blocks the merge.
7. Measure and adjust
Faster merges tell us little about whether review caught important problems or produced too many incorrect findings. We keep feedback on each pull request and use it to improve the workflow.
Keep the record on the pull request
The author gives a thumbs-up to an AI finding they acted on. Anyone who thinks a finding is wrong can give it a thumbs-down and explain why, but the reaction prompts a closer look rather than proving an error. Rejected findings already have reasons in the pull request’s decision log from Chapter 2, and a finding without feedback remains unclassified.
After merge, the recording workflow runs .github/scripts/record.sh to add a separate comment to the pull request with those outcomes, the number of ai-review job runs, and how long they took. If an incident is later connected to the change, the investigator adds a custom incident label to the merged pull request and links the incident record there.
Use the record to improve the workflow
Once a month, the project lead runs .github/scripts/measure.sh for a repository and start date. The script reads the review record comments and labels on pull requests merged since that date and prints a report on findings people acted on or rejected, incidents, and the number and duration of ai-review job runs. It groups findings reported as incorrect by rule and shows the risk tier for pull requests linked to incidents, with links back to the relevant pull requests.
If findings from one rule are repeatedly reported as incorrect, the lead and the rule’s owner check the linked pull requests and clarify the rule in its rule pack when those reports are justified. An incident linked to a low risk change prompts the team to examine the risk configuration and automated checks.
Long review times or repeated retries prompt the team to inspect the affected runs before changing the review configuration. The team uses later reports to check whether these changes helped. Before removing a rule with no recent findings, they check whether the problem it was meant to catch is still possible or is now covered by another check.
Adopting the workflow
Introduce it in one repository first. Establish the pull request template and the automated checks before anything else. Then run the AI reviewer in a non-blocking mode while the team evaluates its findings and refines the rules. Once the team trusts the results, require the checks and reviews to pass before merging.
Coding agents will continue to get faster. The goal is to reduce the human time needed to review each change. Let automated checks handle the problems they can reliably detect, so engineers can focus on behavior, risk, and decisions that need context.
See the appendix for the source files, their implementation status, and the project structure.
Appendix: sources and project structure
These examples cover selected parts of the workflow. The source files are listed at the end of this page, and the project tree shows where they belong alongside the helper scripts and generated files described in the article.
Skill origins
/grilladapts Matt Pocock’s grilling skill, asking questions individually and recording the agreed plan./reviewadapts Matt Pocock’s code-review skill, checking changes against repository rules and ticket requirements./self-reviewtakes its rule against rerunning a review just to get a more favorable verdict from OpenClaw’s autoreview skill./pradapts guidance from OpenClaw’s agent-transcript and autoreview skills.
Project structure
“Not included” marks files the workflow uses but the examples do not supply.
project/
├── AGENTS.md # Not included
├── .gitignore # Not included, ignores .review/
├── .mailmap # Not included
├── package.json # Scripts excerpt
├── package-lock.json # Not included
├── .nvmrc # Not included
├── .claude/
│ └── skills/
│ ├── grill/
│ │ └── SKILL.md
│ ├── pr/
│ │ └── SKILL.md
│ ├── self-review/
│ │ └── SKILL.md
│ └── review/
│ ├── SKILL.md
│ ├── config.json
│ ├── risk.yml
│ ├── run.sh # Not included
│ └── rules/
│ └── payments.md
├── .github/
│ ├── CODEOWNERS
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── scripts/
│ │ ├── check-intent.sh # Not included
│ │ ├── risk-tier.sh # Not included
│ │ ├── post-review.sh # Not included
│ │ ├── request-reviewers.sh # Not included
│ │ ├── check-review-requirements.sh # Not included
│ │ ├── record.sh # Not included
│ │ └── measure.sh # Not included
│ └── workflows/
│ ├── pull-request-validation.yml
│ ├── reviewers.yml
│ ├── review-requirements.yml
│ └── record.yml
├── playwright-report/ # Generated by browser tests in CI
└── .review/ # Gitignored, created during a coding session
├── plan.md # Generated by /grill
├── session.md # Generated by /self-review
└── decisions.json # Created if findings are rejected






