skills/cmd-pr-review-prepare/SKILL.md
Prepare branch for code review by building context, identifying issues, and suggesting improvements
npx skillsauth add olshansk/agent-skills cmd-pr-review-prepareInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Your goal is to help me do a code review as we pick up work from a branch we worked on previously.
You are one of my code reviewing buddies for this branch. Note that you may be one of several instances of Claude Code that I'm using in parallel to review this branch.
Along the way, don't hesitate to ask questions and build plans. Be pragmatic. Don't over engineer or write long unnecessary documentation.
Default (no scope specified): diff the current branch against the repo's base branch.
Detect the base branch in order — stop at the first success:
gh repo view --json defaultBranchRef -q '.defaultBranchRef.name' 2>/dev/nullgit remote show origin 2>/dev/null | grep "HEAD branch" | cut -d: -f2 | xargsgit symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'Do not assume main or master. If all methods fail, ask the user.
Once resolved, run:
git diff <base>...HEAD -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml" ":(exclude)package.json"
If the user specifies a scope, use the corresponding command instead:
| Scope | Command | What it covers |
|---|---|---|
| unstaged | git diff HEAD -- <excludes> | All uncommitted changes (staged + unstaged) |
| last commit / last 1 commit | git diff HEAD~1...HEAD -- <excludes> | Changes in the most recent commit |
| last N commits | git diff HEAD~N...HEAD -- <excludes> | Changes in the last N commits |
| entire repo | git ls-files \| grep -vE "\.(lock\|snap)$\|package-lock\.json\|pnpm-lock\.yaml" | All tracked source files; no diff — build full repo context (structure, tech stack, key entry points, recent history) |
For all diff commands, apply: -- ":(exclude)*.lock" ":(exclude)package-lock.json" ":(exclude)pnpm-lock.yaml" ":(exclude)package.json"
testnet or staging branches, prefer diffing against those instead of the auto-detected default branch.Are there opportunities to:
Make sure:
testing
Ask the agent whether it finished everything or has more to do — a lightweight completeness gate for the end of any task
development
Audit personal skills for redundancy, verbosity, weak triggers, and overlap. Runs a Claude→Codex review loop, presents per-item approval checkboxes, then applies approved edits and updates README and agent metadata. Use when asked to "review my skills", "audit my skills", "revisit my skills", or "clean up my skills". Accepts an optional skill name to scope the review to a single skill.
development
Set up or extend golden/snapshot tests for a project. Covers fixture design, Makefile targets, snapshot storage, diff workflow, and update protocol.
development
Proofread posts before publishing for spelling, grammar, repetition, logic, weak arguments, broken links, and optionally reformat for skimmability or shape the writing vibe toward a known author's style