Coding Bug Investigation Prompt

Ask for a testable diagnosis before changing code, with attention to reproducibility and regressions.

Prompt template

Investigate this bug in {{language or stack}}. Expected behavior: {{expected}}. Actual behavior: {{actual}}. Reproduction steps: {{steps}}. Relevant code and logs: {{evidence}}. First summarize what the evidence proves and what remains unknown. Then list the most likely causes, the smallest test that would distinguish them, and a minimal fix only if supported. Identify regression risks and tests to add. Do not invent files, APIs, or logs; ask for missing evidence.

Example use

Get a bounded debugging plan for a reproducible UI or API defect.

How to use this prompt

  1. Include the smallest relevant code and full error text.
  2. Remove secrets and private data before pasting logs.
  3. Run the proposed test before applying a wider refactor.