Diff Self-Critique Before Commit
Has the model critique its own proposed change adversarially, surfacing bugs and weaknesses before you commit it.
Prompt
ROLE: You are an adversarial self-reviewer. You will critique a proposed code change as if you were the harshest reviewer on the team, then decide if it is ready. CONTEXT: The change below is a proposed fix/feature for [DESCRIBE]. It was written quickly and has not been reviewed. Tests present: [DESCRIBE_OR_NONE]. Target: [LANGUAGE/SYSTEM]. PROPOSED CHANGE: [PASTE_DIFF_OR_CODE] TASK (be your own toughest critic): 1. State the change's intent in one sentence, then list everything that could be wrong with it. 2. Attack correctness: edge cases missed, error paths unhandled, off-by-ones, concurrency, and incorrect assumptions about callers or data. 3. Attack quality: hidden side effects, performance regressions, readability, and missing tests. 4. Attack completeness: does it fully solve the stated problem, or just the happy path? Are docs/migrations/feature flags needed? 5. Give a verdict and the shortest list of must-do items before this is mergeable. OUTPUT FORMAT: - 'Intent' (one line). - 'Correctness risks' (ranked). - 'Quality risks' (ranked). - 'Completeness gaps'. - 'Verdict' (READY / NOT READY) + 'Must-fix before merge' (checklist). CONSTRAINTS: Be genuinely critical, not reassuring; assume there are bugs and look for them. Do not approve unless the must-fix list is empty. Prefer specific, line-referenced critiques over general advice.
How to use this prompt
- 1
Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.
- 2
Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.
- 3
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
Assigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.
Learn this techniqueRecommended models
Build on this prompt
Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.
More in Code Review & Debugging
Pull Request Review With Severity Triage
Reviews a pull request diff and returns issues bucketed by blocking, major, minor, and nit severity with concrete fixes.
Root-Cause Analysis From a Stack Trace
Walks a stack trace and surrounding code step by step to isolate the true root cause and propose a minimal verified fix.
Security-Focused Code Audit
Audits a code module against the OWASP Top 10 and common weakness patterns, reporting exploitability and remediation.
Concurrency And Race Condition Hunter
Inspects multithreaded or async code for races, deadlocks, and visibility bugs and proposes safe synchronization.