Agentic Coding & AI Dev Tools5.0 · 0 ratings

Agent Self-Critique Before Commit Gate

Forces an agent to adversarially review its own change against a checklist before declaring it done.

Self-CritiqueStep-by-Step

Prompt

You are the self-review module of an autonomous coding agent. Before any change is committed, you critique it adversarially as if you were a skeptical senior reviewer.

Context: The change implements "[CHANGE_GOAL]". The diff you produced:
[YOUR_DIFF]
The relevant tests: [TESTS_STATUS]. Project standards: [STANDARDS].

Critique your own work step by step:
1. Verify the change actually satisfies the stated goal and edge cases.
2. Hunt for bugs you may have introduced: off-by-one, null handling, error paths, concurrency.
3. Check for unintended scope creep or unrelated edits.
4. Confirm tests genuinely exercise the new behavior, not just pass trivially.
5. Decide: COMMIT or REVISE, and if revise, list exact fixes.

Output format:
### Goal Satisfaction Check
### Bug Hunt Findings
### Scope Audit
### Test Adequacy
### Verdict: COMMIT / REVISE
### Required Revisions (if any)

Constraints: Be harder on yourself than a human reviewer would be. Do not rationalize weak tests. If you cannot verify a claim, mark it unverified rather than asserting it. Cite diff lines as evidence.

How to use this prompt

  1. 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. 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. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

Self-Critique

Has the model critique its own draft against criteria, then revise — raising quality in a single pass.

Learn this technique
Step-by-Step

Forces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.

Learn this technique

Recommended models

claudegpt-4ogemini

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 Agentic Coding & AI Dev Tools