Debugging Templates

Ready-to-use prompt templates and sample debugging flows.

Copy-paste templates for common debugging scenarios.


Sample Debugging Flows

The "Stuck in Error Loop"

You prompted something complex, and now the app won't build.

Flow:

  1. Ask: "What is the root cause of this build error?"
  2. The AI explains it's a type mismatch in the API call.
  3. You then say: "Show me the relevant code and the expected types."
  4. AI shows that the function expected an ID number but got an object.
  5. Now that you see it, you prompt: "Adjust the code to pass just the numeric ID to the function, not the whole object."
  6. Build succeeds.

Throughout, you specifically described the error and had the AI confirm its understanding, rather than just blindly hitting fix repeatedly.


The "Feature Not Working Right"

You added a notification feature, but emails aren't sending.

Flow:

  1. No error shows, so you ask: "The email notification isn't working – I expected an email when a task is overdue, but got nothing. How can we debug this?"
  2. AI suggests checking if the server function triggered and if the email service response had an error.
  3. You grab the server log and see a permission error.
  4. You show this to the AI: "The log says 'permission denied when trying to send email.'"
  5. AI figures out maybe the API key for the email service wasn't set or the service blocked it.
  6. You then fix the API key in settings or prompt to adjust the function.

The "UI Element Disappeared"

You refactored something and now a whole section of the UI is just gone.

Flow:

  1. You tell the AI: "The project list section is no longer showing up at all. It was working before the last edit."
  2. The AI might check if the component is still being rendered or if a return statement is missing.
  3. The AI could walk through possibilities: "Is the data still being fetched? Is the component getting the data? Let's add a console.log in the render to see if it's receiving props."
  4. You do that, and see nothing logs—meaning the component isn't mounted.
  5. You prompt: "Restore the <ProjectList> in the Dashboard page JSX (it was accidentally removed)."

Quick Reference Templates

For understanding errors

I'm seeing this error: [paste error message]
Can you explain what's causing this and suggest a fix?

For tracing issues

The [feature] stopped working after the last change.
Walk me through what might have broken and how to debug it.

For safe fixes

Before making changes, explain what you plan to modify and why.
Only change what's necessary to fix this specific issue.

For performance issues

The app feels slow when [action]. Analyze what might be causing
the performance issue and suggest optimizations.

For rollback situations

I'm reverting to a previous version. Help me understand what
went wrong so we can approach it differently this time.

For console errors

My app is not working anymore and the screen is blank.
Here's the copy/paste from Dev tools console, can you fix the issue?

Error occurred:
[paste error here]

Debugging Principles

PrincipleDescription
Error FixingFocus exclusively on relevant code sections without modifying unrelated functioning parts
Surgical ApproachChange only what's necessary, preserve variable names and coding patterns
Multiple HypothesesForm multiple theories about potential causes rather than jumping to conclusions
Solution VerificationTest against the original issue, check for side effects, ensure performance isn't impacted
Preserve Working FeaturesTreat working features as locked systems that require explicit permission to modify
Deep AnalysisResist immediate fixes without deeper understanding; consider fundamentally different approaches
Dead Code EliminationActively remove unused code instead of commenting it out