pr-review
Skill2 starsChanged 5 months agoMITView on GitHub
Review a Bitbucket pull request in any repository end to end - fetch it, pin a checkout of its head commit, run the parallel diff pass and the claim-verification pass, write the full report to docs/reviews/, and post one self-contained summary comment without asking first. Reads and comments only: never pushes, merges or edits the pull request branch. Use this whenever a Bitbucket pull request review is asked for in any wording, including "review PR 29", "review this pull request", "can you review the PR", "review pull request 12 in <workspace>/<repo>", a pasted bitbucket.org/.../pull-requests/<n> URL, or a request for a PR review report or a review comment on a PR. Bitbucket only, through the Composio MCP tools. Do NOT use it to write the message that asks colleagues for a review (pr-review-request); for a GitHub pull request, which needs gh or a general code-review skill; for uncommitted or local changes with no pull request behind them; or for a branch or a diff never opened as a pull request.
198 other projects use a version of this.
Adopted by
Most recently taken up by
- RoboFinSystems/robosystemstheir own version, first seen Nov 30, 2026
- aws-solutions-library-samples/accelerated-intelligent-document-processing-on-awstheir own version, first seen Nov 29, 2026
- assawalhy/awesome-agenttheir own version, first seen Nov 29, 2026
- ErikaAX08/erikas-skillstheir own version, first seen Nov 29, 2026
- hukusuke1007/agent-skillstheir own version, first seen Nov 29, 2026
- ccomkhj/skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use expert-reset, updates and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
jtenniswoodSkillexpert-reset
Reimagine this repository from first principles using the current product and user experience as the target. Use when the user says "/expert-reset", asks how the project should be rebuilt if starting again, wants bold architecture or component-structure recommendations, or wants a research-only reset plan unconstrained by current implementation details.
Also in 3 projects that use this
jtenniswoodSkillupdates
Summarize user-facing project updates from the last 7 days, ordered by importance and written as one-sentence "Feature: description" entries. Use when the user says "/updates", asks what changed recently, or wants a concise list of recent features, device support, fixes that users will notice, or other product value.
Also in 3 projects that use this
openchamberSkillclack-cli-patterns
Use when creating or modifying OpenChamber CLI commands, prompts, terminal output, non-TTY behavior, `--quiet`, or `--json` behavior.
Also in 3 projects that use this
openchamberSkilldrag-to-reorder
Use when implementing or modifying OpenChamber sortable or drag-to-reorder behavior, especially `@dnd-kit`, touch/mobile interactions, variable-width items, or wrapping layouts.
Also in 3 projects that use this
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
- +6 more from openchamber
Other versions198 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 198
- Significant-Gravitas/AutoGPT★ 188ksame name
- pytorch/pytorch★ 106ksame name
- rtk-ai/rtk★ 88ksame name
- saadeghi/daisyui★ 43ksame name
- rustfs/rustfs★ 37ksame name
- dotnet/maui★ 23ksame name
- NVIDIA/Megatron-LM★ 19ksame name
- MiniMax-AI/skills★ 14ksame name
- btriapitsyn/openchamber★ 13ksame name
- openchamber/openchamber★ 13ksame name
188 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- find-skillsSkill
- skill-creatorSkill
- anti-sycophancySkill
- clear-and-shortSkill
- coding-standardsSkill
- convert-plan-to-featureSkill
- dead-code-removalSkill
- delegation-promptSkill
- document-generateSkill
- execute-changeSkill
- live-app-security-auditSkill
- new-featureSkill
- plan-eng-reviewSkill
- pr-review-requestSkill
- repo-change-summarySkill
- security-vulnerability-scanSkill
- session-cleanupSkill
- session-handoffSkill
- sonar-issue-checkSkill
- sonar-issue-fixSkill
- systematic-debuggingSkill
- trim-initial-bundleSkill
- unslopSkill
- update-dependenciesSkill
- verify-frontend-changeSkill
- verify-implementationSkill
- windows-disk-cleanupSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. 0 are common, 22 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 181 edited versions we read keep these.
22
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 33
A review request is not a review: If the user asked for the message that asks colleagues to review the pull request ("review request for PR …
- Distinctive: line 42
Read and comment only: Never push code, never merge, never edit the pull request branch.
- Distinctive: line 52
Never put an API key, token, password or connection string into the report or the comment.
- Distinctive: line 63
All tools work and will not error.
- Distinctive: line 66
Call a tool only when it is required.
- Distinctive: line 67
Write a todo list before starting.
- Distinctive: line 129
Check whether any of the following is true.
- Distinctive: line 179
If any condition is true, stop and do not go on.
- Distinctive: line 190
Run the script, from the primary working directory so the clone can use its object store:
- Distinctive: line 235
Every CLAUDE.md in a directory that contains a file changed by this pull request.
- Very specific: line 236
Every file under .claude/rules/.
- Distinctive: line 248
Every subagent whose result may be long writes that result to a file.
- Distinctive: line 268
Agent 4: bugs, Opus: Look for problems in the introduced code: security issues, incorrect logic, and similar.
- Distinctive: line 271
Only high-signal issues are wanted.
- Distinctive: line 286
Use Opus subagents for bugs and logic issues.
- Distinctive: line 295
If more candidates came back than the cap, the report says how many were not validated, and those are dropped rather than reported …
- Distinctive: line 307
Settle factual claims against primary sources: Treat every claim in the commit messages and in the pull request description as a claim to …
- Distinctive: line 315
Read sibling repositories when the change depends on one: Read only. Never write to a sibling repository and never check out a branch in …
- Very specific: line 373
Read references/report-template.md before writing anything, and references/severity-rubric.md before assigning any severity.
- Very specific: line 380
The pull request is in the current checkout: Write docs/reviews/pr-review-{repo}-{pr_number}.md there, creating docs/reviews/ if it does …
- Distinctive: line 397
Every finding quotes the evidence it rests on: a line of code, a line of a CLAUDE.md rule, a line of a commit message, or a line of the …
- Distinctive: line 424
Every CRITICAL issue, with file, line and a one-line description.
- Distinctive: line 434
Put a blank line before every list.
- Distinctive: line 439
Do not wrap hashes in backticks to stop it.
- Distinctive: line 442
If no issues were found, the comment reads, after the marker line, the head line and any re-review lines: "No issues found.
“Common” is measured: kept by at least 6 in 10 of the 181 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reviewing a Bitbucket pull request
Arguments
- A bare pull request number means that pull request in the Bitbucket repository that the current
working directory's
git remote get-url originpoints at. Iforiginis not a Bitbucket remote, or the working directory is not a git repository, ask for<workspace>/<repo>instead of guessing which repository was meant. <workspace>/<repo> <pr-number>means a pull request in another Bitbucket repository.--no-commentmeans do every step up to and including Step 7, then stop. Post nothing to Bitbucket.
Examples: review PR 29, review PR 29 --no-comment, review PR 12 in <workspace>/<repo>.
A review request is not a review. If the user asked for the message that asks colleagues to
review the pull request ("review request for PR 50", "write the ready-for-review message",
"announce the PR for review"), stop before Step 1 and use pr-review-request. This skill posts a
comment on the pull request, and that user asked for text to paste into a chat.
Hard rules
These three are the ones that have been broken before, so they come first.
- Read and comment only. Never push code, never merge, never edit the pull request branch.
- The only file written inside the repository is the report, at
docs/reviews/pr-review-{repo}-{pr_number}.mdor at the location Step 7 resolves. Nothing else in the repository is created, modified or deleted, including reports for other pull requests. - The posted comment carries no snippet links, no download links and no external URLs of any
kind. Not a Bitbucket link, not a commit link, not a link to the report. It is self-contained
plain text and tables. The comment may name the report's path as plain text. A bare commit hash
or
PR #Nthat Bitbucket itself shows as a link is not a link in the comment and does not break this rule; Step 8 has the detail.
Never put an API key, token, password or connection string into the report or the comment.
This skill declares no allowed-tools, because the Bitbucket tools it needs are the user's own
Composio MCP registration and cannot be listed here. It does declare
disallowed-tools: Edit, NotebookEdit: the only file it ever writes is the report, and Write
covers that, so dropping Edit while the skill is active costs it nothing and takes away the tool
that would break Hard rule 2. The guard is per-turn and covers this session only, not the subagents
Step 5 launches, so Hard rules 1 and 2 remain workflow discipline as well.
Assumptions for you and for every subagent you launch
- All tools work and will not error. Do not test tools and do not make exploratory calls. Repeat this sentence in the prompt of every subagent you launch, because a subagent that starts by probing its tools spends its budget before it reads anything.
- Call a tool only when it is required. Every call needs a clear purpose.
- Write a todo list before starting.
- A subagent whose result may be long writes it to a file and replies with only the path. Step 5 says which subagents and why.
What is in this skill
These files live in the installed skill directory, not in the repository being reviewed. Invoke
every bundled script through ${CLAUDE_SKILL_DIR}, the base directory Claude Code prints when this
skill loads; a bare scripts/… path resolves against the session's working directory and will not
be found.
scripts/pin-pr-head.sh— clones a throwaway checkout pinned to the pull request head and prints the head hash, the merge base and the numstat. Used in Step 3.scripts/shellcheck-safe.sh— runsbash -nandshellcheckon files that may have CRLF line endings, without the SC1017 noise that buries real findings. Used in Step 6.references/report-template.md— the report skeleton, with a worked example per severity. Read it in Step 7 before writing anything, and again when the shape of a section is unclear.references/severity-rubric.md— what separates CRITICAL, HIGH, MEDIUM and LOW here, and the list of things not to flag. Read it in Step 5 and again in Step 7, before assigning any severity.
How to call the Bitbucket tools
The Composio MCP server has to be registered for the session, either from the user's own
~/.claude.json or from a project .mcp.json. If the Composio tools are not available, stop and
say so. Do not fall back to gh, and do not review a pull request you could not fetch.
Reach every Bitbucket tool the same way: call COMPOSIO_SEARCH_TOOLS to load the tool schemas, then
execute them through COMPOSIO_MULTI_EXECUTE_TOOL.
These tool slugs are verified to exist. Do not invent others:
BITBUCKET_GET_PULL_REQUESTBITBUCKET_GET_PULL_REQUEST_DIFFBITBUCKET_GET_PULL_REQUEST_DIFFSTATBITBUCKET_CREATE_PULL_REQUEST_COMMENTBITBUCKET_GET_REPOSITORIES_PULLREQUESTS_COMMENTSBITBUCKET_GET_PULL_REQUEST_COMMITSBITBUCKET_GET_COMMIT_DIFFBITBUCKET_GET_FILE_FROM_REPOSITORYBITBUCKET_BROWSE_REPOSITORY_PATH
Step 1 — Fetch the pull request
BITBUCKET_GET_PULL_REQUESTfor the metadata: title, description, author, state, source branch and commit, destination branch and commit, draft flag.BITBUCKET_GET_PULL_REQUEST_DIFFSTATfor the changed-file list with per-file added and removed line counts. Two things about this response:- It is paginated. Follow
response.data.nextuntil it is absent and concatenate the pages. A single page is not the whole file list. values[].new.pathis null for a deleted file. Fall back tovalues[].old.pathso deletions are not dropped from the list.
- It is paginated. Follow
BITBUCKET_GET_PULL_REQUEST_DIFFfor the unified diff. Checkresponse.data.truncated. If it is true the diff you received is incomplete, so do not review it: use the pinned checkout from Step 3 and rungit diff <merge-base>..<head>there instead, and say in the report that the diff came from the local checkout.
Record the file count and the total added and removed lines. Step 7 and Step 8 both need them.
Step 2 — Skip conditions
Check whether any of the following is true. Do this yourself; none of it needs a subagent. Do it before pinning a checkout: the pin is a clone, and a skipped pull request should not cost one.
- The pull request state is not
OPEN, that is, it isMERGED,DECLINEDor otherwise closed. Step 1 already fetched the state. - The pull request is a draft. Step 1 already fetched the draft flag.
- The change does not need review: an automated pull request, or a change that is trivially and obviously correct. This one is your judgement.
This procedure has already posted its review at the current head. One
BITBUCKET_GET_REPOSITORIES_PULLREQUESTS_COMMENTScall answers this: look for a top-level comment whose first line is exactlyCode review by pr-review, the marker Step 8 puts on every comment it posts. Nothing else counts. A review comment from anyone else, including an AI review the author posted under their own account, is not a skip condition: it was not produced by this procedure, and its statements are claims for Step 6 like any other. Two pull requests checked on 2026-09-16 each carried such an author-posted review, one in this procedure's old shape and one in another; the marker is what makes the check the same in both cases. If there is more than one marker comment, use the newest.Then compare the head that marker comment names with the source commit Step 1 fetched. The head is on the line that starts
Reviewed at head, which Step 8 writes as the comment's second line,Reviewed at head <hash>.. An older comment may have that line further down, with backticks around the hash; ignore the backticks. One of the two hashes may be abbreviated: Bitbucket gives the source commit as 12 characters. They match when the shorter one is the start of the longer one.- The same head. The condition holds. Stop.
A different head, or no head line. A comment posted before Step 8 required the head line has none. The condition does not hold on its own, because the pull request has changed since it was reviewed, or nobody can tell whether it has. Ask the user once with
AskUserQuestion, with three options:- A full re-review at the current head. This is the recommended default.
- A review of only the new commits, from the earlier head to the current head. Do not offer it
when the comment has no head line, because there is then no earlier head to start from. Step 3
still pins the current head and cross-checks the whole diffstat. Steps 5 and 6 then work from
git diff <earlier head>..<head>in the pinned checkout, and the report and the comment say that only that range was reviewed. Ifgit merge-base --is-ancestor <earlier head> <head>fails in the pinned checkout, a rebase or a force push removed the earlier head and the range does not exist: say so and ask again with options 1 and 3 only. - Stop.
A declined or unanswered question means stop. When
AskUserQuestionis not available, stop. This is the same rule as Step 8: silence is not consent, and a re-review ends in a second comment on the pull request.On 2026-10-01 pull request #31 in mi9retail/nexus-transformation-service carried a marker comment posted on 2026-09-23 at head
ac953395e94b, when the pull request had 60 files. The head was now2dbb1401e4fb: 100 commits had been added and the pull request had 354 files. Stopping would have left a review of 60 files standing for 354. The user chose a full re-review.
If any condition is true, stop and do not go on. Say which condition stopped you. The one exception is a marker comment at a different head, or with no head line: there the user's answer decides.
A pull request written by Claude still gets reviewed. Being AI-generated is not a skip condition.
Step 3 — Pin a checkout
The working directory you started in may be shared with other sessions, and its checked-out branch
can move while you work. Never review from it, and never run git checkout in it. Line numbers
taken from a moving working tree are wrong by the time anyone reads them.
Run the script, from the primary working directory so the clone can use its object store:
bash "${CLAUDE_SKILL_DIR}/scripts/pin-pr-head.sh" <head-sha> <dest-branch> <scratchpad>/pr-<number>The script takes an optional fourth argument, the repository to clone from, and it defaults to the
current directory. When the pull request's repository is not the current checkout, pass that
repository as the fourth argument: a local clone path, or a clone URL such as
https://bitbucket.org/<workspace>/<repo>.git. Without it the script clones the current directory,
which is the wrong repository, and the run fails.
Cloning a local checkout would normally leave that local path as the new clone's origin, so every
fetch would read the checkout instead of Bitbucket, and a branch the checkout holds only as
origin/<name> would be reported as missing. The script repoints origin at the source checkout's
own origin to prevent that. If the source checkout has no origin remote, the script says so: the
clone can then only see what that checkout had already fetched.
It prints ORIGIN=, PINNED_CHECKOUT=, HEAD=, MERGE_BASE=, the git diff --numstat for that
range, and the commits in the range. Confirm ORIGIN= is the repository the pull request lives in
before trusting anything else the script printed.
Then cross-check its numstat against the diffstat from Step 1: the same file list and the same per-file counts. If they differ, stop and report the difference. It means the pull request moved while you were reading it, or the destination branch advanced, and every line number in the review would be wrong.
Two differences are formatting, not movement, and must not stop the run:
- A binary file.
git diff --numstatprints-for both counts where Bitbucket reports a number. Match on the path and treat the counts as agreeing. - A rename.
git diff --numstatcan print the path as{old => new}/nameon one line where Bitbucket lists the old and new paths separately. Resolve it to the new path before comparing.
Anything else that differs is real. Stop on it.
Record both full hashes; they go in the report header. All file reading and every command in Steps 5 and 6 runs against the pinned checkout, using absolute paths. Tell every subagent to use the pinned path.
Step 4 — Collect the CLAUDE.md scope
Collect a list of file paths, not their contents. Glob answers this; no subagent is needed.
- The root
CLAUDE.md, if it exists. - Every
CLAUDE.mdin a directory that contains a file changed by this pull request. - Every file under
.claude/rules/.
Scoping rule, to pass on to the compliance agents in Step 5: a CLAUDE.md applies only to files in
its own directory or below it. A rule in services/admin-service/CLAUDE.md says nothing about a file
in libs/core/. The root CLAUDE.md and the files in .claude/rules/ apply to the whole repository.
Step 5 — The parallel diff pass
Give every agent in this step the pull request title and description, so it knows what the author
intended, and the path of the pinned checkout from Step 3. Read references/severity-rubric.md
first; its "what to flag" and "what not to flag" lists go into the prompt of every agent here.
Every subagent whose result may be long writes that result to a file. That is the four agents in
5a, every validation subagent in 5b, and any agent you launch in Step 6. Put this in each one's
initial brief: write the full result to <scratchpad>/pr-<number>-agents/<agent name>.md, then
reply with only that path and a one-line summary. Then read the file, not the reply. A long result
is truncated in the completion notification, and a message sent to a running agent reaches it only
after its current tool call finishes, so the rule has to be in the first brief. On 2026-10-01 this
cut off 4 results in one run, and asking an agent to resend in chat was cut off again.
5a. Four agents in parallel
Launch all four in one message so they run at the same time. Each returns a list of issues, and each issue carries a description and the reason it was flagged, for example "CLAUDE.md adherence" or "bug".
- Agent 1 and Agent 2: CLAUDE.md compliance, Sonnet. Audit the changed files against the
CLAUDE.mdfiles and.claude/rules/files collected in Step 4. When judging a file, consider only theCLAUDE.mdfiles that share its path or are a parent of it. - Agent 3: bugs, Opus. Scan for obvious bugs. Work from the diff itself without reading extra context. Flag only significant bugs. Ignore nitpicks and likely false positives. Do not flag anything that cannot be validated without looking outside the diff.
- Agent 4: bugs, Opus. Look for problems in the introduced code: security issues, incorrect logic, and similar. Look only for issues inside the changed code.
Only high-signal issues are wanted. The rubric's "what to flag" list is the standard and its "what not to flag" list is the exclusion list. If you are not certain an issue is real, do not flag it. False positives lose trust and waste reviewer time.
5b. One validation subagent per issue
For each issue returned by any of the four agents, launch a subagent to validate it. Run them in
parallel. All four, not only the bug agents: Step 5c drops everything that was not validated here, so
leaving the two compliance agents out of this step would discard every CLAUDE.md finding they
produced. Give each one the pull request title and description and the description of the single
issue. Its job is to check that the stated issue is truly an issue, with high confidence. If the
issue was "variable is not defined", the subagent confirms that this is actually true in the code.
For a CLAUDE.md issue, the subagent confirms both that the rule is scoped to that file and that it
is actually violated.
Use Opus subagents for bugs and logic issues. Use Sonnet subagents for CLAUDE.md violations.
At most 12 validation subagents in one run. Rank the candidates by which bullet of the rubric's
"what to flag" list they match, taking the bullets in the order they are written: a compile or parse
failure first, then code that produces wrong results regardless of input, then a CLAUDE.md
violation. Inside one bullet, keep the candidate whose file comes first in the diffstat. The
rubric's fourth bullet, a claim the repository contradicts, cannot appear here: Step 6 produces
those and it runs after this step.
If more candidates came back than the cap, the report says how many were not validated, and those are dropped rather than reported unvalidated.
5c. Filter
Drop every issue that was not validated in 5b. What remains is the high-signal list from this stage.
Step 6 — The verification pass
Step 5 reads the diff. It cannot settle whether the change is true, and that is where a review finds most of what matters. Do not drop this step and do not merge it into Step 5.
- Settle factual claims against primary sources. Treat every claim in the commit messages and in the pull request description as a claim to check, not as evidence. If a commit message says a library behaves a certain way, read that library's source at the version being used. If it says a checklist item is closed, open the checklist. If the pull request adds its own review or design document, that document was written by the same author as the code, so it is part of the change under review and is not independent support for it. For each claim record: settled and correct, settled and wrong, or not settled. A claim you could not settle goes in the "what was NOT checked" section of the report, with the exact source that would settle it.
- Read sibling repositories when the change depends on one. Read only. Never write to a sibling repository and never check out a branch in one.
Lint every changed shell script, from the pinned checkout:
bash "${CLAUDE_SKILL_DIR}/scripts/shellcheck-safe.sh" <pinned>/path/a.sh <pinned>/path/b.shThe script runs
bash -nandshellcheck -S warningon a copy with the carriage returns removed, because a working tree can hold CRLF files andSC1017would otherwise bury every real finding. It exits 1 when any file has a finding, and it says so whenshellcheckis not installed rather than passing silently. Check whether the repository's CI configuration runs a shell linter, and say in the report which one it runs; where it runs none, say that this is the only static analysis these scripts get. Report every warning that survives, and say which warnings were already there before this change.- Parse every changed YAML file and confirm it is valid.
Run the repository's own gates. The target repository's
CLAUDE.mdis the source of truth for its quality gates and its contribution rules. Read it, run the gates it names, in the pinned checkout, and check the change against every contribution rule it states, for example a rule that a change of a given kind must add a changelog entry.Install dependencies in the pinned checkout first, with the install command the repository's own CI configuration runs, flags and config file included: read
bitbucket-pipelines.ymlor the equivalent and copy its install line (for examplenpm ci --prefer-offline --userconfig=.bin/npm/.npmrc). A plainnpm cican fail where CI's does not: on 2026-09-16 a lockfile was in sync only under thelegacy-peer-deps=truethat CI's config file set, and the same file mapped a private registry scope. The checkout is a fresh clone with nonode_modulesand no restored packages; without the install every gate fails on a missing dependency and the report says "could not run" for all of them, which reads as a tooling problem rather than as the clean result it actually is.A gate may write inside the pinned checkout: a test runner rewrites snapshot files, a bundler leaves a cache. That is harmless in a throwaway clone. Say in the report that it happened, and never read the
git statusnoise it leaves as a finding against the pull request.Where
CLAUDE.mdnames no gates, or the repository has noCLAUDE.mdat all, run whichever of these exist:package.json: thelint,typecheckandtestscripts it defines, with the package manager its lockfile names, plusbuildwhen the change touches source rather than only tests.- .NET:
dotnet build --nologo, thendotnet testwhen the project has test projects. - Python: the linter
pyproject.tomlconfigures, andpytestif the repository has tests.
Name in the report the exact commands you ran, not the category. A gate that cannot run is reported as not run, with the reason, rather than left looking like it passed.
- On a re-review, settle the status of each earlier finding. This applies when Step 2 found a marker comment at a different head and the user chose a re-review. Take the earlier findings from that comment and, if it exists, from the earlier report at the path Step 7 writes, before Step 7 writes over it. Check each one against the pinned head and record its status: fixed, not fixed, or cannot be fixed, with the evidence, as for any other claim. The report and Step 8 both need this list.
Merge the findings from this step with the validated findings from Step 5 into one list. Label each finding with the stage that produced it, "diff pass" or "verification pass", so a reader can tell which findings came from reading the diff and which came from checking the claims.
Step 7 — Write the report
Read references/report-template.md before writing anything, and references/severity-rubric.md
before assigning any severity. The template holds the section list, the field list for a finding and
a worked example at each severity; the rubric holds the four definitions and the rules that decide
between two adjacent levels.
Where the report goes depends on whether the pull request is in the repository you are standing in.
- The pull request is in the current checkout. Write
docs/reviews/pr-review-{repo}-{pr_number}.mdthere, creatingdocs/reviews/if it does not exist. If that repository's ownCLAUDE.mdnames a different place for review or audit documents, that place wins. - The pull request is in another repository, which is exactly the case where Step 3 needed its
fourth argument. Write the report to
<scratchpad>/pr-<number>/pr-review-{repo}-{pr_number}.mdinstead. Never write it into the current checkout: that repository has nothing to do with the change under review, and Hard rule 2 allows one report in the repository being reviewed, not a file dropped into an unrelated one.
Say the report's path in your terminal reply either way. Do not modify any other file, and do not modify an existing report for a different pull request. On a re-review, the new report replaces the earlier report for the same pull request at that path.
This file is the primary output of the review. It has to be complete enough that a separate remediation agent can implement every fix without re-reading the codebase or the diff.
Every finding quotes the evidence it rests on: a line of code, a line of a CLAUDE.md rule, a line
of a commit message, or a line of the source that settles the claim. A finding with no quoted
evidence does not go in the report, because the reader cannot check it.
Then re-read the report cold, as if acting on it for the first time rather than from memory, and check it against the self-review list at the end of the template. Fix what is missing or vague before saying the review is done, and say in your terminal reply what that self-review found. Silently fixing the gaps hides whether the pass ran at all.
Step 8 — Post the summary comment
- If
--no-commentwas given, stop after Step 7. Post nothing. Without that flag the comment is always posted, and no question is asked about it. Build the comment. One top-level comment whose first line is exactly
Code review by pr-review, on a line of its own, and whose second line is exactlyReviewed at head <hash>., where<hash>is the full 40-characterHEAD=hash from Step 3. Step 2 of a later run reads both lines: the first finds this procedure's comment, and the second tells it whether the pull request has moved since. Together they stop this procedure posting twice on one pull request at one head. Then:- On a re-review, say so directly after the head line: that this is a re-review at a new head, the date and head of the review it replaces, and why it replaces it, for example "100 commits were added since and the pull request grew from 60 to 354 files". On a review of only the new commits, also name the range that was reviewed. Then the status of each finding of the earlier review, from Step 6: fixed, not fixed, or cannot be fixed.
- The pull request overview: what it does, its size, the number of files changed.
- The findings-count table by severity.
- Every CRITICAL issue, with file, line and a one-line description.
- The top five HIGH-priority issues, briefly.
- What looks good.
- The verdict.
No snippet links. No download links. No external URLs of any kind. The comment is self-contained. It may name the report's path as plain text, not as a link.
Two rules for how Bitbucket renders the comment:
- Put a blank line before every list. A list placed directly under a line of text, a bold heading line for example, renders as one run-on paragraph. That happened to 4 lists in the comment on pull request #31 on 2026-10-01, and they were fixed afterwards by editing the comment.
- Bitbucket turns bare commit hashes and text such as
PR #8into links when it renders the comment. That is its own rendering, not a URL in the comment, so it does not break Hard rule 3. Do not wrap hashes in backticks to stop it. The user decided this on 2026-09-16; on 2026-10-01 a run misread the rendered links as a breach and nearly wrapped the hashes in backticks.
If no issues were found, the comment reads, after the marker line, the head line and any re-review lines: "No issues found. Checked for bugs, CLAUDE.md compliance, and the claims made in the commit messages and description."
Where a bug is found, describe the exact fix in the comment. Do not push code.
- Post the comment with
BITBUCKET_CREATE_PULL_REQUEST_COMMENT. Do not ask the user first. Do not callAskUserQuestionabout posting, and do not wait for approval. This holds the same way in an interactive session, in aclaude -prun, and when this skill runs inside a subagent. The user decided this on 2026-11-23: the review is always posted to the pull request. After posting, show the comment's exact full text in your terminal reply, together with the report's path, so the user sees what was posted. If the post call fails, say so plainly, quote the error, and name the report's path so the user can post it themselves. Do not retry more than once.
Running as a subagent, the report is the run's return value. Do not rely on chat text reaching the session that launched you; say in the return value whether the comment was posted.
When a finding turns out to be wrong
It happens, and it happened twice in the review of pull request #29: one finding was downgraded from HIGH to MEDIUM once its failure mechanism turned out to be bounded rather than unbounded, and another was withdrawn entirely once the upstream source contradicted it.
Correct it in the report, following "recording a finding that changed during the review" in the template: the severity line says what the rating was and why it moved, and the corrections block in section 2 lists the change.
If the summary comment is already posted, also post a threaded reply on the pull request saying what was wrong and why. Do not quietly edit the report and leave the comment standing. The author may already be acting on a finding you no longer stand behind, and a reviewer's credibility rests on the corrections being as visible as the findings were. A review that corrects itself in the open is trusted further than one that is never seen to be wrong.
Review checklist
Whatever the stage, the review covers:
- Bugs and logic errors
- Security issues: OWASP top 10, injection, auth bypass
- Performance concerns: N+1 queries, missing indexes, unbounded loops
- Style and readability: naming, complexity, dead code
- Missing edge cases and error handling
- Breaking changes and backwards-incompatibility
- Claims in the commit messages and description that the repository or the upstream source does not support
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

