20 of the best prompts for updating module imports consistently, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
20 of the best prompts for updating module imports consistently, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
Claude Code changes a module's exports but does not update the files that import from it, leading to broken dependencies and runtime errors. This disrupts the development workflow and can cause significant delays. These prompts guide the developer to ensure all import statements are correctly updated, maintaining code integrity. Built across 4 distinct stages covering Diagnose the Wall, Isolate and Fix, Verify the Resolution and more, this guide gives you one expert prompt per step so you never have to write from scratch or guess what the AI needs. The prompts work in ChatGPT, Claude, and Gemini and are designed to get usable output on the first try.
Identify which module exports were changed and which files import them.
Identify Changed Exports
Identify the exports that have been modified in [MODULE_NAME] recently. For each export, provide a detailed comparison that includes the previous state and the current state. Additionally, explain the implications of these changes on the overall functionality of the module. Format your response in a clear table with columns for the export name, previous state, current state, and a brief description of the impact of the changes.
Locate Importing Files
Please locate all files in the project that import from [MODULE_NAME]. Provide a detailed list of these files, including their file paths and any relevant context about how they utilize the imported module. Additionally, summarize the purpose of each file in relation to the module and highlight any potential issues or dependencies that may arise from these imports.
Check for Errors
Please analyze the project for any import-related errors. Identify specific files or modules that are causing issues and provide a summary of the findings, including the nature of each error and potential solutions to resolve them. Additionally, include any recommendations for best practices to avoid similar errors in the future. Format the results in a clear, organized manner for easy reference.
Review CLAUDE.md Rules
Please review the following CLAUDE.md file content: [PASTE CONTENT]. Identify and confirm which specific rules pertain to updating module exports and imports. Provide a detailed explanation of each applicable rule, including examples of how they should be applied in a coding context. Additionally, summarize any best practices related to module exports and imports that can enhance code maintainability and clarity.
Analyze Dependency Graph
Please analyze the dependency graph for [MODULE_NAME]. Identify and highlight any broken links or issues within the graph that may affect the functionality of the module. Provide a detailed report that includes the nature of the broken links, potential causes, and suggestions for resolving these issues. Additionally, include a visual representation of the dependency graph to illustrate the relationships and where the breaks occur.
Focus on updating import statements to match the new exports.
Update Import Statements
Please review each file that imports from [MODULE_NAME] and update the import statements to align with the new exports. Ensure that all necessary components are correctly imported and that any deprecated imports are removed. Provide a summary of the changes made for each file, including the original and updated import statements. If any imports are no longer needed, list them separately for reference.
Refactor Code for Compatibility
Refactor the code in [FILE_NAME] to ensure compatibility with the new export structure. Identify all instances where the old exports are used and update them accordingly. Provide comments in the code to explain the changes made and ensure that the refactored code maintains the same functionality as before. Additionally, include a brief summary of the changes in a separate section at the top of the file, outlining what was modified and why.
Run Automated Tests
Please execute all relevant automated tests to ensure that the recent changes made to the imports and exports do not disrupt any existing functionality. Provide a detailed report on the results, highlighting any failures or issues encountered during the testing process. Additionally, include recommendations for fixing any identified problems and suggestions for further testing to validate the changes. The report should be structured with sections for test results, issues found, and proposed solutions.
Check for Unused Imports
Please analyze the codebase of my project and identify any unused imports that can be safely removed. Provide a detailed list of these unused imports along with the specific files they are located in. Additionally, explain the potential benefits of removing these imports, such as improving code readability and reducing memory usage. Finally, suggest best practices for managing imports in future development to prevent similar issues.
Verify Export Consistency
Please verify the consistency of all exports in the [MODULE_NAME] throughout the entire project. Identify any discrepancies or inconsistencies in naming, usage, or structure. Provide a detailed report that includes a list of all exports, their locations, and any instances where they are used inconsistently. Additionally, suggest corrections for any identified issues to ensure uniformity across the project.
Ensure the changes have resolved the import issues without introducing new ones.
Run Full Project Build
Please conduct a full build of the project and provide a detailed report on any errors or warnings encountered during the process. Include information on the specific files or components that caused issues, the nature of the errors or warnings, and suggestions for resolving them. Additionally, summarize the overall status of the build, indicating whether it was successful or if further action is required. Format the report clearly, highlighting key points for easy reference.
Execute Integration Tests
Please run a comprehensive set of integration tests to ensure that all modules interact correctly and function seamlessly after the recent import updates. Outline the specific modules being tested and the expected outcomes for each integration point. Additionally, provide a summary of any issues encountered during testing, along with recommendations for resolving them. The report should be structured clearly, with sections for each module, test results, and conclusions.
Check Log Files
Please review the log files for any errors related to module imports. Summarize your findings by identifying the specific errors encountered, the modules affected, and any potential reasons for these errors. Additionally, provide recommendations on how to resolve these issues and prevent them from occurring in the future. Format your summary in a clear and concise manner, highlighting key points for easy reference.
Confirm Dependency Resolution
Please verify that all dependencies for the project are correctly resolved. List any missing modules or errors that are reported, and provide details on how to address these issues. Additionally, include a summary of the current state of the dependencies, specifying which ones are successfully resolved and any that may require further attention. Format your response in a clear, structured manner to facilitate easy understanding and follow-up actions.
Review Code Changes
Please review the recent code changes made to address the import issues in the project. Summarize the specific modifications, including the files affected, the nature of the changes (e.g., added imports, modified paths, or updated dependencies), and any potential impacts these changes may have on the overall functionality. Additionally, highlight any remaining concerns or areas that may require further attention. Format your response as a detailed report with bullet points for clarity.
Create safeguards to prevent similar issues in the future.
Draft CLAUDE.md Rule
Please draft a new rule for the CLAUDE.md documentation that ensures import statements are automatically updated whenever there are changes to exports. The rule should outline the specific conditions under which the updates should occur, including any relevant examples of import statements that would be affected. Additionally, include guidelines on how to handle potential conflicts or errors that may arise during the update process. Format the rule clearly with headings and bullet points for easy reference.
Add Code Comments
Please add detailed comments in the code of [MODULE_NAME] that explain the significance of updating imports whenever exports change. Include specific examples of potential issues that can arise from not updating imports, such as broken functionality or runtime errors. Additionally, outline best practices for maintaining imports and exports in a codebase to ensure clarity and prevent future errors. Make sure the comments are clear and concise, providing guidance for other developers who may work with this module in the future.
Create Session-Opener Checklist
Create a comprehensive session-opener checklist that ensures all necessary steps are taken before beginning a session. Include items such as verifying import-export consistency, checking for any missing data or files, confirming that all required software and tools are operational, and ensuring that all team members are prepared and informed about their roles. Additionally, outline any specific protocols for addressing discrepancies or issues that may arise during the session. Format the checklist in a clear, actionable way that allows for easy tracking and completion.
Establish Naming Convention
Please propose a comprehensive naming convention for exports that minimizes the risk of import mismatches in a coding environment. Outline the key principles that should guide the naming process, such as clarity, consistency, and context. Include specific examples of naming patterns for different types of exports, such as functions, classes, and constants. Additionally, suggest best practices for documenting these conventions to ensure all team members adhere to them. Aim for a format that can be easily referenced and implemented by developers.
Implement Project Guard
Create a project guard that monitors module exports and alerts the development team whenever changes are made to exports without corresponding updates in the imports. The guard should track all modules in the project and provide a detailed report of any discrepancies, including the specific modules affected and the nature of the changes. Additionally, implement a notification system that sends alerts to the team via email or a messaging platform whenever an inconsistency is detected. Ensure that the guard can be easily integrated into the existing project workflow and provide documentation on how to use it effectively.
Claude Code operates autonomously but relies on explicit instructions to update imports. It requires clear rules in CLAUDE.md to manage such changes.
Use prompts to identify all files importing a module and systematically update each import statement to match the new exports.
Failing to update imports can lead to runtime errors, broken functionality, and increased debugging time.
Yes, by defining rules in CLAUDE.md, you can automate the process of updating imports when exports change.
Regularly review and test your CLAUDE.md rules to ensure they cover all scenarios and adjust them based on feedback from Claude Code.
AI Prompts for Fixing Broken Tests After Changes
Code changes can break previously passing tests, causing unexpected failures.
See promptsAI Prompts for Identify Export Changes Impacting Imports
The issue arises when Bolt modifies a module's exports without updating the dependent files, leading to broken imports.
See promptsAI Prompts for Prevent Module Export Conflicts
When a module's exports change without updating the importing files, it can lead to runtime errors and broken functionality.
See prompts