When something is broken in an AI-built app, the natural reaction is to type “the sign-up button doesn’t work, please fix” and hope for the best. Sometimes that works. Often the tool changes something unrelated, rewrites half the page, or reports that the issue is fixed while the bug is still there.

The problem is rarely the tool. It is that the prompt leaves it to guess where the problem is, when it happens, what correct looks like and what must not change. A good fix prompt answers those questions in a few sentences. Every bug in our reports comes with a prompt written this way, and the structure is simple enough to use yourself.

The five parts of a fix prompt

A useful fix prompt contains five things, usually in this order:

  1. Location. Which page, component or flow. Use the names you see in the app, such as “the sign-up page” or “the booking form on the studio page”.
  2. Condition. When the bug happens: the device, browser, screen size, user type or step. “In Safari on iPhone”, “when the user is not logged in”, “after cancelling a subscription”.
  3. What happens now. The actual behaviour, described plainly. “The Create account button is covered by the keyboard and can’t be tapped.”
  4. What should happen. The expected behaviour, specific enough that it can be checked. “The button stays visible while the keyboard is open.”
  5. Constraints. What the tool must not change, and any hint about the fix if you know it. “Don’t change the desktop layout. Use 100dvh instead of 100vh.”

You don’t need all five every time, but the more you leave out, the more the tool guesses.

Before and after

Example 1: a layout bug

Before

The sign up button is broken on mobile, fix it.

The tool doesn’t know which mobile device, what “broken” means, or what to leave alone. It might restyle every button in the app.

After

On the sign-up page, the "Create account" button is covered by the on-screen
keyboard in iPhone Safari, so it can't be tapped while typing. Make the form
scroll so the button stays visible while the keyboard is open. Use 100dvh
instead of 100vh for the page height. Don't change the desktop layout.

Example 2: a data bug

Before

Users can see other people's stuff, add security.

“Add security” can mean a hundred things, and the tool may add a login screen that already exists.

After

Logged-in users can open another customer's booking by changing the booking ID
in the URL (/bookings/1042 -> /bookings/1043). Add a row-level security policy
on the bookings table so users can only select rows where user_id = auth.uid().
When a booking doesn't belong to the current user, show the 404 page.
Don't change the booking page layout.

Example 3: a payments bug

Before

Refunds don't work.

After

When a booking is cancelled more than 24 hours before the class, no refund is
created in Stripe (test mode). In the cancel-booking handler, check the time
until the class. If it is more than 24 hours, create a full refund for the
booking's payment intent and set the booking status to "refunded". Show the
refund amount in the confirmation message. Don't change the cancellation rules
for bookings less than 24 hours ahead.

Notice that none of the “after” prompts are long. They are just specific.

Habits that make prompts work better

Fix one bug per prompt

Asking for three fixes at once invites the tool to make broad changes across many files. One bug, one prompt, one check. If several bugs share a root cause, such as a missing permission rule, describe the cause once and list the symptoms.

Describe behaviour, not code you’re unsure of

If you know the fix (“use 100dvh”, “add a min attribute to the date input”), include it as a hint. If you don’t, describe the behaviour precisely and let the tool choose the implementation. A wrong technical hint can do more harm than none.

Always say what must not change

AI tools like to tidy things up while they’re in a file. A single sentence such as “don’t change the desktop layout”, “keep the existing styles” or “only change the cancel handler” keeps a small fix small.

Give exact text for anything users read

If the fix involves a message, write the message: Show “Choose today or a later date” under the date field. Otherwise you’ll get generic text you then have to fix again.

Ask the tool to tell you what it changed

Ending with “list the files you changed” makes it easier to spot when a fix has spread too far, and gives you something to check.

After the fix: check it like a tester

A fix prompt is only finished when the bug is gone and nothing else has broken:

  1. Repeat the exact steps that caused the bug, on the same device and browser.
  2. Try a close variation: another phone, another account, another date.
  3. Run through your two or three core flows quickly, because the most common side effect of an AI fix is a regression somewhere else.
  4. If the bug isn’t fixed, don’t just say “still broken”. Describe what happens now, which is often different from before, and send that as the next prompt.

A template you can copy

On [page / component], when [condition: device, browser, user, step],
[what happens now]. It should [expected behaviour].
[Optional hint: how to fix it, if you know.]
Don't change [what must stay the same]. List the files you changed.

Good fix prompts won’t replace testing. You still need to find the bugs first, and real users are a slow, expensive way to do that. But once a bug is clearly described, a well-written prompt is often all it takes to fix it in minutes.

Every bug in our reports includes a fix prompt in this format. You can see more examples in our sample bug report (for a fictional demo app), and the ten most common bugs in Lovable and Bolt apps each come with a prompt you can adapt.

Your next release deserves a second look.

Prefer email?

We reply within 1 business day. No calls needed.