Coding
Bug Fixing Prompt
Get systematic help debugging your code.
Prompt Template
Help me debug this code. Code: [Paste the problematic code] Bug description: - What's happening: [What the code does wrong] - Expected behavior: [What should happen] - Error message: [If applicable] - When it occurs: [Conditions that trigger the bug] Additional info: - Language: [Programming language] - Framework/library: [If applicable] - Version: [Version numbers] Please: 1. Identify the Bug - Root cause analysis - Why is this happening? - Where exactly is the problem? 2. Explain the Issue - Why is this code wrong? - What assumptions are incorrect? - What's the misunderstanding? 3. Provide Solution(s) - Step-by-step fix - Code corrections - Multiple approaches if possible 4. Prevent Future Bugs - Coding practices to avoid this - Testing strategies - Code review checklist 5. Test the Fix - Test cases to verify the fix - Edge cases to consider - Performance impact 6. Learn from It - Why this pattern is problematic - Similar bugs to watch for - Best practices for this scenario
How to Use This Prompt
Customize It
Replace bracketed sections [like this] with your specific information to personalize the prompt.
Be Specific
The more detailed information you provide, the better your AI results will be.
Iterate & Refine
Don't settle for the first result. Modify and refine your prompt to get better outcomes.
Provide Context
Give your AI tool background information about your project for more relevant responses.