Fix a Bug Starting From a Failing Test

7 Views
0 Uses

Prompt

ChatGPT
Claude
Grok
OpenRouter
Users report: {{SYMPTOM}}.

The likely area is {{CODE_AREA}}. "Fixed" means: {{DEFINITION_OF_FIXED}}.

Work in this order and do not skip a step.
1. Read the relevant code and say what you think is happening, in three sentences or fewer.
2. Write a failing test that reproduces the problem, run it, and show me that it fails for the reason you expect.
3. Make the smallest change that fixes it. Do not refactor unrelated code or change formatting elsewhere.
4. Run the new test and then the wider test command {{TEST_COMMAND}}, and keep going until they pass or you hit something you cannot resolve.
5. Show me the evidence: the commands you ran and their output, not just a statement that the tests pass.

If you cannot reproduce the problem with a test, stop at step 2 and tell me what you tried, instead of changing code on a guess.

Customize this prompt

Fill in the variables below to personalize this prompt:

ChatGPT
Claude
Grok
OpenRouter

Report this prompt

Model Settings

Recommended Models

Claude

Temperature

0.7

Max Tokens

2000

Additional Notes

Best for: Bug fixes that are proven rather than claimed

About this prompt

“Fix a Bug Starting From a Failing Test” is a free prompt for Claude in the Coding & Software category, 148 words long, added to The Prompt Index on November 18, 2026 by The Prompt Index. Copy it with the button above, paste it into Claude or any other AI chat assistant, and send it.

It has 4 placeholders to fill in first: {{SYMPTOM}}, {{CODE_AREA}}, {{DEFINITION_OF_FIXED}}, {{TEST_COMMAND}}. Use the “Customize this prompt” fields to personalise it before you copy.

Recommended models: Claude.

0 upvotes, sent to an AI tool 0 times, viewed 7 times.

Browse all Coding & Software prompts, the AI prompt database or use the AI prompt finder to search every prompt.