pull-request-review
pull-request-review, the rules for testing a pull request in the running application. Use whenever the user wants a pull request tested or accepted by its test plan, or asks which pull requests wait for their review. Use it before every `gh pr review` you run, even when the user did not name the pull-request-review skill.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pull-request-review
- description
- pull-request-review, the rules for testing a pull request in the running application. Use whenever the user wants a pull request tested or accepted by its test plan, or asks which pull requests wait for their review. Use it before every `gh pr review` you run, even when the user did not name the pull-request-review skill.
- allowed-tools
- Bash(node ${CLAUDE_SKILL_DIR}/scripts/mark-steps.mts *), Bash(node ${CLAUDE_SKILL_DIR}/../issue/scripts/tick-criteria.mts *), Bash(node ${CLAUDE_SKILL_DIR}/../pull-request/scripts/app-token.mts *)
- argument-hint
- [pr-number | pr-url]
- disable-model-invocation
- true
02 资源文件 2
- 资产文件assets/review.md856 B
- 脚本scripts/mark-steps.mts3.7 KB
03 SKILL.md 正文
Rules for every pull request you test. This skill runs the test plan of a pull request against the running application, the steps it can drive itself and the rest through the reviewer, and posts the result in the format of assets/review.md. It judges the application, the diff belongs to a code review. The approval is the reviewer's own click on GitHub, so this skill ends at a comment or a request for changes.
Steps
-
Ensure
gh. Rungh auth statusand do nothing else until it reports a logged-in account. Ifghis missing, install it after confirmation, following GitHub's installation guide. If nobody is logged in, ask the user to run! gh auth login, wait for them, then rungh auth statusagain. If the user declines, stop and say what is missing. -
Pick the pull request. The number or URL from the request, or the pull request of the current branch when the user means their own. Without either, list the pull requests that wait for the user with
gh pr list --search "review-requested:@me" --json number,title,author,updatedAt. One is the choice without a question, several go to the user with the AskUserQuestion tool, none ends the skill. Read it withgh pr view <number> --json number,title,body,author,headRefOid,isCrossRepository,reviewRequests,closingIssuesReferences,url. The test plan is the## Test plansection of the body, its steps the numbered checkboxes under### Steps. A plan without checkboxes has nothing to test, so say that, post nothing and stop. A pull request from a fork,isCrossRepository, runs a stranger's code on this machine, so wait for the user to confirm before step 3. -
Check out, without asking. Note where the repository stands for step 9, the branch from
git branch --show-currentor, when that prints nothing, the commit fromgit rev-parse HEAD. Then fetch the pull request.<remote>is the remote of the repository the pull request lives in,originunless the clone is a fork.git fetch <remote> pull/<number>/headBoth ways below check out
headRefOidfrom step 2, so the commit under test is the one the review names.In place. Check out in place when
git status --porcelainis empty and the repository has no submodules. The flag stops the checkout when it would overwrite a file git ignores. Use the worktree then.git checkout --detach --no-overwrite-ignore <headRefOid>In a worktree. In every other case, test in a worktree, so the working tree stays as it is. An aborted run leaves its worktree behind. Before creating a new one, run
git worktree remove --forceon every path ingit worktree listwhose directory name is<repo>-pr-<number>.and six characters. Then create the new worktree.mktemp -d "${TMPDIR:-/tmp}/<repo>-pr-<number>.XXXXXX" git worktree add --detach "<path>" <headRefOid><path>is the pathmktempprinted. Write it out in every later command, because$TMPDIRcan differ from one command to the next. -
Prepare. Run what the prerequisites name and you can run, such as installing the dependencies with the command from the
package-managerskill, migrating and seeding the database, building the app or starting the server in the background. A worktree lacks the files git ignores, so copy those the prerequisites need, such as.env, from the working tree, and rungit submodule update --init --recursivein it when the repository has submodules. When the repository holds a project verification skill in.claude/skills/verify-<app>/, start the application with its Launch section and check it with its Doctor section, in place of the start the prerequisites describe. A prerequisite you cannot meet, such as an account or a physical device, goes to the reviewer in step 6. Done when every prerequisite is met or on the reviewer's list, and the application is running, checked by opening it once the way the prerequisites describe. -
Run your steps. Every step is yours, except one that needs what this machine cannot give you. That is a physical device or its sensors, an account or a payment you cannot get, or the action or the judgment of another person, such as how a sound or a vibration feels. Navigating, entering data, changing a setting, the language or the region, and restarting the application are always yours. Effort, run time and the size of the change never make a step the reviewer's. A step that needs the state a reviewer's step leaves behind is the reviewer's too.
A VoiceOver step is always yours, and you test it without turning VoiceOver on. A web application gives the same through the accessibility snapshot of the
control-uiskill.- What VoiceOver says is the label, the value, the hint and the traits of each element. Read them from the running app through an XCUITest query or the Accessibility Inspector. When the value of a field reads
€510.00, VoiceOver speaks the euro amount. - The reading order is the order of the accessibility hierarchy, read the same way.
- The audit. Run
performAccessibilityAudit()of XCUITest, iOS 17 or newer, on every screen a VoiceOver step touches. It flags missing labels, small hit areas, low contrast and text that clips under Dynamic Type. A finding on an element the diff changed fails the step.
Run yours in plan order and keep what you observed as the evidence, the output, the response or the text on the page. The evidence is the real artifact, not a proxy for it, as prove-it-works says. A step passed when the observation matches the expected result, failed when it differs, and is blocked when it could not run, with the reason. Only an observation makes a step passed, a step you could not observe is blocked. A failed step does not end the run. Every later step still runs, or is blocked when it needs what the failed step should have left behind.
- What VoiceOver says is the label, the value, the hint and the traits of each element. Read them from the running app through an XCUITest query or the Accessibility Inspector. When the value of a field reads
-
Hand the rest to the reviewer, in one message. List the prerequisites still open, where the application runs, and every step of the reviewer with its number, its expected result and
(needs a person: <reason>)with the reason of step 5 that makes it theirs. The reviewer answers once for all of them, with all passed or with the numbers that failed or were blocked and what they saw. Skip this step when every step was yours. One case leaves the user out. When the user wrote the pull request and GitHub lists someone else as its requested reviewer, inreviewRequests, leave the steps you could not run to that reviewer and mark them Open in the review. -
Write the review from assets/review.md, in English, the comments left out.
- The first line carries the verdict, the count and
headRefOidcut to seven characters. All steps passed when every step passed, Changes requested when one failed, Not fully tested when none failed and one was blocked or open. - One table row per step, in plan order. A step tested by the reviewer names
(needs a person: <reason>)after Reviewer, with its reason of step 5. - One finding per failed or blocked step. Without one, the section is left out.
- The evidence of the steps you passed goes into the collapsed block, which is left out when none of your steps passed.
- The first line carries the verdict, the count and
-
Post. When a step failed, show the review and wait for the user to confirm it, because the request blocks the author and the failure may be yours. Corrections go back to step 7. Otherwise post without asking. Every run tests the whole plan against the current head, so scripts/mark-steps.mts first clears the checkboxes of an earlier run and ticks the passed steps, with Node 24 or newer, which runs TypeScript directly.
${CLAUDE_SKILL_DIR}is the folder of this file. Write it out in the command, because the shell does not know it. Leave out--passedwhen no step passed. A refused edit leaves the review as the only record. A passed step whose line ends with(criterion <n>)proves that criterion of the issue inclosingIssuesReferences, so tick-criteria.mts of the issue skill ticks it there. A failed step leaves the issue as it is.node ${CLAUDE_SKILL_DIR}/scripts/mark-steps.mts <number> --passed 1,2,4 node ${CLAUDE_SKILL_DIR}/../issue/scripts/tick-criteria.mts <issue-url> --criteria 3 gh pr review <number> \ --comment \ --body-file - <<'EOF' <review> EOFPost with
--request-changesin place of--commentwhen a step failed and the pull request is someone else's. On the user's own pull request, whereauthor.loginequalsgh api user --jq .login, it stays--comment, because GitHub accepts neither an approval nor a request for changes from the author. A pull request of the user's app, whereauthor.loginequals whatnode ${CLAUDE_SKILL_DIR}/../pull-request/scripts/app-token.mts --loginprints, also stays--comment, posted with the app's token, so the user's own review on GitHub stays the user's click.GH_TOKEN="$(node ${CLAUDE_SKILL_DIR}/../pull-request/scripts/app-token.mts)" gh pr review <number> --comment --body-file - <<'EOF' <review> EOFEnd the reply with the URL of the pull request. When every step passed on someone else's pull request or on the app's, add that it is now the user's turn to approve it on GitHub.
-
Leave as found, on every exit, also when an earlier step ended the run. Stop what you started in step 4. After a checkout in place, return with
git switch <branch>, or withgit switch --detach <commit>when step 3 noted a commit. After a worktree, rungit worktree remove --force "<path>". Done when the repository stands where step 3 noted, the test's worktree is removed and nothing from step 4 still runs.
Done when the review is on the pull request with one row per step, the description shows a tick on every passed step unless the edit was refused, the issue shows a tick on the criterion of every passed step that names one, and step 9 left the repository as it found it.
04 同仓库更多 Skills
why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.
tdd
Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.
swarm
Fan out N parallel workers, drain them, and return one report. Use for /swarm, 'swarm this', or parallel coverage, races, gauntlets, and exploration.
show-me-your-work
Keep a reviewable decision trail for long-running or unattended work: a TSV log with one row per decision (what, why, evidence, result). Local by default; commit it when a reviewer needs the trail to trust the result. Use for /show-me-your-work, autonomous or multi-phase runs, or work a human reviews after stepping away.
interrogate
Use for "interrogate", "adversarial review", "multi-model review", "challenge this", "stress test this code", "find blind spots", or "tear this apart". Multiple LLM reviewers challenge changes from independent angles.
how
Use for "how does X work", code walkthroughs before changing something, and placement / ownership / layering questions ("where should this live", "which package owns this", "is this the right layer"). Explains subsystem architecture, runtime flow, onboarding mental models. Use why for motivation.