20 of the best prompts for updating deprecated API usage, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
20 of the best prompts for updating deprecated API usage, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
Published June 28, 2026
Using deprecated library methods or APIs can lead to future failures when these features are removed. This results in broken functionality and potential downtime. These prompts help developers identify and update deprecated usage to ensure code stability. This guide walks you through every stage of Updating Deprecated API Usage, 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.
Identify which parts of the codebase use deprecated methods or APIs.
Identify Deprecated Methods
Please scan the current project for any deprecated library methods or APIs. For each deprecated method you find, provide the following details: the name of the method, the file in which it is located, and the specific line number. Additionally, include a brief explanation of why each method is considered deprecated and suggest alternative methods or APIs that should be used instead. Format the output as a structured list for easy reference.
Check Language Features
Review the codebase for any deprecated language features that may be present. Provide a detailed summary of each deprecated feature identified, including specific locations within the code where these features are used. Additionally, explain the potential impact of continuing to use these deprecated features and suggest alternatives or updates that should be considered to ensure compatibility with current standards. Format the summary in a clear, organized manner, highlighting each feature and its corresponding location in the code.
Analyze Dependency Versions
Please analyze the dependencies of my project to identify any that are deprecated or outdated. Provide a detailed list of these dependencies, including their current versions and the recommended updates for each. Additionally, include any potential impacts or issues that may arise from using these outdated versions, and suggest best practices for keeping dependencies up to date in the future.
Review API Documentation
Please review the API documentation for the project and identify any endpoints that are marked as deprecated. For each deprecated endpoint, provide a detailed description including its purpose, the reasons for deprecation, and any recommended alternatives that can be used. Additionally, explain how the transition to these alternatives can be implemented, including any necessary changes in the code or functionality. Format your response in a clear, structured manner with bullet points for easy reference.
Scan for Deprecated Annotations
Please scan the codebase for any deprecated annotations. For each occurrence you find, provide details on the specific annotation, including its location in the code, and suggest appropriate replacements if available. Additionally, summarize the potential impact of these deprecated annotations on the overall functionality and performance of the code. Present your findings in a clear and organized format, highlighting the most critical issues first.
Focus on updating the identified deprecated elements to their current alternatives.
Update Deprecated Methods
Identify all deprecated methods in the provided code snippet and replace each one with its current alternative. For each replacement, provide the updated code snippet along with a brief explanation of why the change was necessary. Ensure that the updated code maintains the same functionality as the original. Format your response clearly, separating each method update with headings for easy reference.
Refactor Language Features
Refactor the following code snippet that uses deprecated language features and update it to use the latest syntax. The original code is: [INSERT ORIGINAL CODE HERE]. Please provide the refactored code along with a brief explanation of the changes made, highlighting the deprecated features that were replaced and the benefits of using the new syntax. Ensure the refactored code is clean, efficient, and follows best practices.
Upgrade Dependencies
Please update the project's dependencies to the latest non-deprecated versions. Provide a detailed list of the updated dependencies, including the previous version numbers and the new version numbers for each. Additionally, explain any significant changes or improvements that come with these updates, and highlight any dependencies that may require additional attention or testing after the upgrade. Format the information in a clear, organized manner for easy reference.
Switch API Endpoints
Identify the deprecated API endpoints in my project and provide their current alternatives. For each deprecated endpoint, include a brief explanation of why it was replaced and any changes in parameters or response formats that I should be aware of. Additionally, present the updated API calls in a clear format, ensuring that I can easily integrate them into my existing codebase. Please ensure that the response is detailed enough to guide me through the transition without confusion.
Remove Deprecated Annotations
Please review the following code snippet and identify any deprecated annotations present. Replace each deprecated annotation with its modern equivalent and provide the revised code sections. Additionally, include a brief explanation of why each change was made, focusing on the benefits of using the updated annotations. Ensure the final output is clear and easy to understand, formatted in a way that highlights the differences between the original and revised code.
Ensure that all deprecated elements have been successfully updated and the code functions correctly.
Run Code Analysis
Please perform a comprehensive code analysis on the provided codebase to identify any deprecated methods or features that may still be in use. Include a detailed summary of your findings, highlighting any deprecated elements found, their locations within the code, and recommendations for updating or replacing them. Additionally, provide an overall assessment of the code's compliance with current best practices and any potential impacts of the deprecated features on functionality or performance. Format the results in a clear report that can be easily reviewed.
Execute Tests
Please execute the test suite for the project to ensure that all recent updates have not compromised existing functionality. Provide a detailed report of any test failures, including the specific tests that failed, the reasons for the failures if available, and any relevant error messages. Additionally, summarize the overall status of the test suite, indicating whether it passed or failed, and highlight any areas that may require further investigation or fixes.
Check Dependency Health
Please check the health of all project dependencies and verify that each one is up-to-date and not deprecated. Provide a detailed report that includes the name of each dependency, its current version, and whether it is up-to-date or deprecated. If any dependencies are found to be deprecated, suggest the latest version or an alternative that can be used. Format the results in a clear table for easy reference.
Validate API Calls
Please validate all API calls to ensure they are functioning correctly with the updated endpoints. For each API call, check the response status, response time, and any returned data to confirm it meets the expected output. Compile a detailed report summarizing the results of each API call, including any errors encountered, discrepancies in expected versus actual responses, and recommendations for any necessary adjustments. The report should be structured with sections for each API call, clearly outlining the findings and any action items.
Confirm Annotation Updates
Please verify that all deprecated annotations in the codebase have been successfully updated or removed. List the specific annotations that were changed, including their previous and updated states. Additionally, provide a summary of any potential impacts these changes may have on the overall functionality of the application. Include any recommendations for further actions if necessary.
Create mechanisms to avoid future use of deprecated elements.
Create CLAUDE.md Rule
Please create a new rule for CLAUDE.md that addresses the prevention of using deprecated methods in code. The rule should clearly outline the specific deprecated methods to avoid and provide guidance on alternative methods that should be used instead. Include examples of how to implement this rule in a codebase, ensuring that the language is clear and easy to understand. Format the rule in a way that can be directly added to CLAUDE.md, and make sure it is comprehensive enough to cover various scenarios where deprecated methods might be encountered.
Add Code Comments
Please add comments in the codebase to warn against the usage of deprecated features. Include specific examples of how these comments should be structured, ensuring they clearly indicate which features are deprecated and suggest alternatives if applicable. Additionally, provide context for why these warnings are important for maintaining code quality and preventing potential issues in the future. Format the comments in a way that is easy for other developers to understand and follow.
Develop Naming Conventions
Help me develop a set of naming conventions that clearly indicate deprecated elements in our codebase. The conventions should include specific prefixes or suffixes to be used for deprecated functions, variables, and classes, ensuring that these elements are easily identifiable by developers. Additionally, provide examples of how these conventions can be applied in practice, and explain the reasoning behind each suggestion to ensure clarity and consistency across the team. Aim for a comprehensive guideline that can be easily referenced and implemented in future projects.
Design Session-Opener Checklist
Please create a comprehensive checklist to review at the beginning of each session to ensure that no deprecated elements are utilized. The checklist should include specific items to verify, such as checking for outdated code snippets, confirming the use of current libraries and frameworks, and ensuring compliance with the latest best practices. Additionally, include a section for team members to add any notes or observations related to deprecated elements. Format the checklist in a clear and organized manner, suitable for easy reference during the session.
Implement Project Guard
Help me implement a project guard that automatically flags deprecated API usage during development. Provide a step-by-step guide on how to set this up, including the necessary configurations and code snippets. Explain how this guard can be integrated into the development workflow, what tools or libraries may be required, and how to test its effectiveness. Additionally, outline best practices for maintaining this guard over time to ensure it remains effective as the project evolves.
Cursor can scan your codebase for deprecated methods by analyzing the code and dependencies. Use specific prompts to get a detailed list of deprecated elements.
Failing to update deprecated APIs can lead to broken functionality when the API is eventually removed. Cursor helps identify and update these APIs to prevent future issues.
Cursor can check your project's dependencies against the latest versions and recommend updates. Use prompts to automate this check and keep dependencies current.
Yes, Cursor can suggest refactoring options for deprecated language features and provide updated code snippets to ensure compatibility with the latest standards.
Cursor can generate a CLAUDE.md rule or a project guard to automatically flag deprecated usage, helping maintain code quality over time.
AI Prompts for Identify Deprecated API Usage
Using deprecated library methods can lead to runtime errors and unexpected behavior in your application.
See promptsAI Prompts for Identifying Deprecated API Usage
Using deprecated library methods or APIs can cause future failures as they may be removed or unsupported.
See promptsAI Prompts for Identifying Deprecated API Usage
Using deprecated library methods or APIs can lead to future failures when these features are removed or changed.
See prompts