Find the bug and explain the cause

A ready-to-use “Programming” AI prompt template, designed and tested with Cursor. Replace the (bracketed) parts below with your own needs.

Prompt template
My code isn't working as expected. Please: 1) find the most likely problem; 2) explain why it happens (spell out the principle); 3) give the corrected code; 4) remind me how to avoid this kind of error in future. If info is insufficient, first ask what I need to add.

Expected behavior: "describe"
Actual behavior: "describe"
Code:
```
paste the code
```

How to use this prompt

  1. Copy the whole prompt above and paste it into Cursor or ChatGPT / Claude / Gemini.
  2. Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
  3. If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.

Recommended tool: Cursor — A code editor built for AI.