Zero-Code AI App BuilderZero-Code AI App Builder
Prompting & Planning

Debug prompts

Ask AI to find and fix problems

Every app has bugs. Even professional developers hit them every day. The good news: AI is great at fixing bugs, if you describe them well.

What is debugging?

A bug is when your app does something you didn't expect. Debugging means finding the cause and fixing it.

Think of visiting a doctor. "I feel bad" doesn't help much. "I've had a headache for 3 days, mostly in the morning, since I started new medicine" helps a lot. Bug reports work the same way.

The five things to include

A good bug report answers five questions:

  • What did you do? The exact steps. "I clicked Add habit, typed 'Read', pressed Save."
  • What did you expect? "The habit should appear in my list."
  • What actually happened? "Nothing appeared. The form stayed open."
  • Is there an error message? Copy and paste the exact text.
  • A screenshot, if the problem is visual.
Copy error messages exactly. Don't retype or summarize them. One small detail in an error, like a file name or line number, can point straight to the problem.

Weak vs strong bug reports

Prompt (weak)
It's broken. Fix it.
Prompt (strong)
My habit tracker has a bug.

What I did: Clicked "Add habit", typed "Read 10 pages", clicked Save.
What I expected: The new habit appears at the top of my list.
What happened: The form closes, but the habit doesn't appear.
If I refresh the page, it shows up.
Error message (from the browser console):
"Warning: Each child in a list should have a unique key prop."

Screenshot attached.

The strong version gives the AI clues. "It shows up after refresh" tells it the habit is saved, but the screen doesn't update. That narrows the search a lot.

Ask AI to explain before fixing

If you say "fix it", the AI may change lots of code at once. You won't know what happened, and it might break something else. Ask for an explanation first.

Prompt
Before changing any code, explain in simple words:
1. What do you think is causing this bug?
2. Which file or part of the app is involved?
3. What change do you plan to make?
Wait for me to say "go ahead" before you fix it.

Let's break this down:

  • You learn what went wrong, so you understand your app better.
  • You can spot a bad plan before it touches your code.
  • "Wait for me" is a guardrail. It keeps you in control.
Report
5 key details
→
Explain
AI finds the cause
→
Approve
you agree to the plan
→
Fix
small change
→
Test
did it work?
A calm debugging loop. Fix one bug at a time and test after each fix.

A copyable bug-report template

Save this in your prompt library. Fill it in every time something breaks.

Bug report template
I found a bug in my [app name].

What I did (step by step):
1.
2.
3.

What I expected to happen:

What actually happened:

Error message (copied exactly):

When it started (what changed just before):

Screenshot: [attached / none]

Please explain the likely cause and your plan before changing anything.
Only change what is needed to fix this bug.

When the fix doesn't work

Sometimes the first fix fails. That's normal. Tell the AI what happened after the fix, using the same format.

Prompt
I tried your fix. The habit now appears, but it shows up twice.
No new error message. What do you think is causing this?
If the AI tries three or four fixes and keeps going in circles, stop. Undo back to the last working version (you'll learn Git for this), start a new chat, and describe the bug fresh.

Common mistakes

  • Saying "it doesn't work" without saying what you did or what you saw.
  • Retyping an error message from memory instead of copying it.
  • Reporting five bugs in one message. Fix them one at a time.
  • Letting the AI change lots of files without explaining why.
  • Not testing after the fix, then finding the bug again later.

Practice

Try these exercises to lock in what you just learned.

Quiz
Not started
Which bug report gives the AI the most useful information?
Quiz
Not started
Why ask the AI to explain the cause before it fixes a bug?
Quiz
Not started
How should you share an error message with the AI?

What's next?

You've finished the prompting skills. Next, let's learn how to plan and document your app before you build it, starting with why writing for AI matters.