Self-review before PR

Runs a checklist pass over your own diff before opening a pull request, catching debug leftovers, dead code, secrets, missing tests, poor naming, scope creep and migration or config impact. Use when the user is about to open a PR or says the work is done.

Code reviewPack: Code Review97 linesself-review-before-pr

Install

Run one command — it saves SKILL.md into your agent's skills folder. Restart the agent and the skill is picked up automatically.

Claude Code — macOS, Linux
mkdir -p ~/.claude/skills/self-review-before-pr && curl -fsSL https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md -o ~/.claude/skills/self-review-before-pr/SKILL.md
Codex, Cursor — macOS, Linux
mkdir -p ~/.agents/skills/self-review-before-pr && curl -fsSL https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md -o ~/.agents/skills/self-review-before-pr/SKILL.md
Claude Code — Windows PowerShell
New-Item -ItemType Directory -Force "$HOME\.claude\skills\self-review-before-pr" | Out-Null; Invoke-WebRequest https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md -UseBasicParsing -OutFile "$HOME\.claude\skills\self-review-before-pr\SKILL.md"
Codex, Cursor — Windows PowerShell
New-Item -ItemType Directory -Force "$HOME\.agents\skills\self-review-before-pr" | Out-Null; Invoke-WebRequest https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md -UseBasicParsing -OutFile "$HOME\.agents\skills\self-review-before-pr\SKILL.md"

Any other agent: save the file into its skills folder, or give it the link to the file: https://anymodel.org/en/skills/code-review/self-review-before-pr/SKILL.md

SKILL.md

Raw

Self-Review Before PR

Read your own diff as if a stranger wrote it. Everything you catch here is a review round trip you save.

1. Look at exactly what will be submitted

git fetch origin
git status --short
git diff origin/main...HEAD --stat
git diff origin/main...HEAD
git diff                      # anything unstaged or forgotten?
git diff --staged              # staged but not committed
git ls-files --others --exclude-standard   # untracked files

Read the whole diff top to bottom once without fixing anything, then go through the checklist below and fix.

2. Checklist

Leftovers:

  • Debug output: console.log, print, dbg!, debugger, TODO/FIXME you added, commented-out code.
  • Temporary files, local scripts, logs, .bak files, editor settings, build output accidentally tracked.
  • Focus and skip markers left in tests (.only, fit, .skip, xit, @pytest.mark.skip, t.Skip).

Secrets and private data:

  • API keys, tokens, passwords, private URLs, real emails or phone numbers, internal hostnames in code, tests, fixtures or docs.
  • .env files or credentials staged. If found, stop and tell the user; the secret must be rotated, not just deleted.

Scope:

  • Every changed file is related to the stated goal. Unrelated reformatting, drive-by renames or lockfile churn should be split into a separate commit or PR.
  • Diff size is reviewable. If it is huge, propose a split into independent commits or PRs.

Correctness:

  • Edge cases handled: empty input, null, large input, errors from network or disk.
  • Error paths do something sensible and do not swallow exceptions silently.
  • No hardcoded values that belong in config.

Tests:

  • New behavior has a test; a bug fix has a test that fails without the fix.
  • The test suite, linter, formatter and type checker pass locally. Run them and note the result.
  • Tests assert behavior, not only that code runs.

Naming and clarity:

  • Names say what things are; no leftover tmp, data2, foo.
  • Comments explain why, not what; outdated comments updated or removed.
  • Public APIs, docs and README updated if behavior changed.

Impact outside the code:

  • Database migrations: reversible, safe on big tables, deploy order considered.
  • Config and environment: new env vars documented and added to examples and deployment files.
  • Dependencies: every new package is needed and intended; lockfile changes match.
  • Backward compatibility: API shape, CLI flags, file formats, events consumed by others.
  • Rollout and rollback: can this be deployed safely, and undone?

3. Commits and branch

git log --oneline origin/main..HEAD
  • Commit messages are clear and follow the repo's convention; no "wip" or "fix fix".
  • The branch is based on a recent main (git merge-base --is-ancestor origin/main HEAD && echo "main included" || echo "behind main"; the command itself answers only with its exit code). If not, offer to rebase or merge and ask before rewriting shared history.

4. Output format

Fix what is safe to fix (leftovers, naming, missing tests the user asked for) and report:

Ready to open PR: yes / no
Fixed during self-review: <list>
Needs your decision: <list, e.g. split the PR, rotate a leaked key>
Checks run: <commands and results>
Risks to mention in the PR description: <migration, env var, behavior change>

Pitfalls

  • Do not skip the untracked-files check; forgotten new files break CI.
  • Do not "clean up" unrelated code while at it; that is the scope creep you are looking for.
  • Do not delete files, rewrite history or force-push without asking the user.
  • Do not claim tests pass unless you ran them in this session.
  • Do not open the PR yourself unless the user asked for it.

Source: AnyModel skills catalog · License: CC BY 4.0

Connect through AnyModel API

This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.

More from the pack Code Review