Agent Self-Critique Before Commit Gate
Forces an agent to adversarially review its own change against a checklist before declaring it done.
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
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
Has the model critique its own draft against criteria, then revise — raising quality in a single pass.
Learn this techniqueForces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.
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 Agentic Coding & AI Dev Tools
Autonomous Coding Agent Task Scoping Brief
Turns a vague feature request into a bounded, verifiable task brief an autonomous coding agent can execute safely.
ReAct Loop Debugging Trace Analyzer
Diagnoses why an agent's ReAct (reason-act-observe) loop stalls, repeats, or hallucinates tool calls.
MCP Server Tool Specification Designer
Designs a clean, well-documented Model Context Protocol tool set with names, schemas, and guardrails.
Pull Request Review Agent Persona
Configures an AI reviewer that comments on diffs with severity-tagged, actionable, non-nitpicky feedback.