Code Review & Debugging5.0 · 0 ratings

Diff Self-Critique Before Commit

Has the model critique its own proposed change adversarially, surfacing bugs and weaknesses before you commit it.

Role-Based

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.

Recommended models

claudegpt-4ogemini

More in Code Review & Debugging