Debugging & Error Fixing Prompts

AI Debugging & Error Fixing Prompts

🔍 AI Debugging & Error Fixing Prompts

15 powerful prompts to help identify and fix coding errors across multiple languages

All Prompts
Python
JavaScript
Web Dev
Database
Mobile
Python

Identify and Fix Bugs in a Python Script

Find syntax, logical, and runtime errors with explanations

Act as a Python expert. Review the following Python script and identify any syntax, logical, or runtime errors. Provide a corrected version with explanations.
EXAMPLE USAGE: “Act as a Python expert. Debug the following Python script that calculates the factorial of a number, but sometimes returns incorrect results.”
JavaScript

Debug a JavaScript Web App That Is Not Loading

Analyze rendering issues and suggest fixes

Act as a front-end developer. Analyze the given JavaScript code and find out why it’s not rendering correctly. Suggest fixes and optimizations.
EXAMPLE USAGE: “Act as a front-end developer. Debug this JavaScript-based web app that is not displaying user profiles correctly after fetching data from an API.”
Database

Fix SQL Query Errors and Optimize Performance

Identify errors and suggest indexing strategies

Act as a database expert. Identify errors in the given SQL query, optimize it for better performance, and suggest indexing strategies.
EXAMPLE USAGE: “Act as a database expert. Fix and optimize this SQL query that is taking too long to fetch customer order history.”
Web Dev

Debug and Fix an API Endpoint Not Returning Data

Analyze request/response logs to identify issues

Act as a backend developer. Analyze the API request/response logs and find out why the endpoint is not returning the expected data.
EXAMPLE USAGE: “Act as a backend developer. Debug this Express.js API that should return a JSON object but throws a 500 internal server error.”
Python

Fix a Python Web Scraper That Stopped Working

Handle website structure changes, CAPTCHAs, and timeouts

Act as a web scraping specialist. Identify why the Python scraper is failing (e.g., changed website structure, CAPTCHA, timeouts) and provide a working fix.
EXAMPLE USAGE: “Act as a web scraping specialist. Debug this Python script using BeautifulSoup that used to scrape product prices from Amazon but now returns empty results.”
Java

Fix a Java Application That Crashes on Startup

Analyze error logs and provide detailed fixes

Act as a Java expert. Analyze error logs and find out why the Java application crashes when launched. Provide a detailed fix.
EXAMPLE USAGE: “Act as a Java expert. Debug a Spring Boot application that throws a ‘NullPointerException’ during startup.”
UI/UX

Debug an HTML/CSS Layout That Breaks on Mobile

Fix responsive design issues with CSS improvements

Act as a UI/UX expert. Fix a responsive design issue where the layout breaks on smaller screens. Suggest CSS improvements.
EXAMPLE USAGE: “Act as a UI/UX expert. Fix the navigation bar in this website, which appears broken on mobile devices but works fine on desktops.”
WordPress

Fix a WordPress Plugin Conflict That Causes Errors

Troubleshoot and resolve plugin conflicts

Act as a WordPress developer. Troubleshoot and resolve conflicts between WordPress plugins causing website crashes or incorrect functionality.
EXAMPLE USAGE: “Act as a WordPress developer. Fix an issue where a new WooCommerce plugin update is causing checkout errors.”
Node.js

Debug a Node.js App That Randomly Crashes

Analyze logs to find root causes of intermittent crashes

Act as a Node.js expert. Analyze logs and identify the root cause of an intermittent crash in a Node.js application.
EXAMPLE USAGE: “Act as a Node.js expert. Debug this Node.js app that crashes every few hours due to an unknown memory leak.”
C++

Fix a C++ Program That Segfaults

Debug segmentation faults from memory allocation errors

Act as a C++ developer. Debug a segmentation fault in a C++ program by identifying memory allocation errors and providing a fix.
EXAMPLE USAGE: “Act as a C++ developer. Fix this program that crashes due to a segmentation fault when handling large arrays.”
Python

Debug a Python Pandas DataFrame Error

Identify DataFrame operation errors and suggest fixes

Act as a data analyst. Identify why a Pandas DataFrame operation is throwing an error and suggest a correct implementation.
EXAMPLE USAGE: “Act as a data analyst. Fix this Python script that throws a ‘KeyError’ when trying to access a DataFrame column.”
Git

Fix a Git Merge Conflict Without Losing Code

Step-by-step guide to resolve merge conflicts

Act as a Git expert. Provide a step-by-step guide to resolve a merge conflict in Git while preserving all necessary code changes.
EXAMPLE USAGE: “Act as a Git expert. Help resolve a merge conflict between the ‘dev’ and ‘main’ branches without overwriting important changes.”
Flask

Debug a Flask Web App That Returns a 404 Error

Identify why Flask routes aren’t being recognized

Act as a Flask developer. Identify why a Flask route is returning a 404 error and suggest a fix.
EXAMPLE USAGE: “Act as a Flask developer. Debug this Flask web app where a specific endpoint is not being recognized.”
PHP

Fix a PHP Website That Loads Slowly

Identify performance bottlenecks and optimize

Act as a PHP developer. Identify performance bottlenecks in a PHP-based website and suggest optimizations for faster load times.
EXAMPLE USAGE: “Act as a PHP developer. Optimize this WordPress-based website that takes more than 10 seconds to load each page.”
React

Fix a React App That Fails to Fetch API Data

Debug API call failures and state update issues

Act as a React developer. Debug a React app where API calls fail or return incorrect data.
EXAMPLE USAGE: “Act as a React developer. Fix a React app where useEffect fetches data from an API but doesn’t update the state correctly.”
Prompt copied to clipboard!