← Cheatsheets / Workflow

AI Debugging Checklist

Step-by-step process for debugging with AI. Stop flailing, start fixing.

debugging workflow checklist

Something broke? Don’t flail. Follow this checklist.

The short version:

  1. Capture full error + context
  2. Check the obvious (save, restart, typos)
  3. Use the debug prompt template below
  4. Apply a strategy (isolate, trace, rubber duck)
  5. Fix, understand, prevent

Related: Debugging with AI Guide | Common Errors

Before You Ask the AI

1. Capture the Error

□ Copy the FULL error message (not just the last line)
□ Note which file and line number
□ Screenshot if it's a visual bug

2. Find the Trigger

□ What action caused this? (click, load, submit?)
□ Does it happen every time or randomly?
□ Did it ever work? What changed?

3. Check the Obvious

□ Did you save all files?
□ Is the dev server running?
□ Did you install dependencies? (npm install)
□ Is there a typo in the file name?

The Debug Prompt Template

## Error
[paste full error message]

## Context
- File: [filename]
- Trigger: [what I did]
- Expected: [what should happen]
- Actual: [what actually happens]

## What I've Tried
- [list attempts]

## Relevant Code
[paste the specific function/component]

Debugging Strategies

Strategy 1: Isolate

Ask the AI to create a minimal reproduction:

Can you create the simplest possible version of this 
code that would reproduce this error? I want to 
isolate the problem.

Strategy 2: Trace

Ask for logging:

Add console.log statements to trace the data flow
through this function. I want to see the value at
each step.

Strategy 3: Rubber Duck

Explain it to the AI:

Let me explain what this code is supposed to do,
and you tell me where my logic might be wrong:
[explanation]

Strategy 4: Fresh Eyes

Ask for a review:

Look at this code as if you've never seen it.
What looks suspicious or could cause [error type]?

Common Error Types

Syntax Errors

Symptoms: App won’t start, red squiggles everywhere

□ Missing brackets, parentheses, or quotes
□ Typo in keyword (functoin, constt)
□ Wrong file extension

Runtime Errors

Symptoms: App crashes at a specific action

□ Undefined variable (check spelling)
□ Null reference (data not loaded yet)
□ Wrong array index (off by one)

Logic Errors

Symptoms: App runs but does wrong thing

□ Condition inverted (should be !== not ===)
□ Wrong variable in calculation
□ Missing edge case handling

Async Errors

Symptoms: Sometimes works, sometimes doesn’t

□ Missing await keyword
□ Race condition (two things happening at once)
□ Promise not handled

Red Flags in AI Responses

🚩 Generic fix – If the AI gives a generic answer, it doesn’t understand your specific code

🚩 Doesn’t address the error – Make sure the fix actually targets what’s broken

🚩 Adds complexity – Simple bugs need simple fixes

🚩 “Try this” – If the AI says “try this” without explaining why, ask why

When You’re Stuck

Escalation Path

  1. Re-read the error message slowly
  2. Google the exact error text
  3. Check if your dependencies are up to date
  4. Ask the AI to explain what the error means (not fix it)
  5. Step away for 10 minutes, then look again
  6. Ask a human

Magic Questions

"What would cause this exact error message?"

"Walk me through what happens line by line when I [action]"

"What assumptions is this code making that might be wrong?"

Prevention Checklist

□ Save frequently
□ Commit after each working state
□ Test one change at a time
□ Read error messages fully
□ Keep functions small

Remember: Every bug is a lesson. The goal isn’t just to fix it—it’s to understand why it broke.


🎯 Debugging Right Now?

  1. Scroll up to “The Debug Prompt Template”
  2. Copy it
  3. Fill in your error details
  4. Paste into your AI tool
  5. Apply the first strategy the AI suggests

If that doesn’t work, come back and try the next strategy. Systematic beats random.


Keep Learning

✓ Copied to clipboard!