file-organizer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

File Organizer

文件整理助手(File Organizer)

This skill acts as your personal organization assistant, helping you maintain a clean, logical file structure across your computer without the mental overhead of constant manual organization.
本技能可作为你的个人整理助手,帮助你在电脑上维持整洁、合理的文件结构,无需持续手动整理,减少认知负担。

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
  1. 分析当前结构:扫描你的文件夹和文件,了解现有内容
  2. 查找重复文件:识别系统内的重复文件
  3. 提供整理建议:根据文件内容提出合理的文件夹结构方案
  4. 自动化清理:在你确认后,自动执行移动、重命名和整理文件的操作
  5. 保留上下文信息:根据文件类型、日期和内容做出智能决策
  6. 减少杂乱:识别你可能不再需要的旧文件

How to Use

使用方法

From Your Home Directory

从主目录开始

cd ~
Then run Claude Code and ask for help:
Help me organize my Downloads folder
Find duplicate files in my Documents folder
Review my project directories and suggest improvements
cd ~
然后运行Claude Code并请求帮助:
Help me organize my Downloads folder
Find duplicate files in my Documents folder
Review my project directories and suggest improvements

Specific Organization Tasks

特定整理任务

Organize these downloads into proper folders based on what they are
Find duplicate files and help me decide which to keep
Clean up old files I haven't touched in 6+ months
Create a better folder structure for my [work/projects/photos/etc]
Organize these downloads into proper folders based on what they are
Find duplicate files and help me decide which to keep
Clean up old files I haven't touched in 6+ months
Create a better folder structure for my [work/projects/photos/etc]

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:
    bash
    # 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:
    bash
    # Find exact duplicates by hash
    find [directory] -type f -exec md5 {} \; | sort | uniq -d
    
    # Find files with same name
    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:
    markdown
    # 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:
    bash
    # 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:
    markdown
    # 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
    
    ```bash
    # 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?
    undefined
当用户请求文件整理帮助时:
  1. 明确范围
    提出澄清问题:
    • 需要整理哪个目录?(下载文件夹、文档文件夹、整个主目录?)
    • 主要问题是什么?(找不到文件、重复文件、过于杂乱、结构不合理?)
    • 是否有需要避开的文件或文件夹?(当前项目、敏感数据?)
    • 整理的激进程度?(保守整理 vs 全面清理)
  2. 分析当前状态
    检查目标目录:
    bash
    # 获取当前结构概览
    ls -la [target_directory]
    
    # 检查文件类型和大小
    find [target_directory] -type f -exec file {} \; | head -20
    
    # 识别最大的文件
    du -sh [target_directory]/* | sort -rh | head -20
    
    # 统计文件类型
    find [target_directory] -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn
    总结发现:
    • 文件和文件夹总数
    • 文件类型分布
    • 大小分布
    • 日期范围
    • 明显的结构问题
  3. 确定整理模式
    根据文件内容,确定合理的分组方式:
    按类型分组
    • 文档(PDF、DOCX、TXT)
    • 图片(JPG、PNG、SVG)
    • 视频(MP4、MOV)
    • 压缩包(ZIP、TAR、DMG)
    • 代码/项目(包含代码的目录)
    • 电子表格(XLSX、CSV)
    • 演示文稿(PPTX、KEY)
    按用途分组
    • 工作 vs 个人
    • 活跃项目 vs 归档项目
    • 特定项目
    • 参考资料
    • 临时/草稿文件
    按日期分组
    • 当前年/月
    • 往年
    • 超旧文件(归档候选)
  4. 查找重复文件
    当用户提出请求时,搜索重复文件:
    bash
    # 通过哈希值查找完全重复的文件
    find [directory] -type f -exec md5 {} \; | sort | uniq -d
    
    # 查找同名文件
    find [directory] -type f -printf '%f\n' | sort | uniq -d
    
    # 查找大小相似的文件
    find [directory] -type f -printf '%s %p\n' | sort -n
    对于每组重复文件:
    • 显示所有文件路径
    • 展示文件大小和修改日期
    • 建议保留哪一个(通常是最新或命名规范的文件)
    • 重要提示:删除前务必征得用户确认
  5. 提出整理方案
    在执行修改前,先呈现清晰的方案:
    markdown
    # [目录]整理方案
    
    ## 当前状态
    - 共X个文件,分布在Y个文件夹中
    - 总大小:[Size]
    - 文件类型:[分布情况]
    - 存在问题:[列出问题]
    
    ## 建议的目录结构
    
    [目录]/ ├── 工作/ │ ├── 项目/ │ ├── 文档/ │ └── 归档/ ├── 个人/ │ ├── 照片/ │ ├── 文档/ │ └── 媒体/ └── 下载/ ├── 待整理/ └── 归档/
    
    ## 执行的操作
    
    1. **创建新文件夹**:[列表]
    2. **移动文件**:
       - X个PDF文件 → 工作/文档/
       - Y张图片 → 个人/照片/
       - Z个旧文件 → 归档/
    3. **重命名文件**:[重命名规则]
    4. **删除**:[重复文件或垃圾文件]
    
    ## 需要你决策的文件
    
    - [列出不确定的文件]
    
    是否准备开始执行?(是/否/修改方案)
  6. 执行整理操作
    获得用户批准后,系统地执行整理:
    bash
    # 创建文件夹结构
    mkdir -p "path/to/new/folders"
    
    # 移动文件并记录日志
    mv "old/path/file.pdf" "new/path/file.pdf"
    
    # 按照统一规则重命名文件
    # 示例:"YYYY-MM-DD - 描述.ext"
    重要规则
    • 删除任何文件前务必确认
    • 记录所有移动操作,以便撤销
    • 保留文件原始修改日期
    • 妥善处理文件名冲突
    • 遇到意外情况时立即停止并询问用户
  7. 提供总结和维护建议
    整理完成后:
    markdown
    # 整理完成!✨
    
    ## 变更内容
    
    - 创建了[X]个新文件夹
    - 整理了[Y]个文件
    - 删除重复文件释放了[Z] GB存储空间
    - 归档了[W]个旧文件
    
    ## 新目录结构
    
    [展示新的文件夹树]
    
    ## 维护建议
    
    为保持整洁,建议:
    
    1. **每周**:整理新下载的文件
    2. **每月**:检查并归档已完成的项目
    3. **每季度**:检查是否有新的重复文件
    4. **每年**:归档旧文件
    
    ## 快捷命令
    
    ```bash
    # 查找本周修改的文件
    find . -type f -mtime -7
    
    # 按类型整理下载文件
    [为你的系统定制的命令]
    
    # 查找重复文件
    [定制命令]
    需要整理其他文件夹吗?
    undefined

Examples

示例

Example 1: Organizing Downloads (From Justin Dielmann)

示例1:整理下载文件夹(来自Justin Dielmann)

User: "My Downloads folder is a mess with 500+ files. Help me organize it."
Process:
  1. Analyzes Downloads folder
  2. Finds patterns: work docs, personal photos, installers, random PDFs
  3. Proposes structure:
    • Downloads/
      • Work/
      • Personal/
      • Installers/ (DMG, PKG files)
      • Archive/
      • ToSort/ (things needing decisions)
  4. Asks for confirmation
  5. Moves files intelligently based on content and names
  6. Results: 500 files → 5 organized folders
用户:"我的下载文件夹有500多个文件,杂乱不堪,帮我整理一下。"
处理流程
  1. 分析下载文件夹
  2. 识别文件模式:工作文档、个人照片、安装包、随机PDF文件
  3. 提出结构方案:
    • 下载/
      • 工作/
      • 个人/
      • 安装包/(DMG、PKG文件)
      • 归档/
      • 待整理/(需要决策的文件)
  4. 请求用户确认
  5. 根据文件内容和名称智能移动文件
  6. 结果:500个文件 → 5个整理好的文件夹

Example 2: Finding and Removing Duplicates

示例2:查找并删除重复文件

User: "Find duplicate files in my Documents and help me decide which to keep."
Output:
markdown
undefined
用户:"查找我的文档文件夹中的重复文件,帮我决定保留哪些。"
输出
markdown
undefined

Found 23 Sets of Duplicates (156 MB total)

找到23组重复文件(共占用156 MB存储空间)

Duplicate Set 1: "proposal.pdf"

重复组1:"proposal.pdf"

  • /Documents/proposal.pdf
    (2.3 MB, modified: 2024-03-15)
  • /Documents/old/proposal.pdf
    (2.3 MB, modified: 2024-03-15)
  • /Desktop/proposal.pdf
    (2.3 MB, modified: 2024-03-10)
Recommendation: Keep
/Documents/proposal.pdf
(most recent in correct location) Delete the other 2 copies?
[Continue for all duplicates...]
undefined
  • /Documents/proposal.pdf
    (2.3 MB,修改日期:2024-03-15)
  • /Documents/old/proposal.pdf
    (2.3 MB,修改日期:2024-03-15)
  • /Desktop/proposal.pdf
    (2.3 MB,修改日期:2024-03-10)
建议:保留
/Documents/proposal.pdf
(最新版本,存储在正确目录) 是否删除另外2个副本?
[继续展示所有重复组...]
undefined

Example 3: Restructuring Projects Folder

示例3:重构项目文件夹

User: "Review my ~/Projects directory and suggest improvements."
Output:
markdown
undefined
用户:"检查我的~/Projects目录,提出改进建议。"
输出
markdown
undefined

Analysis of ~/Projects

~/Projects目录分析

Current Structure Issues

当前结构问题

  • Mix of active and archived projects (3+ years old)
  • No consistent naming convention
  • Some projects at root, others in random subfolders
  • Duplicate folders (project-name, project-name-old, project-name-v2)
  • 活跃项目与归档项目(3年以上)混合存放
  • 命名规则不统一
  • 部分项目在根目录,部分在随机子文件夹中
  • 存在重复文件夹(project-name、project-name-old、project-name-v2)

Proposed Structure

建议的结构

Projects/
├── Active/
│   ├── client-work/
│   ├── side-projects/
│   └── learning/
├── Archive/
│   ├── 2022/
│   ├── 2023/
│   └── 2024/
└── Templates/
Projects/
├── 活跃项目/
│   ├── 客户项目/
│   ├── 个人项目/
│   └── 学习项目/
├── 归档/
│   ├── 2022/
│   ├── 2023/
│   └── 2024/
└── 模板/

Specific Changes

具体变更

  1. Move 12 projects not touched since 2022 → Archive/
  2. Consolidate 4 duplicate project folders
  3. Rename projects to consistent format: "client-name-project-name"
  4. Create Archive for old work
Want me to implement this?
undefined
  1. 将12个2022年之后未修改的项目 → 归档/
  2. 合并4个重复的项目文件夹
  3. 将项目重命名为统一格式:"客户名称-项目名称"
  4. 创建归档目录存放旧项目
是否需要执行此方案?
undefined

Example 4: Organizing Photos by Date

示例4:按日期整理照片

User: "Organize my photo folders by year and month."
Output: Creates structure like:
Photos/
├── 2023/
│   ├── 01-January/
│   ├── 02-February/
│   └── ...
├── 2024/
│   ├── 01-January/
│   └── ...
└── Unsorted/
Then moves photos based on EXIF data or file modification dates.
用户:"按年、月整理我的照片文件夹。"
输出:创建如下结构:
照片/
├── 2023/
│   ├── 01-一月/
│   ├── 02-二月/
│   └── ...
├── 2024/
│   ├── 01-一月/
│   └── ...
└── 未分类/
然后根据EXIF数据或文件修改日期移动照片。

Common Organization Tasks

常见整理任务

Downloads Cleanup

下载文件夹清理

Organize my Downloads folder - move documents to Documents, 
images to Pictures, keep installers separate, and archive files 
older than 3 months.
整理我的下载文件夹 - 将文档移至文档目录,图片移至图片目录,单独存放安装包,归档3个月以上的旧文件。

Project Organization

项目整理

Review my Projects folder structure and help me separate active 
projects from old ones I should archive.
检查我的项目文件夹结构,帮助我区分活跃项目和需要归档的旧项目。

Duplicate Removal

重复文件删除

Find all duplicate files in my Documents folder and help me 
decide which ones to keep.
查找我的文档文件夹中的所有重复文件,帮我决定保留哪些。

Desktop Cleanup

桌面清理

My Desktop is covered in files. Help me organize everything into 
my Documents folder properly.
我的桌面堆满了文件,帮我将所有文件妥善整理到文档文件夹中。

Photo Organization

照片整理

Organize all photos in this folder by date (year/month) based 
on when they were taken.
按拍摄日期(年/月)整理此文件夹中的所有照片。

Work/Personal Separation

工作/个人文件分离

Help me separate my work files from personal files across my 
Documents folder.
帮我将文档文件夹中的工作文件和个人文件分开。

Pro Tips

实用技巧

  1. Start Small: Begin with one messy folder (like Downloads) to build trust
  2. Regular Maintenance: Run weekly cleanup on Downloads
  3. Consistent Naming: Use "YYYY-MM-DD - Description" format for important files
  4. Archive Aggressively: Move old projects to Archive instead of deleting
  5. Keep Active Separate: Maintain clear boundaries between active and archived work
  6. Trust the Process: Let Claude handle the cognitive load of where things go
  1. 从小处着手:从一个杂乱的文件夹(如下载文件夹)开始,建立信任
  2. 定期维护:每周对下载文件夹进行清理
  3. 统一命名:重要文件使用"YYYY-MM-DD - 描述"格式
  4. 积极归档:将旧项目移至归档目录而非直接删除
  5. 区分活跃与归档:清晰划分活跃工作和归档工作的界限
  6. 信任流程:让Claude处理文件归类的认知负担

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"
  • 使用清晰、描述性的名称
  • 避免空格(使用连字符或下划线)
  • 具体明确:用"客户提案"而非"文档"
  • 使用前缀排序:"01-当前项目"、"02-归档项目"

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"
  • 包含日期:"2024-10-17-会议记录.md"
  • 描述清晰:"第三季度财务报告.xlsx"
  • 文件名中避免版本号(使用版本控制工具代替)
  • 移除下载后缀:将"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)
  • 6个月以上未修改的项目
  • 已完成、可能后续需要参考的工作
  • 迁移到新系统后的旧版本文件
  • 你犹豫是否删除的文件(先归档)

Related Use Cases

相关使用场景

  • Setting up organization for a new computer
  • Preparing files for backup/archiving
  • Cleaning up before storage cleanup
  • Organizing shared team folders
  • Structuring new project directories
  • 新电脑的文件结构设置
  • 备份/归档前的文件清理
  • 存储空间清理前的整理
  • 团队共享文件夹的整理
  • 新项目目录的结构搭建