import-refactor

Update import statements and references across Python, TypeScript, and JavaScript projects.

12|2|Updated May 29, 2025
One-click install
npx skills add https://github.com/sorryhyun/DiPeO --skill import-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: import-refactor
Source: https://github.com/sorryhyun/DiPeO/tree/main/.claude/skills/import-refactor
Command: npx skills add https://github.com/sorryhyun/DiPeO --skill import-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Moving or renaming files and modules often leads to a cascade of broken import statements, string paths, and configuration references across multiple languages (Python, TypeScript, JavaScript). This skill eliminates the tedious, error-prone manual work of updating these references, making refactoring seamless and reliable.

Core Features & Use Cases

  • Multi-Language Support: Automatically updates imports and references in Python, TypeScript, and JavaScript files, ensuring consistency across your entire codebase.
  • Comprehensive Reference Update: Handles not just import statements, but also string-based paths, configuration files, and even documentation examples, leaving no broken links behind.
  • Systematic Verification: Before and after updates, it verifies that paths exist and imports resolve correctly, drastically reducing post-refactoring bugs and ensuring code integrity.
  • Use Case: If you decide to move a utils.py file to a new /common/utils/ directory, this skill will automatically find and update all from old_path import ... statements to from common.utils import ..., saving you hours of manual search-and-replace and preventing runtime errors.

Quick Start

Moving utilities to /utils:

1. Map old paths -> new paths

2. Find ALL references (imports, strings, configs, docs)

3. Update systematically by type

4. Verify paths exist and imports resolve

5. Report changes made (e.g., "23 files, 45 imports updated")

Frequently Asked Questions about import-refactor

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

FAQPage Schema
How do I update all imports after moving files in my Python or JavaScript project?

Import refactoring automatically finds and updates import statements, string paths, and configuration references across Python, TypeScript, and JavaScript files when you move or rename modules. It verifies that all paths exist and imports resolve correctly, eliminating manual search-and-replace work and preventing broken imports.

Can I refactor a large codebase without manually fixing every import statement?

Yes. The skill processes large refactors in batches, systematically updating imports by type while preserving your import style—absolute vs. relative paths. It handles documentation and config files too, reporting all changes made so you know exactly what was updated across your codebase.

What happens to string-based paths and configuration references when I restructure directories?

The skill updates not just imports but also string-based paths in configuration files and documentation. It verifies each reference before and after the update, ensuring no broken links remain in configs, docs, or hardcoded path strings.

Does import refactoring work across multiple programming languages in the same project?

Yes. The skill supports Python, TypeScript, and JavaScript simultaneously, so you can refactor imports consistently across a polyglot codebase. It applies the same systematic verification and batch-processing logic to each language.

How does the skill prevent runtime errors after refactoring imports?

It validates that updated imports resolve and paths exist both before and after changes. This verification step catches mismatches early, drastically reducing post-refactoring bugs and ensuring code integrity before you run your application.

What's the best way to handle moving utilities or shared modules without breaking dependent code?

Map the old paths to new paths, then let the skill find all references in imports, strings, and configs. It updates them systematically by type, verifies resolution, and reports the total count of files and imports changed—typically saving hours of manual refactoring.