20 of the best prompts for resolving AI-Induced errors, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
20 of the best prompts for resolving AI-Induced errors, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
Cursor sometimes introduces errors it cannot resolve, causing frustration and wasted time. This can halt development progress and lead to inefficient debugging sessions. These prompts guide developers to diagnose, fix, verify, and prevent such errors effectively. This guide walks you through every stage of Resolving AI-Induced Errors, from Diagnose the Wall all the way through Prevent Recurrence, with a curated, copy-ready prompt at each step. Each stage targets a specific phase of the process so you always know exactly what to ask and what output to expect. Works with ChatGPT, Claude, and Gemini and any other major AI tool.
Review the recent changes made by Cursor that led to the error. Identify the specific error introduced.
Identify Recent Changes
Please identify and summarize all recent changes made to the codebase prior to the appearance of the error. Include specific details about each modification, such as the files affected, the nature of the changes (e.g., additions, deletions, or alterations), and the rationale behind these modifications. Additionally, highlight any potential impacts these changes may have had on the overall functionality of the code. Format your response as a detailed report that I can use to diagnose the issue effectively.
Analyze Error Details
Please analyze the following error message: [PASTE ERROR MESSAGE]. Provide a detailed explanation of what this error indicates, including the specific part of the code it impacts. Additionally, outline potential causes for this error and suggest steps to troubleshoot or resolve the issue. Format your response in a clear manner, breaking down each component for better understanding.
Check Rule Compliance
Please analyze the following .cursorrules file content: [PASTE CONTENT]. Identify any recent changes that may violate the established rules within this file. For each violation, specify the exact rule that is not being followed and provide a brief explanation of how the change conflicts with the rule. Additionally, suggest potential corrections or adjustments to ensure compliance with the rules.
Trace Error Origin
Please help me trace the origin of an error that occurred in my project. I need you to analyze the sequence of events leading up to the error and identify the first instance where the issue was introduced. For each step, provide a detailed description of what happened, including any relevant actions taken, changes made, or external factors that may have contributed to the problem. Summarize your findings in a clear format that outlines the timeline of events and highlights the critical moment when the error was introduced.
Evaluate Context Loss
Evaluate the current project tree and the open files to determine if there has been any loss of context during the session. If context has been lost, please identify and list the specific pieces of information that are missing. Additionally, provide insights on how this loss of context may affect the overall project and suggest potential steps to recover or mitigate the impact of this loss.
Focus on correcting the specific line or section of code where the error was introduced.
Revert Problematic Change
Please identify the error introduced in the last edit: [PASTE ERROR]. Revert the specific change that caused this error and provide a detailed explanation of why this change was incorrect. Include the potential impact of this error on the overall project and suggest any alternative approaches that could have been taken to avoid this issue. Format your response clearly, outlining each step taken in the process of reverting the change.
Correct Syntax Error
Identify the syntax error in the following code snippet: [PASTE CODE]. Please correct the error and provide a detailed explanation of the change you made, including why the original code was incorrect and how your correction resolves the issue. Additionally, outline any potential implications this change may have on the overall functionality of the code.
Fix Logic Mistake
Please analyze the following function for any logic errors: [PASTE FUNCTION]. Identify the specific mistake and explain why it is incorrect. After that, provide the corrected version of the function along with a detailed description of your reasoning for the changes made. Ensure that your explanation covers the implications of the error and how your fix improves the function's performance or accuracy.
Resolve Dependency Issue
Identify any dependency issues related to the error message I received: [ERROR MESSAGE]. Please provide a detailed analysis of the dependencies involved, including their versions and how they interact with each other. Explain how these dependencies contributed to the problem and outline the steps taken to resolve the issues. Additionally, suggest best practices to avoid similar dependency issues in the future.
Clarify Misunderstood Rule
Please clarify the rule from .cursorrules: [PASTE RULE] that was misunderstood. Explain the correct interpretation of this rule and provide a detailed example of how to apply it properly in a relevant context. Additionally, outline any common pitfalls to avoid when implementing this rule and suggest best practices for ensuring compliance in future scenarios.
Ensure the fix resolves the error and does not introduce new issues.
Run Affected Tests
Run the tests related to the fixed error in the codebase. Provide a detailed output of the test results, including which tests were executed, any errors encountered, and a summary of the overall pass/fail status. Additionally, confirm that all tests pass without any errors and highlight any tests that may have been affected by the previous issue. Format the results in a clear and organized manner for easy review.
Reproduce Original Scenario
Please reproduce the original scenario that caused the error in [SPECIFIC SYSTEM OR APPLICATION]. Detail the steps taken to replicate the issue, including any specific inputs or configurations used. After reproducing the error, confirm whether it still occurs, and provide a comparison of the results before and after the fix. Include any relevant screenshots or logs to illustrate the differences in outcomes.
List Changed Files
Please provide a detailed list of every file that was modified to address the error. For each file, include a brief description of the specific changes made and the purpose of those changes. Additionally, confirm that no unintended modifications were introduced during this process. Make sure to highlight any critical adjustments and their impact on the overall functionality.
Check for New Errors
Please scan the codebase for any new errors that may have been introduced by the recent fix. Provide a detailed report of any issues you find, including the specific lines of code where the errors occur, a brief description of each error, and suggestions for how to resolve them. Additionally, indicate whether the errors are critical, moderate, or minor based on their potential impact on the overall functionality. Format the report in a clear and organized manner, making it easy to understand and act upon.
Validate Rule Compliance
Please validate the compliance of all changes made against the .CURSORRULES file. Confirm that each rule is being adhered to and that no violations exist after the recent fixes. Provide a detailed report outlining any discrepancies found, including specific rules that were violated, if applicable, and suggestions for corrective actions. The report should be structured with sections for rule compliance status, identified issues, and recommended next steps.
Implement measures to prevent the AI from making similar errors in the future.
Create New Rule
Based on the error that was recently fixed, please create a new rule that can be added to the .cursorrules file to prevent this issue from occurring in future sessions. The rule should clearly define the conditions that trigger the error and the corresponding actions to take to avoid it. Include the exact text of the rule, ensuring it is formatted correctly for implementation. Additionally, provide a brief explanation of why this rule is necessary and how it will improve the overall functionality.
Add Code Comment
Please provide a code comment that should be placed above the fixed function in the code. The comment must clearly outline the specific constraint that must not be violated by any AI assistant interacting with this function. Ensure that the comment is concise yet informative, ideally one to two sentences long, and uses clear language to avoid any ambiguity. Format the comment as a single line of code, starting with '//' for clarity.
Draft Session Checklist
Create a comprehensive checklist that I can use at the beginning of any session where I will be asking you to perform similar tasks. The checklist should include specific steps to ensure accuracy and prevent common mistakes, such as verifying input data, confirming task objectives, and outlining expected outcomes. Additionally, include reminders for reviewing previous similar tasks and noting any lessons learned from past errors. Format the checklist in a clear and organized manner, with bullet points for easy reference.
Define Project Convention
Please suggest a comprehensive project convention aimed at preventing similar errors in future projects. The convention should include specific guidelines on best practices, error handling procedures, and documentation standards. Additionally, outline the roles and responsibilities of team members in adhering to these conventions, and provide examples of common errors that can be avoided by following this convention. Format your response as a detailed section suitable for inclusion in project documentation, ensuring clarity and thoroughness.
Clarify Rule Application
Please help me draft a clarification note for the .cursorrules file regarding the correct application of the rule I misunderstood. Include a detailed explanation of the rule's purpose, the common misconceptions associated with it, and the correct interpretation. Provide the exact text that should be added to the file, ensuring it is clear and concise for future reference. Additionally, suggest any examples that could help illustrate the correct application of this rule.
Cursor may lose context in long sessions or large codebases, leading to errors it can't resolve. This occurs because it cannot retain all necessary information over time. Using targeted prompts can help guide it back to the correct context.
Cursor reads a .cursorrules file for project-specific instructions. Ensure this file is up-to-date and comprehensive. Use prompts to verify compliance with these rules during sessions.
If Cursor loses context, use prompts to re-establish the necessary information. Provide it with the relevant files and rules again to regain its understanding of the project.
Cursor can struggle with large codebases due to context limitations. Break down tasks into smaller parts and use prompts to maintain focus on specific sections of the code.
Implement rules in the .cursorrules file and use prompts to reinforce these during sessions. Adding code comments and session checklists can also help prevent recurring mistakes.
AI Prompts for Resolving Bolt's Error Loop
Bolt can introduce errors it fails to resolve, causing it to spin without progress.
See promptsAI Prompts for Diagnose the Error Resolution Loop
When v0 fails to resolve an error it introduced, it can lead to a frustrating loop of unproductive attempts.
See promptsAI Prompts for Resolving AI Error Loops
Lovable's internal agent can get stuck in loops trying to fix errors it introduced.
See prompts