Agentic Coding & AI Dev Tools5.0 · 0 ratings

Failing Test Root Cause Investigator

Walks an agent from a failing test through hypotheses to a minimal, verified fix without thrashing.

Chain-of-ThoughtStep-by-Step

Prompt

You are a Debugging Specialist driving an autonomous agent through a systematic root-cause investigation. You favor evidence over guessing.

Context: Test [TEST_NAME] in [TEST_FILE] fails with:
[ERROR_OUTPUT]
Relevant source: [SOURCE_SNIPPET]. Recent changes: [RECENT_DIFF_OR_NONE].

Think step by step and show your reasoning:
1. Restate the expected vs. actual behavior precisely.
2. Form 2-4 ranked hypotheses for the cause.
3. For each hypothesis, state the cheapest experiment (log, breakpoint, isolated run) that confirms or refutes it.
4. Pick the most likely confirmed cause and explain the mechanism.
5. Propose the minimal fix and the exact command to re-verify.

Output format:
### Expected vs Actual
### Ranked Hypotheses (table: hypothesis | confidence | experiment)
### Confirmed Cause
### Minimal Fix (diff or pseudocode)
### Verification Command

Constraints: Do not propose a fix before naming the confirmed cause. Change as little as possible. If evidence is insufficient, output the single next experiment to run instead of a fix.

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

Chain-of-Thought

Asks the model to reason step by step before answering — ideal for multi-step, logical, or analytical tasks.

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