migrate-module

Move Python modules or symbols and rewrite all import statements across the codebase.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/bilgrami/corporate-agent --skill migrate-module-bilgrami
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-module
Source: https://github.com/bilgrami/corporate-agent/tree/main/skills/migrate-module
Command: npx skills add https://github.com/bilgrami/corporate-agent --skill migrate-module-bilgrami

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Move a Python module (file) or individual symbol (function/class) to a new location, and automatically rewrite all import statements across the codebase.

Core Features & Use Cases

  • Move an entire module file to a new path
  • Move a single symbol between files
  • Update all imports across the project to reflect the move
  • Detect and handle dependency and path issues

Quick Start

Move the target module from its old path to the new path and update all affected imports across the repository.

Frequently Asked Questions about migrate-module

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

FAQPage Schema
How do I move a Python module to a new directory and update all imports automatically?

To move a Python module, you relocate the file and run an automated import rewrite across the codebase. This dependency analysis updates all affected import statements to reflect the new module path and maintain package structure.

Can I migrate a single Python function or class between files instead of moving the whole module?

Yes, you can migrate individual symbols like functions or classes between files. The process moves the specific symbol to a new location and automatically rewrites all corresponding import statements across the project to point to the new file.

What is the best way to refactor Python codebase imports when relocating modules across repositories?

The best way to refactor imports during cross-repository module relocation is using automated move planning and dependency analysis. This approach detects path issues, handles optional __init__.py files, and rewrites all import statements to preserve package structure.

Does moving a Python file break existing import dependencies in my project?

Moving a Python file can break import dependencies if not handled correctly. Automated dependency analysis detects these path issues during the move, rewrites all affected import statements, and manages __init__.py files to maintain structural integrity.

How do you handle __init__.py files when moving Python modules to a new path?

When moving Python modules, the process includes optional __init__.py handling to maintain package structure. This ensures that the destination and origin directories remain valid Python packages after the import rewrite and dependency analysis are complete.