pre-pr-review
Installation
SKILL.md
pre-pr-review
Disciplined self-review before commit / before PR. The goal is to catch what automated tools won't, and to run the things they will.
This skill is stack-agnostic. It will not tell you which lint / typecheck / test commands to run — that depends on the project. Use the project's CLAUDE.md (or equivalent) for the exact commands; this skill provides the thinking framework.
Step 1 — Pull the diff
git status
git add -N . # intent-to-add: surfaces untracked new files in the diff (without staging them)
git diff # working tree
git diff --staged # staged
# Auto-detect the default branch instead of hardcoding main/master/develop:
MAIN_BRANCH=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's@^origin/@@')
MAIN_BRANCH=${MAIN_BRANCH:-$(git remote show origin 2>/dev/null | sed -n 's/.*HEAD branch: //p')} # network fallback
git diff "${MAIN_BRANCH:-main}"...HEAD # everything since branching off