Back to guide/General Productivity

Debugging Assistant

Provides all the context a debugger needs (error, location, reproduction, expected vs actual) and asks for root cause analysis before applying a fix, preventing superficial patches.

windsurf-promptserror_messagewhere_it_occursreproduction_steps
Edit View
Prompt
I'm hitting this bug:\n\nError: {{error_message}}\nWhere: {{where_it_occurs}}\nWhen: {{reproduction_steps}}\n\nExpected behavior: {{expected}}\nActual behavior: {{actual}}\n\nDebug this step by step:\n1. Read the file where the error originates\n2. Trace backward — what calls this code and with what arguments?\n3. Check for common causes: null/undefined values, type mismatches, async timing issues, missing env vars\n4. Look at recent changes to the involved files (if git history is available)\n5. Propose a fix with an explanation of the root cause\n\nBefore applying the fix:\n- Explain WHY the bug happens, not just how to fix it\n- Show me the specific line(s) that are wrong\n- Confirm the fix won't break other code paths that use the same function

Variables to customize

{{error_message}}{{where_it_occurs}}{{reproduction_steps}}{{expected}}{{actual}}

Why this prompt works

Provides all the context a debugger needs (error, location, reproduction, expected vs actual) and asks for root cause analysis before applying a fix, preventing superficial patches.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.