branch-review-before-pr
Skill15 starsChanged 8 months agoApache-2.0View on GitHub
Pre-landing PR review. Analyzes diff against main for structural issues that tests don't catch: query safety, race conditions, trust boundary violations, conditional side effects, and more. Critical findings block /ship and /create-pr. Invoke via /branch-review-before-pr or when integrated as a gate in ship workflows.
In this repository63 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- ast-grepSkill
- branch-review-before-prSkill
- browse-qaSkill
- browser-useSkill
- browseSkill
- bugfixSkill
- build-dmgSkill
- claude-reviewSkill
- codemapSkill
- code-simplifySkill
- codex-reviewSkill
- commitSkill
- cost-estimateSkill
- create-prSkill
- find-agentsSkill
- find-bugsSkill
- frontend-design-ui-uxSkill
- git-merge-expertSkill
- git-merge-expert-worktreeSkill
- kiro-reviewSkill
- laravel-filamentSkill
- laravelSkill
- lokeiSkill
- map-project-monorepoSkill
- map-projectSkill
- nextjsSkill
- plan-founder-reviewSkill
- plan-to-task-list-with-dagSkill
- pr-retroSkill
- run-parallel-agents-feature-buildSkill
- run-parallel-agents-feature-debugSkill
- rustSkill
- secretsSkill
- startSkill
- update-agent-learningsSkill
- update-claude-learningsSkill
- update-claude-settingsSkill
- update-skill-learningsSkill
- ast-grepSkill
- codemapSkill
- code-simplifySkill
- commitSkill
- cost-estimateSkill
- create-prSkill
- find-bugsSkill
- frontend-design-ui-uxSkill
- git-merge-expertSkill
- git-merge-expert-worktreeSkill
- map-project-monorepoSkill
- map-projectSkill
- plan-founder-reviewSkill
- plan-to-task-list-with-dagSkill
- pr-retroSkill
- run-parallel-agents-feature-buildSkill
- run-parallel-agents-feature-debugSkill
- startSkill
- update-agent-learningsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 12 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Run git branch --show-current to get the current branch.
- Distinctive: line 19
If on main (or master), output: "Nothing to review — you're on main or have no changes against main." and stop.
- Very specific: line 20
Run git fetch origin main --quiet && git diff origin/main --stat to check if there's a diff.
- Very specific: line 26
Read the checklist file located alongside this skill at the relative path checklist.md (same directory as this SKILL.md).
- Distinctive: line 28
If the file cannot be read, STOP and report the error: Do not proceed without the checklist.
- Very specific: line 40
Run git diff origin/main to get the full diff.
- Distinctive: line 42
If the diff is very large, also get the file list and read changed files individually:
- Distinctive: line 48
Read the FULL diff before commenting: Do not flag issues already addressed in the diff.
- Distinctive: line 57
Pass 2 (INFORMATIONAL): All remaining categories from the checklist
- Distinctive: line 59
Follow the output format specified in the checklist.
- Distinctive: line 91
After all critical questions are answered, output a summary of what the user chose for each issue.
- Very specific: line 93
If the user chose (A) on any issue: apply the recommended fixes to those files.
- Distinctive: line 94
If only (B) or (C) were chosen: no action needed.
- Distinctive: line 103
Read-only by default: Only modify files if the user explicitly chooses "Fix it now" on a critical issue.
- Distinctive: line 106
Respect suppressions: If the checklist says don't flag it, don't flag it.
- Distinctive: line 107
Scope to the diff: Do not review unchanged code.
≈ “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
Pre-Landing Branch Review
You are running the /branch-review-before-pr workflow. Analyze the current branch's diff against main for structural issues that tests don't catch.
Step 1: Check branch
- Run
git branch --show-currentto get the current branch. - If on
main(ormaster), output: "Nothing to review — you're on main or have no changes against main." and stop. - Run
git fetch origin main --quiet && git diff origin/main --statto check if there's a diff. If no diff, output the same message and stop.
Step 2: Read the checklist
Read the checklist file located alongside this skill at the relative path checklist.md (same directory as this SKILL.md).
If the file cannot be read, STOP and report the error. Do not proceed without the checklist.
Step 3: Get the diff
Fetch the latest main to avoid false positives from a stale local main:
git fetch origin main --quietRun git diff origin/main to get the full diff. This includes both committed and uncommitted changes against the latest main.
If the diff is very large, also get the file list and read changed files individually:
git diff origin/main --name-onlyRead the FULL diff before commenting. Do not flag issues already addressed in the diff.
Step 4: Two-pass review
Apply the checklist against the diff in two passes:
- Pass 1 (CRITICAL): Query & Data Safety, Race Conditions & Concurrency, Auth & Trust Boundaries
- Pass 2 (INFORMATIONAL): All remaining categories from the checklist
Follow the output format specified in the checklist. Respect the suppressions — do NOT flag items listed in the suppressions section.
Step 5: Output findings
Always output ALL findings — both critical and informational. The user must see every issue.
Output format:
Branch Review: N issues (X critical, Y informational)
CRITICAL (blocking):
- [file:line] Problem description
Fix: suggested fix
Issues (non-blocking):
- [file:line] Problem description
Fix: suggested fixIf no issues found: Branch Review: No issues found.
If CRITICAL issues found: Output all findings, then for EACH critical issue use a separate AskUserQuestion with:
- The problem (
file:line+ description) - Your recommended fix
- Options:
- (A) Fix it now — apply the recommended fix
- (B) Acknowledge — ship anyway, you understand the risk
- (C) False positive — skip, this isn't actually a problem
After all critical questions are answered, output a summary of what the user chose for each issue.
- If the user chose (A) on any issue: apply the recommended fixes to those files. Do NOT commit — the user or
/shipwill handle that. - If only (B) or (C) were chosen: no action needed.
If only informational issues found: Output findings. No further action needed. These go into the PR body when used with /create-pr.
Important Rules
- Read the FULL diff before commenting. Do not flag issues already addressed in the diff.
- Read-only by default. Only modify files if the user explicitly chooses "Fix it now" on a critical issue. Never commit, push, or create PRs.
- Be terse. One line problem, one line fix. No preamble, no summaries, no "looks good overall."
- Only flag real problems. Skip anything that's fine. A clean review is a valid outcome.
- Respect suppressions. If the checklist says don't flag it, don't flag it.
- Scope to the diff. Do not review unchanged code. Only the branch diff is in scope.
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.

