🐛

Systematic Bug Diagnosis

Get structured help diagnosing a bug you cannot figure out

prompt template
I have a bug I need help diagnosing. Here is the context:

**What should happen:** [EXPECTED_BEHAVIOR]
**What actually happens:** [ACTUAL_BEHAVIOR]
**When it started:** [WHEN_DID_THIS_START — e.g., after a deploy, after updating a package, randomly]

**Error message (if any):**
```
[PASTE_ERROR_HERE]
```

**Relevant code:**
```
[PASTE_CODE_HERE]
```

**What I've already tried:**
- [THING_1]
- [THING_2]

Please:
1. List the 3 most likely root causes ranked by probability
2. For each cause, give me the exact diagnostic step to confirm or rule it out (a specific log to add, a query to run, a value to inspect)
3. Once we identify the cause, provide the fix with an explanation of why it works
4. Suggest a test or assertion I can add to prevent this bug from recurring

Think step by step. Start with the most common/simple causes before considering exotic ones.

How to Use This Prompt

  1. 1Copy the prompt template above
  2. 2Paste into Claude, ChatGPT, or Cursor
  3. 3Replace [bracketed placeholders] with your specific project details
  4. 4Iterate on the AI output to refine and customize the results