Move or rename a file while automatically updating all references in source code and documentation
Moves or renames files while automatically updating all references in source code, docs, and config files.
npx claudepluginhub synthesys-lab/agentizeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill instructs AI agents on how to safely move or rename files in a codebase while automatically finding and updating all references to the file in source code, documentation, and configuration files.
The move-a-file skill takes the following inputs:
When this skill is invoked, the AI agent MUST follow these steps in order:
Before proceeding, verify that:
If any validation fails, inform the user and abort.
Use rg (ripgrep) or grep to find all references to the file across the codebase.
IMPORTANT: Search for multiple patterns to catch all references:
Exact filename: Search for the exact filename (without path)
rg --type-add 'docs:*.md' --type-add 'config:*.{yaml,yml,json,toml}' \
-t md -t config -t py -t js -t sh -t c -t cpp \
"<filename>"
Full relative path: Search for the full path from project root
rg --type-add 'docs:*.md' --type-add 'config:*.{yaml,yml,json,toml}' \
-t md -t config -t py -t js -t sh -t c -t cpp \
"<old-path>"
Path variations: Search for common path variations
./: "./<old-path>""<path-without-ext>""import.*<filename-without-ext>"Search scope: Include at minimum:
.py, .js, .sh, .c, .cpp, etc.).md, .txt, .rst).yaml, .yml, .json, .toml)Makefile, CMakeLists.txt, package.json)For each file containing a reference:
Edit toolPath calculation rules:
After updating all references, move the file:
git mv "<old-path>" "<new-path>"
If the parent directory of the new path doesn't exist:
mkdir -p "$(dirname '<new-path>')" && git mv "<old-path>" "<new-path>"
After moving the file:
ls "<new-path>"Context: User wants to rename git-commit/SKILL.md to commit-msg/SKILL.md
Workflow:
User: Use move-a-file to rename the git-commit skill to commit-msg
Agent: I'll move the file and update all references.
1. Validating paths...
- Source exists: .claude/skills/git-commit/SKILL.md ✓
- Destination available: .claude/skills/commit-msg/SKILL.md ✓
2. Searching for references to "git-commit"...
Found references in:
- .claude/skills/CLAUDE.md (2 references)
- .claude/commands/README.md (1 reference)
- README.md (1 reference)
3. Updating references...
- .claude/skills/CLAUDE.md:79 - Updated skill name reference
- .claude/skills/CLAUDE.md:123 - Updated example path
- .claude/commands/README.md:45 - Updated skill link
- README.md:67 - Updated workflow reference
4. Moving the file...
[Runs: mkdir -p .claude/skills/commit-msg && git mv .claude/skills/git-commit/SKILL.md .claude/skills/commit-msg/SKILL.md]
5. Summary:
Moved: .claude/skills/git-commit/SKILL.md → .claude/skills/commit-msg/SKILL.md
Updated 4 references across 3 files
Context: User wants to reorganize docs by moving a file
Workflow:
User: Move docs/workflow.md to docs/agent/workflow.md
Agent: I'll move the file and update all references.
1. Validating paths...
- Source exists: docs/workflow.md ✓
- Creating parent directory: docs/agent/ ✓
2. Searching for references...
Found references in:
- README.md (3 references)
- docs/index.md (1 reference)
- .claude/skills/plan-guideline/SKILL.md (1 reference)
3. Updating references...
- README.md:23 - Updated link: [workflow](docs/workflow.md) → [workflow](docs/agent/workflow.md)
- README.md:45 - Updated link in list
- README.md:89 - Updated reference in text
- docs/index.md:12 - Updated link
- .claude/skills/plan-guideline/SKILL.md:234 - Updated documentation reference
4. Moving the file...
[Runs: mkdir -p docs/agent && git mv docs/workflow.md docs/agent/workflow.md]
5. Summary:
Moved: docs/workflow.md → docs/agent/workflow.md
Updated 5 references across 3 files
Context: Moving a new file that hasn't been referenced yet
Workflow:
User: Move temp/draft.md to docs/draft/implementation.md
Agent: I'll move the file and check for references.
1. Validating paths...
- Source exists: temp/draft.md ✓
- Creating parent directory: docs/draft/ ✓
2. Searching for references...
No references found to "draft.md" or "temp/draft.md"
3. Moving the file...
[Runs: mkdir -p docs/draft && git mv temp/draft.md docs/draft/implementation.md]
4. Summary:
Moved: temp/draft.md → docs/draft/implementation.md
No references needed updating
Always use git mv: This preserves file history in git. Never use regular mv command.
Case sensitivity: File systems may be case-insensitive, but git is case-sensitive. Be careful when changing only the case of a filename.
Search thoroughly: Different files may reference the moved file in different ways. Use multiple search patterns to catch all variations.
Path relativity: When updating references, consider whether the reference should be:
Import statements: Programming language imports may need special handling:
from module.submodule import fileimport { func } from './path/to/file'source ./path/to/file.shGlob patterns: Also search for glob patterns that might match the file:
docs/**/*.md might be used to reference all markdown filesReport uncertainty: If you find a reference that you're unsure how to update, include it in the final report and ask the user to review it manually.
Don't move directories: This skill is for moving individual files only. For moving entire directories, the process is more complex and should be handled separately.
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.