Long & Powerful Bug Fixing Prompts

A list of long powerful bug fixing prompts which you can use with your Cursor or Windsurf.

developer
2 upvotes
547
50
2
547

Prompt Content

1. This code is not working as intended, and I'm not sure why. Please review the logic, identify any bugs, and correct the issues while keeping the overall structure and intent of the code intact.

2. I'm encountering an unexpected behavior in this block. Walk through it step-by-step like a debugger would. Identify what might be causing the issue, and apply a fix that is both correct and minimal.

3.Find all possible runtime and logic errors in this code. If something could go wrong during execution—due to null values, type mismatches, async issues, or improper flow—highlight it and provide a corrected version with inline explanations.

4. Assume this code is part of a larger system and is supposed to work reliably under different inputs and edge cases. Review it thoroughly for any potential issues that could lead to crashes, incorrect outputs, or failed edge cases. Fix anything that might go wrong.

5. I'm getting an error message when I run this, but it's not obvious what's wrong. Analyze the control flow, variable usage, and any external dependencies or state changes. Try to reproduce the failure logically, then suggest and apply a fix.

6. Even though this code runs, the output is incorrect for some inputs. Please examine the function’s logic, trace the flow of data through each line, and correct any mistakes in conditions, loops, or calculations to ensure accuracy.
7. There’s a subtle bug in this function—it passes some tests but fails in others. Carefully test this code against common and edge cases, and make any changes required to make the function fully correct, efficient, and robust.

8. Please act as a senior engineer and review this code with the goal of identifying anything that might break in production. Include async issues, incorrect assumptions, race conditions, mutation of shared state, etc., and fix them appropriately.

9. Read this function as if you’re preparing it for a code review. Identify all correctness issues, corner case failures, or hidden bugs and rewrite the function in a way that eliminates these problems without changing the interface.

10. Treat this code like a black box you’re testing. Try to break it in your mind—what inputs, states, or conditions would make it fail? Then, fix the code so it can safely handle all those situations without crashing or producing wrong results.

How to use this prompt

Copy the prompt below and paste it into your AI assistant or use it as inspiration for your own prompts.

Created by
Nermal
@nermalcat69
Member on Promptu
View Profile
Join our community
Get help, share ideas, and connect with other prompt creators on our Discord server.
Join Discord