handle-pr-review
Skill107 starsChanged 9 months agoMITView on GitHub
Handle GitHub PR review findings (Copilot or human) end to end: fetch the review threads, judge whether each finding is valid, report the verdicts and wait for approval, fix only the valid ones, record them with record-code-review-feedback, then reply to every thread with the reason and resolve it. Use whenever the user mentions PR review comments, Copilot review findings, 'レビュー指摘', 'レビュー対応', asks whether review findings are valid, or asks to resolve review threads, even if they only give a PR number.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Jaxsbr/sabstheir own version, first seen Oct 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Jaxsbr/sabs★ 0same name
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 repository48 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- commitSkill
- create-pull-requestSkill
- create-release-branchSkill
- create-release-notesSkill
- qlty-checkSkill
- record-code-review-feedbackSkill
- record-spec-feedbackSkill
- recreate-test-dbSkill
- redmine-playwright-loginSkill
- regression-checkSkill
- rubocopSkill
- speckit-agent-context-updateSkill
- speckit-analyzeSkill
- speckit-branch-convention-configureSkill
- speckit-branch-convention-renameSkill
- speckit-branch-convention-validateSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-git-commitSkill
- speckit-git-featureSkill
- speckit-git-initializeSkill
- speckit-git-remoteSkill
- speckit-git-validateSkill
- speckit-implementSkill
- speckit-planSkill
- speckit-review-codeSkill
- speckit-review-commentsSkill
- speckit-review-errorsSkill
- speckit-review-runSkill
- speckit-review-simplifySkill
- speckit-review-testsSkill
- speckit-review-typesSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
- speckit-token-budget-compactSkill
- speckit-token-budget-conciseSkill
- speckit-token-budget-scopeSkill
- speckit-token-budget-usageSkill
- speckit-wiki-ingestSkill
- speckit-wiki-initSkill
- speckit-wiki-lintSkill
- speckit-wiki-querySkill
- speckit-wiki-statusSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Follow AGENTS.md conventions.
- Distinctive: line 42
Run the affected test files and report the run/failure counts.
- Distinctive: line 50
Every thread gets a reply with its reason, fixed or not, and then gets resolved.
- Very specific: line 54
Not adopted: say why (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Handle PR Review Findings
Review findings are claims about the code, not orders. Some are right, some describe things that were already like that before the PR, and some are right in a way that spreads to files the reviewer never looked at. The job is to check each claim against the repository, fix what is genuinely wrong, and leave a written reason on every thread so the reviewer and later readers can see why it was closed.
Talk to the user in Japanese (project convention); write code, docs, commit-adjacent text and GitHub replies in English.
Phase 1: Collect and verify (read-only)
- Determine the PR: the argument, else
gh pr view --json number -q .number. Fetch the review summary and the inline comments:
gh pr view <PR> --json title,headRefName,reviews,comments gh api repos/{owner}/{repo}/pulls/<PR>/comments --jq '.[] | {id, path, line, body, user: .user.login}'Ignore bot noise that is not a finding (e.g. Codecov), but mention coverage gaps if relevant.
- For each finding, open the code or doc it points to and decide on evidence, not on the reviewer's wording:
- Is the claim true in the current tree? (read the lines, grep the callers, run
git log/git show develop:<file>when the claim is about something that predates the PR) - Did this PR introduce it, or was it already the practice on
develop? Pre-existing practice is normally "not adopted in this PR" and a separate decision. - Does the same defect exist elsewhere that the reviewer did not flag? Grep for the old wording / API name; fixing only the flagged line leaves the same bug one file over.
- Does a test actually exercise the branch? "Never exercised" claims are verified by grepping how the predicate is stubbed.
- Is the claim true in the current tree? (read the lines, grep the callers, run
Phase 2: Report verdicts and stop
Present a table: finding, verdict (valid / not needed), priority, and one or two sentences of evidence with file:line links. Say what the fix would be and whether it needs a feedback record. Then wait. The user's answer to a verdict report is not approval to start editing; proceed only on an explicit instruction such as "fix the valid ones". If a fix would change existing specified behaviour or shared behaviour, raise that before touching it.
Phase 3: Fix the valid findings only
- Follow AGENTS.md conventions. For tests, use
bundle exec ruby -I"lib:test" plugins/redmine_ai_helper/test/...from the Redmine root (neverrails test, and do not migrate the test DB on your own). - New guard or
raisebranches need a test that drives the condition to true and asserts the error; cover streaming and non-streaming paths if both exist. Never add rescue-and-return-empty fallbacks to make a finding go away. - Doc fixes: update every place that states the old behaviour, including ones the reviewer missed. ADRs are append-only once merged, but an ADR added by the same unmerged PR may be corrected.
- Ruby files touched: run
rubocop --ignore-parent-exclusion <files>and fix offenses. - Run the affected test files and report the run/failure counts. If you did not verify something (e.g. that removing the guard makes the new test fail), say so.
Phase 4: Record
For adopted findings that changed code, or docs that contradicted real behaviour, invoke the record-code-review-feedback skill with the PR number and a short list of what was adopted and what was not. Typo-only or wording-only fixes and findings not adopted are not recorded. If the new entry has two or more related earlier entries (the same pattern for at least the third time), propose the promotion as record-code-review-feedback Step 7 describes: the destination, the exact text, and what the rule requires. Then wait for approval.
Phase 5: Reply and resolve every thread
Every thread gets a reply with its reason, fixed or not, and then gets resolved. A bare resolve leaves the reviewer guessing; a reply with a reason on an unfixed finding is what makes closing it legitimate.
Reply wording:
- Fixed: say what changed and where. If nothing is pushed yet, say "Will be included in the next push."
- Not adopted: say why (e.g. pre-existing practice on
develop, out of scope for this PR, reviewer's claim is incorrect) and where it should be handled instead, if anywhere.
Get thread IDs, then reply and resolve:
gh api graphql -f query='query{repository(owner:"OWNER",name:"REPO"){pullRequest(number:PR){reviewThreads(first:50){nodes{id isResolved comments(first:1){nodes{databaseId path}}}}}}}' \
--jq '.data.repository.pullRequest.reviewThreads.nodes[] | [.id, .isResolved, .comments.nodes[0].databaseId, .comments.nodes[0].path] | @tsv'
# per thread: <databaseId> is the comment id, <threadId> is PRRT_...
gh api repos/OWNER/REPO/pulls/PR/comments/<databaseId>/replies -f body="..."
gh api graphql -f query='mutation{resolveReviewThread(input:{threadId:"<threadId>"}){thread{isResolved}}}'Replies and resolves are visible to others and cannot be quietly undone, so only do them after the user has approved the verdicts in Phase 2 and asked for them (the user's instruction to fix and resolve covers it).
Final report
Summarise in Japanese: files changed (as links), test/RuboCop results, what was not adopted and why, the recorded feedback entries, and any promotion proposal. Do not commit or push; tell the user the changes are uncommitted and offer to commit when they ask.
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.

