File organizer skill

Intelligently organizes files and folders by understanding context, finding duplicates, and suggesting better organizational structures.

by davila7·MIT license·★ 32,299 Stars on the repo·GitHub ↗

Use now

Files of File organizer

davila7/main1 file shown
SKILL.md
Show the full text251 lines

File Organizer

When to Use This Skill

  • Your Downloads folder is a chaotic mess
  • You can't find files because they're scattered everywhere
  • You have duplicate files taking up space
  • Your folder structure doesn't make sense anymore
  • You want to establish better organization habits
  • You're starting a new project and need a good structure
  • You're cleaning up before archiving old projects

What This Skill Does

  1. Analyzes Current Structure: Reviews your folders and files to understand what you have
  2. Finds Duplicates: Identifies duplicate files across your system
  3. Suggests Organization: Proposes logical folder structures based on your content
  4. Automates Cleanup: Moves, renames, and organizes files with your approval
  5. Maintains Context: Makes smart decisions based on file types, dates, and content
  6. Reduces Clutter: Identifies old files you probably don't need anymore

Instructions

When a user requests file organization help:

  1. Understand the Scope

    Ask clarifying questions:

    • Which directory needs organization? (Downloads, Documents, entire home folder?)
    • What's the main problem? (Can't find things, duplicates, too messy, no structure?)
    • Any files or folders to avoid? (Current projects, sensitive data?)
    • How aggressively to organize? (Conservative vs. comprehensive cleanup)
  2. Analyze Current State

    Review the target directory:

    # Get overview of current structure
    ls -la [target_directory]
    
    # Check file types and sizes
    find [target_directory] -type f -exec file {} \; | head -20
    
    # Identify largest files
    du -sh [target_directory]/* | sort -rh | head -20
    
    # Count file types
    find [target_directory] -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn
    

    Summarize findings:

    • Total files and folders
    • File type breakdown
    • Size distribution
    • Date ranges
    • Obvious organization issues
  3. Identify Organization Patterns

    Based on the files, determine logical groupings:

    By Type:

    • Documents (PDFs, DOCX, TXT)
    • Images (JPG, PNG, SVG)
    • Videos (MP4, MOV)
    • Archives (ZIP, TAR, DMG)
    • Code/Projects (directories with code)
    • Spreadsheets (XLSX, CSV)
    • Presentations (PPTX, KEY)

    By Purpose:

    • Work vs. Personal
    • Active vs. Archive
    • Project-specific
    • Reference materials
    • Temporary/scratch files

    By Date:

    • Current year/month
    • Previous years
    • Very old (archive candidates)
  4. Find Duplicates

    When requested, search for duplicates:

    # Find exact duplicates by hash
    find [directory] -type f -exec md5 {} \; | sort | uniq -d
    
    # Find files with similar names
    find [directory] -type f -printf '%f\n' | sort | uniq -d
    
    # Find similar-sized files
    find [directory] -type f -printf '%s %p\n' | sort -n
    

    For each set of duplicates:

    • Show all file paths
    • Display sizes and modification dates
    • Recommend which to keep (usually newest or best-named)
    • Important: Always ask for confirmation before deleting
  5. Propose Organization Plan

    Present a clear plan before making changes:

    # Organization Plan for [Directory]
    
    ## Current State
    
    - X files across Y folders
    - [Size] total
    - File types: [breakdown]
    - Issues: [list problems]
    
    ## Proposed Structure
    
    [Directory]/
    ├── Work/
    │ ├── Projects/
    │ ├── Documents/
    │ └── Archive/
    ├── Personal/
    │ ├── Photos/
    │ ├── Documents/
    │ └── Media/
    └── Downloads/
    ├── To-Sort/
    └── Archive/
    
    ## Changes I'll Make
    
    1. **Create new folders**: [list]
    2. **Move files**:
       - X PDFs → Work/Documents/
       - Y images → Personal/Photos/
       - Z old files → Archive/
    3. **Rename files**: [any renaming patterns]
    4. **Delete**: [duplicates or trash files]
    
    ## Files Needing Your Decision
    
    - [List any files you're unsure about]
    
    Ready to proceed? (yes/no/modify)
    
  6. Execute Organization

    After approval, organize systematically:

    # Create folder structure
    mkdir -p "path/to/new/folders"
    
    # Move files with clear logging
    mv "old/path/file.pdf" "new/path/file.pdf"
    
    # Rename files with consistent patterns
    # Example: "YYYY-MM-DD - Description.ext"
    

    Important Rules:

    • Always confirm before deleting anything
    • Log all moves for potential undo
    • Preserve original modification dates
    • Handle filename conflicts gracefully
    • Stop and ask if you encounter unexpected situations
  7. Provide Summary and Maintenance Tips

    After organizing:

    # Organization Complete! ✨
    
    ## What Changed
    
    - Created [X] new folders
    - Organized [Y] files
    - Freed [Z] GB by removing duplicates
    - Archived [W] old files
    
    ## New Structure
    
    [Show the new folder tree]
    
    ## Maintenance Tips
    
    To keep this organized:
    
    1. **Weekly**: Sort new downloads
    2. **Monthly**: Review and archive completed projects
    3. **Quarterly**: Check for new duplicates
    4. **Yearly**: Archive old files
    
    ## Quick Commands for You
    
    # Find files modified this week
    
    find . -type f -mtime -7
    
    # Sort downloads by type
    
    [custom command for their setup]
    
    # Find duplicates
    
    [custom command]
    

    Want to organize another folder?

Best Practices

Folder Naming
  • Use clear, descriptive names
  • Avoid spaces (use hyphens or underscores)
  • Be specific: "client-proposals" not "docs"
  • Use prefixes for ordering: "01-current", "02-archive"
File Naming
  • Include dates: "2024-10-17-meeting-notes.md"
  • Be descriptive: "q3-financial-report.xlsx"
  • Avoid version numbers in names (use version control instead)
  • Remove download artifacts: "document-final-v2 (1).pdf" → "document.pdf"
When to Archive
  • Projects not touched in 6+ months
  • Completed work that might be referenced later
  • Old versions after migration to new systems
  • Files you're hesitant to delete (archive first)
1---
2name: file-organizer
3description: Intelligently organizes files and folders by understanding context, finding duplicates, and suggesting better organizational structures. Use when user wants to clean up directories, organize downloads, remove duplicates, or restructure projects.
4---
5 
6# File Organizer
7 
8## When to Use This Skill
9 
10- Your Downloads folder is a chaotic mess
11- You can't find files because they're scattered everywhere
12- You have duplicate files taking up space
13- Your folder structure doesn't make sense anymore
14- You want to establish better organization habits
15- You're starting a new project and need a good structure
16- You're cleaning up before archiving old projects
17 
18## What This Skill Does
19 
201. **Analyzes Current Structure**: Reviews your folders and files to understand what you have
212. **Finds Duplicates**: Identifies duplicate files across your system
223. **Suggests Organization**: Proposes logical folder structures based on your content
234. **Automates Cleanup**: Moves, renames, and organizes files with your approval
245. **Maintains Context**: Makes smart decisions based on file types, dates, and content
256. **Reduces Clutter**: Identifies old files you probably don't need anymore
26 
27## Instructions
28 
29When a user requests file organization help:
30 
311. **Understand the Scope**
32 
33 Ask clarifying questions:
34 
35 - Which directory needs organization? (Downloads, Documents, entire home folder?)
36 - What's the main problem? (Can't find things, duplicates, too messy, no structure?)
37 - Any files or folders to avoid? (Current projects, sensitive data?)
38 - How aggressively to organize? (Conservative vs. comprehensive cleanup)
39 
402. **Analyze Current State**
41 
42 Review the target directory:
43 
44 ```bash
45 # Get overview of current structure
46 ls -la [target_directory]
47 
48 # Check file types and sizes
49 find [target_directory] -type f -exec file {} \; | head -20
50 
51 # Identify largest files
52 du -sh [target_directory]/* | sort -rh | head -20
53 
54 # Count file types
55 find [target_directory] -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn
56 ```
57 
58 Summarize findings:
59 
60 - Total files and folders
61 - File type breakdown
62 - Size distribution
63 - Date ranges
64 - Obvious organization issues
65 
663. **Identify Organization Patterns**
67 
68 Based on the files, determine logical groupings:
69 
70 **By Type**:
71 
72 - Documents (PDFs, DOCX, TXT)
73 - Images (JPG, PNG, SVG)
74 - Videos (MP4, MOV)
75 - Archives (ZIP, TAR, DMG)
76 - Code/Projects (directories with code)
77 - Spreadsheets (XLSX, CSV)
78 - Presentations (PPTX, KEY)
79 
80 **By Purpose**:
81 
82 - Work vs. Personal
83 - Active vs. Archive
84 - Project-specific
85 - Reference materials
86 - Temporary/scratch files
87 
88 **By Date**:
89 
90 - Current year/month
91 - Previous years
92 - Very old (archive candidates)
93 
944. **Find Duplicates**
95 
96 When requested, search for duplicates:
97 
98 ```bash
99 # Find exact duplicates by hash
100 find [directory] -type f -exec md5 {} \; | sort | uniq -d
101 
102 # Find files with similar names
103 find [directory] -type f -printf '%f\n' | sort | uniq -d
104 
105 # Find similar-sized files
106 find [directory] -type f -printf '%s %p\n' | sort -n
107 ```
108 
109 For each set of duplicates:
110 
111 - Show all file paths
112 - Display sizes and modification dates
113 - Recommend which to keep (usually newest or best-named)
114 - **Important**: Always ask for confirmation before deleting
115 
1165. **Propose Organization Plan**
117 
118 Present a clear plan before making changes:
119 
120 ```markdown
121 # Organization Plan for [Directory]
122 
123 ## Current State
124 
125 - X files across Y folders
126 - [Size] total
127 - File types: [breakdown]
128 - Issues: [list problems]
129 
130 ## Proposed Structure
131 
132 [Directory]/
133 ├── Work/
134 │ ├── Projects/
135 │ ├── Documents/
136 │ └── Archive/
137 ├── Personal/
138 │ ├── Photos/
139 │ ├── Documents/
140 │ └── Media/
141 └── Downloads/
142 ├── To-Sort/
143 └── Archive/
144 
145 ## Changes I'll Make
146 
147 1. **Create new folders**: [list]
148 2. **Move files**:
149 - X PDFs → Work/Documents/
150 - Y images → Personal/Photos/
151 - Z old files → Archive/
152 3. **Rename files**: [any renaming patterns]
153 4. **Delete**: [duplicates or trash files]
154 
155 ## Files Needing Your Decision
156 
157 - [List any files you're unsure about]
158 
159 Ready to proceed? (yes/no/modify)
160 ```
161 
1626. **Execute Organization**
163 
164 After approval, organize systematically:
165 
166 ```bash
167 # Create folder structure
168 mkdir -p "path/to/new/folders"
169 
170 # Move files with clear logging
171 mv "old/path/file.pdf" "new/path/file.pdf"
172 
173 # Rename files with consistent patterns
174 # Example: "YYYY-MM-DD - Description.ext"
175 ```
176 
177 **Important Rules**:
178 
179 - Always confirm before deleting anything
180 - Log all moves for potential undo
181 - Preserve original modification dates
182 - Handle filename conflicts gracefully
183 - Stop and ask if you encounter unexpected situations
184 
1857. **Provide Summary and Maintenance Tips**
186 
187 After organizing:
188 
189 ```markdown
190 # Organization Complete! ✨
191 
192 ## What Changed
193 
194 - Created [X] new folders
195 - Organized [Y] files
196 - Freed [Z] GB by removing duplicates
197 - Archived [W] old files
198 
199 ## New Structure
200 
201 [Show the new folder tree]
202 
203 ## Maintenance Tips
204 
205 To keep this organized:
206 
207 1. **Weekly**: Sort new downloads
208 2. **Monthly**: Review and archive completed projects
209 3. **Quarterly**: Check for new duplicates
210 4. **Yearly**: Archive old files
211 
212 ## Quick Commands for You
213 
214 # Find files modified this week
215 
216 find . -type f -mtime -7
217 
218 # Sort downloads by type
219 
220 [custom command for their setup]
221 
222 # Find duplicates
223 
224 [custom command]
225 ```
226 
227 Want to organize another folder?
228 
229## Best Practices
230 
231### Folder Naming
232 
233- Use clear, descriptive names
234- Avoid spaces (use hyphens or underscores)
235- Be specific: "client-proposals" not "docs"
236- Use prefixes for ordering: "01-current", "02-archive"
237 
238### File Naming
239 
240- Include dates: "2024-10-17-meeting-notes.md"
241- Be descriptive: "q3-financial-report.xlsx"
242- Avoid version numbers in names (use version control instead)
243- Remove download artifacts: "document-final-v2 (1).pdf" → "document.pdf"
244 
245### When to Archive
246 
247- Projects not touched in 6+ months
248- Completed work that might be referenced later
249- Old versions after migration to new systems
250- Files you're hesitant to delete (archive first)
251 

Discussion