hermes

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.

context

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.

task

Review the changes on the current branch compared with .

  1. Get the diff with git diff def:base...HEAD and the commit list with git log def:base..HEAD. Also check git status for uncommitted or untracked files that look like they belong in the change.
  2. Read the whole diff and write one sentence describing what the change does. Every hunk should serve that sentence.
  3. Look for:
  • Leftovers: debug prints, commented-out code, TODO or FIXME added 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.
  1. 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).
constraints
  • Report, do not edit. The author decides what to change.
  • Cite path:line for 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.
output format

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

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install self-review-before-pr --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill self-review-before-pr -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Code review
PromptCode review

Review 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-request
PersonaCode review

Code 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-reviewer
PromptCode review

Respond 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-comments
PromptCode review

Review 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-code
PromptCode review

Review 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-changes
PromptCode review

Review 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