Self-review a branch before opening a PR
Reviews your own branch the way a strict reviewer would, catches debug leftovers, unrelated changes, missing tests and leaked secrets, and runs the checks. Use before requesting review.
Reviewers spend most of their time on problems the author could have caught alone: a forgotten debug print, a file changed by accident, a test that was never run. A self-review pass before asking for review shortens the review and keeps the reviewer's attention on design and correctness.
Review the changes on the current branch compared with .
- Get the diff with
git diff def:base...HEADand the commit list withgit log def:base..HEAD. Also checkgit statusfor uncommitted or untracked files that look like they belong in the change. - Read the whole diff and write one sentence describing what the change does. Every hunk should serve that sentence.
- Look for:
- Leftovers: debug prints, commented-out code,
TODOorFIXMEadded in this branch, temporary files, focused or skipped tests (.only,xit,@Ignore,t.Skip). - Unrelated changes: reformatting, renames or edits outside the purpose of the change.
- Secrets and personal data: keys, tokens, passwords, internal hostnames, real customer data in fixtures.
- Missing tests: changed behaviour with no test that would fail without the change.
- Defects you can see: unhandled errors, wrong conditions, null or empty inputs, resource leaks.
- Generated or lock files changed without the source change that explains them.
- Run the checks and report the real result of each. Only if [CHECKS] is given: Run exactly these: If no commands are listed in this step, run the test, lint and type-check commands the project defines (look in the README, CI config, package scripts, Makefile or equivalent).
- Report, do not edit. The author decides what to change.
- Cite
path:linefor every finding. - Separate blockers (would fail review or break something) from cleanups (worth fixing, not blocking).
- If you find what looks like a real secret, say which file and line, and tell the author to rotate it. Do not repeat the secret value.
- Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
- If the information you need is not available, say what is missing and how to get it instead of inventing it.
- Before saying the work is done, run the check that proves it (tests, build, type check or the command the user gave) and report the real result.
- If you could not run a check, say so plainly and say which one.
Ready
yes or no, then one sentence.
Blockers
Numbered: path:line, the problem, the fix. Or "None".
Cleanups
Bullets: path:line and what to clean. Or "None".
Checks
Each command, pass or fail, and the first relevant error line for failures. Say plainly if a check could not run.
Notes for the reviewer
Two or three bullets: what the change does, where to look first, anything deliberately left out.
Every required value is filled in. Copy gives the finished prompt.
details
- kind
- Prompt: a task you run by name to get one finished thing back
- domain
- Software engineering
- category
- Code review
- level
- Beginner
- made for
- Software engineer
- needs
- repo-read, git, shell
- risk
- runs-commands
- version
- v1.0.0 · incubating
- reviewed
- 2026-10-02
- works in
- Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md
use in
npx @hermes-hq/hodios install self-review-before-pr --target claude-codenpx skills add hermes-hq/hodios-dist --skill self-review-before-pr -a claude-codeclaude plugin marketplace add hermes-hq/hodios-distclaude plugin install hodios-software-engineering@hodiosThe plugin brings every entry in this domain at once.
pairs well with
All of Code reviewReview a pull request
Reviews a pull request diff for correctness bugs, risky changes and missing tests, and returns ranked findings. Use before merging a PR, branch or diff.
review-pull-requestCode reviewer
Reviews changes like a senior engineer who blocks only on real defects, backs every finding with a triggering input, and keeps style opinions out. Use as a reviewer persona or subagent.
code-reviewerRespond to code review comments
Triages each review comment as fix, discuss or decline with a reason, drafts the replies, and applies the agreed fixes. Use when a pull request comes back with reviewer feedback.
respond-to-review-commentsReview AI-generated code
Reviews code written by an AI assistant for hallucinated APIs, over-engineering, swallowed errors, weakened tests and copy-paste drift. Use before merging a change an agent produced.
review-ai-generated-codeReview an API change for breaking changes
Reviews an API diff or spec for changes that break existing clients, such as removed fields, changed semantics, new defaults, error changes and versioning gaps. Use before releasing.
review-api-breaking-changesReview a diff for shipping risks
Assesses what can go wrong when a change reaches production, such as broken contracts, unsafe migrations, rollout order and rollback, and proposes mitigations. Use before deploying a risky change.
review-diff-for-risks