reviewing-prs
Skill11 starsChanged 3 months agoMITView on GitHub
Load before dispatching any subagent to review or triage a pull request, to pick the correct file version for the branch and worktree state. Required by: advanced-code-review (PR mode), code-review (--pr), distilling-prs (Phase 2), each of which names this skill at its dispatch point. Also use directly when: 'review PR #X', 'is it safe to read local files for this PR', 'why did the review say the bug is not there'.
We split this skill into the rules it gives an agent
10 rules. 0 are common, 5 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Determine review_source First: Never dispatch a PR review subagent without computing review_source.
- Distinctive: line 23
When reviewing a PR via diff, local files are on a different branch.
- Distinctive: line 34
Before dispatching any review subagent, determine which mode applies:
- Very specific: line 37
If neither, the agent is on the wrong branch — DIFF_ONLY mode applies.
- Very specific: line 40
Before dispatching any code review subagent, determine review_source:
- Distinctive: line 67
No local checkout matches the PR.
- Very specific: line 70
All verification functions return INCONCLUSIVE (not REFUTED)
- Distinctive: line 76
Every subagent dispatched to review a PR must receive this context block:
- Distinctive: line 108
Before dispatching any PR review subagent:
- Very specific: line 111
If DIFF_ONLY: does the prompt explicitly prohibit local file reads on changed files?
“Common” is measured: kept by at least 6 in 10 of the 7 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 PRs Safely
<ROLE>
PR Review Safety Inspector. Your reputation depends on never dispatching a review subagent without first determining review_source. A review dispatched without this check produces confidently wrong verdicts — not obvious errors.
</ROLE>Invariant Principles
- Determine review_source First: Never dispatch a PR review subagent without computing
review_source. No exceptions. - DIFF_ONLY Means No Local File Reads: In
DIFF_ONLYmode, local files for changed paths are on the wrong branch. Reading them produces wrong verdicts. - REFUTED Requires Branch-Accurate Source: A
REFUTEDverdict based on a local file read inDIFF_ONLYmode is a wrong verdict. Mark itINCONCLUSIVEor[NEEDS VERIFICATION]. - Inject Review Context Into Every Subagent: The mandatory injection block (mode, SHA, working directory, changed files) is non-optional.
The Wrong-Branch Failure
When reviewing a PR via diff, local files are on a different branch. Reading them produces silently wrong results:
- PR-introduced changes appear absent (local has old code)
- Real bugs get declared "not present" → false REFUTED verdicts
- Findings carry high confidence in factually wrong conclusions
This is a structural failure: the agent reads the wrong version of the file.
Review Source Decision
<analysis>
Before dispatching any review subagent, determine which mode applies:
1. Is there a worktree checked out to the PR branch?
2. Is the local HEAD already at the PR HEAD SHA?
3. If neither, the agent is on the wrong branch — DIFF_ONLY mode applies.
</analysis>Before dispatching any code review subagent, determine review_source:
PR_HEAD_SHA=$(gh pr view <PR_NUMBER> --json headRefOid --jq '.headRefOid')
LOCAL_HEAD=$(git rev-parse HEAD)
PR_BRANCH=$(gh pr view <PR_NUMBER> --json headRefName --jq '.headRefName')
WORKTREE_PATH=$(git worktree list --porcelain | grep -B1 "branch refs/heads/$PR_BRANCH" | grep "^worktree" | awk '{print $2}')| Condition | review_source | Working Directory |
$WORKTREE_PATH is set | LOCAL_FILES | $WORKTREE_PATH |
$LOCAL_HEAD == $PR_HEAD_SHA | LOCAL_FILES | Current repo root |
| Neither | DIFF_ONLY | N/A |
What Each Mode Means
LOCAL_FILES mode
The agent works in a directory that is the PR branch. File reads are authoritative.
- Safe to read changed files
- Safe to verify/refute findings by reading line content
- MUST specify the working directory — the agent must not stray outside it
DIFF_ONLY mode
No local checkout matches the PR. The diff is the only source of truth.
- NEVER read local files from the changed file set
- All verification functions return
INCONCLUSIVE(notREFUTED) - Findings that cannot be verified from the diff are marked
[NEEDS VERIFICATION] - A finding marked
REFUTEDbased on a local file read is a wrong verdict
Mandatory Injection
Every subagent dispatched to review a PR must receive this context block:
## PR Review Context
- PR: #<NUMBER>
- PR HEAD SHA: <SHA>
- Review mode: <LOCAL_FILES | DIFF_ONLY>
- Working directory: <path if LOCAL_FILES, "N/A — use diff only" if DIFF_ONLY>
- Changed files: <list>
If review mode is DIFF_ONLY:
- Do NOT read any files listed under "Changed files" from the local filesystem
- The diff is the only authoritative source for those files
- Mark any finding you cannot verify from the diff as [NEEDS VERIFICATION]
- Do NOT mark a finding REFUTED based on local file contentWhy Worktrees Are the Clean Solution
Checking out a PR branch in a worktree converts a DIFF_ONLY review into a LOCAL_FILES review. The agent gets safe, branch-accurate file reads without polluting the main working tree.
# Check out PR branch in a worktree
git worktree add ~/.local/worktrees/pr-<NUMBER> <PR_BRANCH>Once the worktree exists, dispatch the review agent with working_directory: ~/.local/worktrees/pr-<NUMBER>.
Self-Check
<reflection>
Before dispatching any PR review subagent:
- Was review_source determined before anything else?
- Does the subagent prompt include the mandatory injection block?
- If DIFF_ONLY: does the prompt explicitly prohibit local file reads on changed files?
</reflection>Before dispatching any PR review subagent:
PR_HEAD_SHAfetched from GitHub (not guessed)review_sourcedetermined:LOCAL_FILESorDIFF_ONLY- If
LOCAL_FILES: exact working directory specified in prompt - If
DIFF_ONLY: prompt explicitly forbids local file reads on changed files - Changed file list included so agent knows what is "in scope"
<FORBIDDEN>
- Dispatching a PR review subagent without computing `review_source` first
- Allowing the agent to default to reading local files when `review_source == DIFF_ONLY`
- Treating a `REFUTED` verdict from a local file read as valid in `DIFF_ONLY` mode
- Skipping the worktree check — a worktree converts a lossy review into an accurate one
</FORBIDDEN><FINAL_EMPHASIS> The wrong-branch problem produces confident wrong answers, not obvious errors. An agent that reads the wrong version of a file will declare "this bug does not exist" with full conviction. The only defense is checking the review source before dispatch — every time. </FINAL_EMPHASIS>
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- medusajs/medusa★ 37ksame name
- future-agi/future-agi★ 2.2ksame name
- flutter/devtools★ 1.7ksame name
- MultiQC/MultiQC★ 1.5ksame name
- portabletext/editor★ 284same name
- danshapiro/freshell★ 98same name
- jjsizemore/jjskills★ 1same 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 repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- documentation-updatesSkill
- spellbook-auditingSkill
- advanced-code-reviewSkill
- adversarial-reviewSkill
- agent2agentSkill
- analyzing-domainsSkill
- analyzing-skill-usageSkill
- assembling-contextSkill
- async-await-patternsSkill
- auditing-green-mirageSkill
- autonomous-modeSkill
- branch-contextSkill
- code-reviewSkill
- creating-issues-and-pull-requestsSkill
- debuggingSkill
- dedupeSkill
- deep-researchSkill
- dehallucinationSkill
- design-explorationSkill
- designing-workflowsSkill
- developSkill
- devils-advocateSkill
- dispatching-parallel-agentsSkill
- distilling-prsSkill
- documenting-projectsSkill
- documenting-toolsSkill
- emotional-stakesSkill
- enforcing-code-qualitySkill
- estimating-ticketsSkill
- executing-plansSkill
- fact-checkingSkill
- finding-dead-codeSkill
- finishing-a-development-branchSkill
- fixing-testsSkill
- fractal-thinkingSkill
- gathering-requirementsSkill
- generating-diagramsSkill
- instruction-engineeringSkill
- isolated-testingSkill
- managing-artifactsSkill
- merging-worktreesSkill
- opportunity-awarenessSkill
- optimizing-instructionsSkill
- polish-repoSkill
- reflexionSkill
- requesting-code-reviewSkill
- resolving-merge-conflictsSkill
- reviewing-design-docsSkill
- reviewing-impl-plansSkill
- rounding-up-worktree-sessionsSkill
- sharpening-promptsSkill
- smart-readingSkill
- test-driven-developmentSkill
- testing-strategySkill
- tooling-discoverySkill
- using-git-worktreesSkill
- using-lsp-toolsSkill
- using-skillsSkill
- The first 60 shown.
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.

