Fix Broken Imports

Fix broken import statements caused by file moves, renames, or deletions.

3|1|Updated Apr 18, 2021
One-click install
npx skills add https://github.com/nashgao/mqtt-client --skill fix-broken-imports
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Fix Broken Imports
Source: https://github.com/nashgao/mqtt-client/tree/main/.claude/skills/fix-imports
Command: npx skills add https://github.com/nashgao/mqtt-client --skill fix-broken-imports

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automatically detects and fixes broken import statements in your codebase that result from file moves, renames, or deletions, ensuring code continuity.

Core Features & Use Cases

  • Automated Import Analysis: Scans for file-not-found, module resolution failures, and other import-related errors.
  • Intelligent Resolution: Suggests and applies fixes like updating relative paths, maintaining path aliases, and recognizing barrel exports.
  • Use Case: After refactoring your project structure, use this Skill to automatically correct all the import paths that have become invalid, preventing build failures and saving significant debugging time.

Quick Start

Run the fix-imports skill to scan for and resolve all broken import statements in the current project.

Frequently Asked Questions about Fix Broken Imports

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix broken imports after moving or renaming files in my codebase?

Fix broken imports by scanning the codebase for file-not-found and module resolution errors caused by file moves, renames, or deletions. The Skill analyzes import patterns, suggests resolutions, and applies fixes incrementally with verification to ensure code continuity.

Can this tool automatically update relative paths and maintain path aliases during refactoring?

Yes, it provides intelligent resolution by automatically updating relative paths, maintaining path aliases, and recognizing barrel exports. It systematically applies these fixes to correct invalid import paths and prevent build failures after project structure changes.

What is the best way to resolve module resolution failures across a large project?

The best way to resolve module resolution failures is using incremental application with verification. This approach analyzes import patterns across the project and maintains session continuity for progress tracking across multiple runs to ensure all invalid paths are corrected.

How do I track the progress of resolving multiple broken import statements?

You can track progress using the session continuity feature, which maintains state across multiple runs. This allows you to incrementally apply and verify fixes for broken import statements over time without losing track of previously resolved errors.

Does resolving broken imports require manual debugging for every invalid path?

No, automated import analysis eliminates manual debugging by scanning for file-not-found errors and module resolution failures. It systematically suggests and applies resolutions for invalid paths caused by structural refactoring, saving significant debugging time.