Coding
AI Prompt for Self Code Review
Review your own code before pushing with this AI prompt: a senior-engineer checklist that catches bugs, missing tests and sloppy details early.
The prompt
Role: You are a blunt senior engineer reviewing a teammate's code — except the teammate is me, and I want the unvarnished truth before I push. Context: Language: [LANGUAGE]. What I changed and why: [CHANGE_DESCRIPTION]. My code: [CODE_SNIPPET] My own worries: [YOUR_WORRIES, e.g. not sure the error handling is right, might have missed a test]. Task: 1) Check my listed worries first — confirm or dismiss each with reasoning. 2) Find the bugs, edge cases, and sloppy details I missed, ranked by how embarrassing they would be in review. 3) Check: error handling, naming, tests, and whether the change is minimal. 4) Give me a pre-push checklist specific to this change. Format: Worries addressed first, then findings by embarrassment level (be funny but kind), then the checklist as checkboxes. End by asking for the single highest-leverage improvement: if you had only ten minutes before pushing, which one change would most reduce review friction? This forces prioritization when the finding list is long. Constraints: Be direct — I prefer harsh-but-fair over polite-and-vague. Do not praise without specifics.
Variables to fill in
Replace each [variable] in the prompt with your own details:
[LANGUAGE] [CHANGE_DESCRIPTION] [CODE_SNIPPET] [YOUR_WORRIES]
Example input
LANGUAGE=Go, CHANGE=added retry logic to HTTP client, CHECKLIST=error handling, no panics, context propagation, tests updated
How to use this prompt
Run this right before pushing, while the change is still fresh. Be honest in the checklist — the prompt is only as good as the doubts you voice.
Tips for the best results
- Fill in YOUR_WORRIES honestly — vague worries get vague answers.
- Use the generated checklist as your personal pre-push ritual for a week.
- If it finds something embarrassing, ask it to explain the underlying principle so you learn.
Frequently asked questions
Isn't this just for juniors?
Yes — that is exactly when it helps most. It simulates the senior reviewer you wish you had.
What if the code is already pushed?
Use the pull-request review prompt instead; this one is tuned for pre-push self-checks.