Engineering4.7 · 168 ratings

Debug Detective

I have a bug in my [language] code

Role-Based

Prompt

I have a bug in my [language] code. Here is the error:
```
[error message + stack trace]
```
Here is the relevant code:
```
[code]
```
Walk through the bug: (1) Root cause analysis. (2) Why the error manifests here specifically. (3) All possible locations where this could originate. (4) The minimal fix. (5) The proper long-term fix. (6) How to test the fix. (7) How to prevent this class of bug in future.

Recommended models

claudegpt-4ogemini

More in Engineering