From idea-to-code
Guides file moving, renaming, and reorganization using git mv or bash mv over write/delete patterns to preserve git history, metadata, and reduce errors during code refactoring.
How this skill is triggered — by the user, by Claude, or both
Slash command
/idea-to-code:file-organizationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When reorganizing files, moving files, or renaming files, follow these guidelines:
When reorganizing files, moving files, or renaming files, follow these guidelines:
Use git mv or mv via Bash instead of Write + delete:
git mv old/path/File.java new/path/File.java
Then use Edit to update any necessary content (e.g., package declarations).
IMPORTANT: Never recreate files from scratch when the original exists. Move the file first, then edit its contents.
When reorganizing Java packages:
# 1. Create new directory structure
mkdir -p src/main/java/com/example/newpackage
# 2. Move the file
mv src/main/java/com/example/oldpackage/MyClass.java src/main/java/com/example/newpackage/
# 3. Update the package declaration
# Use Edit tool to change: package com.example.oldpackage;
# To: package com.example.newpackage;
When moving files during refactoring:
Before moving source files in a refactoring:
src/main/java, src/test/java, AND custom source setssrc/integrationTest, src/integration-test, src/componentTest, src/component-testIMPORTANT: This is one situation where ./gradlew build passing is insufficient. You must verify that each test class has a corresponding TEST-*.xml file in the correct build directory. Tests may compile but not run if source sets are misconfigured.
When converting single-module to multi-module:
git show HEAD:path/to/build.gradle to capture original configurationReserve the Write tool for:
Do NOT use Write for:
Use the right tool for file discovery and inspection:
| Task | Use | Instead of |
|---|---|---|
| List/find files | Glob | ls, find |
| Search file contents | Grep | grep, rg |
| Read file contents | Read | cat, head, tail |
| Edit files | Edit | sed, awk |
The dedicated tools:
command 2>/dev/null || echo "fallback"npx claudepluginhub humansintheloop-dev/humansintheloop-dev-workflow-and-tools --plugin idea-to-codeMove or rename a file while automatically updating all references in source code, documentation, and config files across the codebase.
Organizes repository structure by detecting conventions, auditing file placement, and executing move plans with import-path updates.
Organizes project files into conventional directories, updates stale READMEs, cleans configuration drift, and archives deprecated items without changing code logic.