Agent skill
import-refactor
Update all import statements, module references, string paths, and config references after moving or renaming files and modules. Handles Python, TypeScript, and JavaScript imports. Use when moving files, renaming modules, restructuring directories, or consolidating code.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/import-refactor
SKILL.md
Import and Reference Updater
This guide is for updating all module references after moving or renaming files, including import statements, string paths, and configuration references.
Core workflow:
- Map old paths → new paths
- Find ALL references (imports, strings, configs, docs)
- Update systematically by type
- Verify paths exist and imports resolve
- Report changes made
Reference types updated:
- Import statements (Python/TS/JS)
- String-based paths
- Configuration files
- Documentation examples
Quick example
Moving utilities to /utils:
1. Find old utility imports
2. Update to /utils imports
3. Update string references
4. Update docs
→ Report: 23 files, 45 imports updated
Best practices:
- Verify paths exist before updating
- Preserve import style (absolute vs relative)
- Process in batches for large refactorings
- Test after major changes
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?