Claude-skill-registry file-system-organizer
Organizes or restructures files and directories according to a specified hierarchy or categorization scheme. Analyzes existing structures, creates new directory trees, intelligently moves files based on content and naming patterns, and verifies the final organization.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/file-system-organizer" ~/.claude/skills/majiayu000-claude-skill-registry-file-system-organizer && rm -rf "$T"
manifest:
skills/data/file-system-organizer/SKILL.mdsource content
Instructions
Objective
Reorganize the user's file system from a messy or unspecified state into a clean, logical directory structure as specified by the user.
Core Workflow
1. Analyze the Current State
- Action: Use
to explore the target workspace.filesystem-list_directory - Goal: Understand the existing folder layout and identify all files that need to be categorized. Start from the root path the user indicates (e.g.,
). Recursively list subdirectories to build a complete mental map./workspace
2. Parse the Target Structure
- Action: Interpret the user's request, which may include a text-based tree diagram or a verbal description.
- Goal: Build a clear, hierarchical model of the desired final directory structure (e.g.,
,School/Courses_Materials
).Work/Projects
3. Create the Directory Hierarchy
- Action: Use
to build the new structure.filesystem-create_directory - Critical Logic: Create directories sequentially from the root down. Do not attempt to create a nested subdirectory (
) before its parent (A/B/C
) exists. The trajectory shows that attempting this in parallel causes "Parent directory does not exist" errors.A/B - Best Practice: Create all top-level directories first, then their immediate children, proceeding layer by layer.
4. Categorize and Move Files
- Action: Use
to relocate files from their original locations to their new, categorized homes.filesystem-move_file - Intelligence Required: Determine the correct destination for each file by analyzing:
- File Name: Keywords like
,Course
,Graduation
,Exam
,Project
,Application
,CV
,Movie
,Music
.Picture - File Extension:
,.mp3
,.mp4
→ Entertainment;.mkv
,.pdf
,.doc
,.ppt
→ likely School or Work..xlsx - Current Location: A file inside an existing
folder is likely media.Entertainment - Content Inference:
is a picture, likely of a pet.cat.png
- File Name: Keywords like
- Procedure: Move files in batches. Verify each move operation is successful before proceeding.
5. Cleanup and Verification
- Action:
- Use
to generate a visual map of the newly organized workspace.filesystem-directory_tree - Present this tree to the user for confirmation.
- If original source directories are now empty, remove them using
(e.g.,terminal-run_command
).rm -rf /path/to/empty_folder
- Use
- Goal: Leave the workspace tidy and provide clear evidence of the completed task.
Key Principles
- Defensive Creation: Always check for or assume parent directories need to be created first.
- Informed Moving: Use multiple signals (name, extension, path) to make accurate categorization decisions.
- Verification: Always show the end result. Do not assume success without checking.