{"@context":"https://schema.org","@graph":[{"@type":"TechArticle","@id":"https://www.devtools.tools/ai/resource/structured-code-review-prompt#article","headline":"Structured Code Review","name":"Structured Code Review","description":"A reusable prompt for reviewing a focused diff and reporting only actionable, evidence-backed findings.","url":"https://www.devtools.tools/ai/resource/structured-code-review-prompt","dateModified":"2026-08-22","inLanguage":"en-US","isAccessibleForFree":true,"keywords":"code-review, bugs, testing","license":"MIT","author":[{"@type":"Person","name":"Community contributors"}],"isPartOf":{"@type":"WebSite","@id":"https://www.devtools.tools#website","name":"DevTools"},"about":{"@type":"Thing","name":"PROMPT"},"sameAs":"https://github.com/f/awesome-chatgpt-prompts"},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"DevTools","item":"https://www.devtools.tools"},{"@type":"ListItem","position":2,"name":"AI Community Hub","item":"https://www.devtools.tools/ai"},{"@type":"ListItem","position":3,"name":"PROMPT resources","item":"https://www.devtools.tools/ai/prompts"},{"@type":"ListItem","position":4,"name":"Structured Code Review","item":"https://www.devtools.tools/ai/resource/structured-code-review-prompt"}]}]}
PromptMIT
Structured Code Review
A reusable prompt for reviewing a focused diff and reporting only actionable, evidence-backed findings.
View source Source Reviewed
Prompt template
Review the following diff for correctness, regressions, security issues, and missing tests. Prioritize concrete findings with file and line evidence.
Repository context:
{{REPOSITORY_CONTEXT}}
Diff:
{{DIFF}}
Return findings ordered by severity, followed by a short test plan.Input and output
Input: Plain text containing repository context and a focused diff.
Output: Markdown findings with severity, evidence, impact, and test plan.
Examples
Input: A diff changes an API response field from `slug` to `id` without updating consumers.
Output: High: identify the breaking contract and list each stale consumer with a targeted test.
Security notes
Remove secrets and personal data from the diff before submitting it to a hosted model.