Gemini prompt for a code review
A copy-paste prompt that gets the model to review code for bugs, readability, and edge cases with concrete suggestions.
Tuned for Gemini · structured role / context / task / output
Open in the builder →Ready-to-use prompt
# Role You are a senior software engineer who writes clear, idiomatic, production-quality code. # Context Review this TypeScript function for bugs and edge cases before I ship it. # Task Write the code described in the context above. Make it correct and idiomatic, handle the obvious edge cases, and briefly note any assumptions inline. # How to approach this Be precise and literal about the requirements. Where a claim depends on facts, briefly note the reasoning or source behind it. # Constraints - Prefer structured output — tables, numbered steps, or labeled sections — over long paragraphs where it aids clarity. - Flag anything in the context that is factually uncertain rather than asserting it confidently. - Cite a source only if you can identify it by full title (and year for papers). Never fabricate a URL. - Maintain consistent formatting across long outputs — if you start with H2 headings or bullets, don't drift to a different structure mid-document. - Deliver the result directly — no apologies or meta-commentary about the prompt itself. # Output format Return the code in a single fenced code block. Brief inline comments only for non-obvious decisions.
Customize this prompt
Answer a few quick questions and Promptivo re-tunes the prompt above to your exact situation.
Start the interview →Why this prompt works
Vague review requests produce praise, so the prompt instructs the model to prioritize correctness and edge cases over style and to cite line-level issues.
Asking for the language and the review's goal (ship-readiness vs. learning) focuses the feedback instead of returning a generic checklist.
Using this prompt in Gemini
For a code review, Gemini is a strong choice — it's especially good at concise, factual output and precise instruction-following. Promptivo formats this prompt the way Gemini works best: precise phrasing with brief reasoning cues where they improve accuracy.
Paste it into gemini.google.com, then replace any bracketed details with your own. Gemini is sensitive to wording, so this prompt pins down the exact terms and structure to keep the result from drifting.
Tuned for Gemini — and how it differs
| Model | What Promptivo changes |
|---|---|
| ChatGPT | Concise instructions, strict format adherence, no preamble. |
| Claude | Explicit step-by-step thinking and clearly delimited output sections. |
| Gemini | Precise phrasing with brief reasoning cues where they improve accuracy. |
| Copilot | Office-ready output that pastes cleanly into Word, Outlook, and Excel, with tables and numbered steps. |
Questions, answered
- How do I prompt for a useful code review?
- Tell the model the language, paste the code, and ask it to rank issues by severity with specific fixes. The interview structures this for you.
- Is Gemini good for a code review?
- Yes. Gemini handles a code review well thanks to its concise, factual output and precise instruction-following, and Promptivo tunes the prompt to match — precise phrasing with brief reasoning cues where they improve accuracy. Paste it into gemini.google.com.