| name | file-organizer |
| version | 1.0.0 |
| description | Organizes project files into a clean directory structure following best practices. Use this when the user asks to organize, restructure, or clean up their project's file layout. |
File Organizer
Reorganize project files into a well-structured directory layout.
Overview
This skill scans a project directory, identifies file types and purposes,
then moves files into a clean, conventional structure. It adapts to the
project type (Node.js, Python, Go, etc.) and follows community standards.
Phase 1: Analysis
- Scan the project root for all files and directories
- Identify the project type from config files (package.json, pyproject.toml, go.mod)
- Catalog each file's purpose: source, test, config, asset, documentation
- Identify files that are misplaced or unconventionally located
Checkpoint: Present the analysis summary to the user before proceeding.
Phase 2: Planning
- Design the target directory structure based on project type:
- Node.js:
src/, test/, docs/, scripts/, assets/
- Python:
src/{package}/, tests/, docs/
- Go:
cmd/, internal/, pkg/, docs/
- Create a move plan mapping current paths to target paths
- Identify import/require statements that will need updating
- Check for potential conflicts (files with same name in different dirs)
Checkpoint: Show the move plan and ask for confirmation.
Phase 3: Execution
- Create target directories
- Move files according to the plan
- Update import paths in all affected source files
- Update configuration files (tsconfig, webpack, etc.) with new paths
- Run the project's build/test command to verify nothing broke
Checkpoint: Report results and any issues encountered.
Phase 4: Cleanup
- Remove empty directories left behind
- Update
.gitignore if needed
- Create a summary of all changes made
Guidelines
- Never delete files without explicit user confirmation
- Always create a backup suggestion before large moves
- Preserve git history by using git mv when possible
- Handle circular dependency issues in import updates
- If build fails after reorganization, revert and report