Skip to main content
Promptivo logoPromptivo

ChatGPT 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 ChatGPT · 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
Work the problem internally, then give only the result. Do not narrate your reasoning unless it is part of the deliverable.

# Constraints
- Follow the requested format exactly. Default to clean markdown. Be concise — no filler, no restating the question.
- Deliver the single best answer rather than hedging across several.
- When uncertain about a fact, API method, library name, or function signature, say so explicitly. Do not produce a plausible guess.
- Do not invent citations, URLs, or package names. If you don't know one, omit it or flag that you don't.
- 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 ChatGPT

For a code review, ChatGPT is a strong choice — it's especially good at fast, well-structured drafts and reliable format-following. Promptivo formats this prompt the way ChatGPT works best: concise instructions, strict format adherence, no preamble.

Paste it into the ChatGPT app or chat.openai.com, then replace any bracketed details with your own. ChatGPT can over-explain, so this prompt sets an explicit format and length cap to keep the answer tight.

Tuned for ChatGPT — and how it differs

ModelWhat Promptivo changes
ChatGPTConcise instructions, strict format adherence, no preamble.
ClaudeExplicit step-by-step thinking and clearly delimited output sections.
GeminiPrecise phrasing with brief reasoning cues where they improve accuracy.
CopilotOffice-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 ChatGPT good for a code review?
Yes. ChatGPT handles a code review well thanks to its fast, well-structured drafts and reliable format-following, and Promptivo tunes the prompt to match — concise instructions, strict format adherence, no preamble. Paste it into the ChatGPT app or chat.openai.com.

Related prompts