Ppdd.bot
中EN

Self-review before the PR

Review the change for correctness, security, performance, consistency, and maintainability; fix, log, or explain each finding.

SKILL.mdmarkdown · 35 lines
---
name: review
description: >
Before opening a PR, review your own changes from the top and deal with what you find.
Use when the code is done and a PR is next, or when the user says "review this" or "check your work".
It doesn't replace human review.
---
# Self-review before the PR
## Steps
1. Run [check command] first. Lint, types, and tests are green before the review starts. Don't make the review find compile errors.
2. Set the scope: `git diff [main]...HEAD`, committed and uncommitted changes alike. Go file by file.
3. Check each file on five points:
- Correctness: is the logic complete? Are edge cases, nulls, and error paths handled?
- Security: injection, missing authorization, leaked secrets or personal data
- Performance: queries inside loops, unclosed resources, repeated work
- Consistency: does it follow the project's existing patterns, naming, and layout?
- Maintainability: duplicated code, needless complexity, names nobody can read
4. Compare with the spec or ticket: is everything asked for done? Is anything done that wasn't asked for?
5. List findings as `[file:line] category - problem → suggestion` and handle each one of three ways:
- Fix: change it and rerun the checks
- Log: it should be fixed but is out of scope, so it goes in [docs/ledger/]
- Decline: say why in one sentence
6. If you changed code, review again until nothing new comes up.
7. Record the result under Validation in the PR description: how many rounds, how many fixes, which findings you declined and why.
## If your agent has a review command, use it
If your agent ships one (Claude Code's `/code-review`, for example), let it do steps 2–4 and follow steps 5–7 as written.
For billing, auth, data migrations, or deleting data, use its strictest level.
## Don't
- Don't let a tool apply fixes and commit them unseen. Look at the changes first.
- Don't skip it because the diff "looks fine". If you didn't review, say so in the PR.
- Don't leave a finding as a "follow up later" line in chat.