Debugging: root cause first, then changes
Paste the full error and code; locate the cause before changing anything
Prompt
Copy it whole, then replace the brackets with your own contentBelow is the error I hit and the related code. First list the 3 most likely root causes ranked by probability, then give the smallest possible change, then a test that verifies the fix. Do not rewrite the whole file. Error: [paste stack trace] Code: [paste relevant snippet] Environment: [language/version/framework]
Paste code in sections; give the entry file and stack trace first; anonymize production data first.
How to get better results
Read this before you fill it inGive the conclusion and impact scope first, then only the changed snippets (no full files), and finally one check that proves it works. Flag risky spots separately.
If problems remain after the fix, paste the new error and the changed snippet back; keep debugging on the original approach, don't switch approaches and rewrite.
More like this: Writing code prompts · All prompts