关于 file-organizer
file-organizer 是帮助用户整理电脑文件夹的技能,适合希望建立清晰文件结构的人。它检查文件、查找重复项、提出整理方案,并在获批后执行更改;删除操作前会先征求确认。
主要功能
- 01检查文件夹与文件结构
- 02查找重复文件
- 03建议合理的文件夹分类
- 04获批后移动和重命名文件
- 05标记可清理的旧文件
适用场景
- 01整理杂乱的 Downloads 文件夹
- 02查找 Documents 中的重复项
- 03区分活跃项目与归档项目
- 04按日期整理照片
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ w95/ awesome-claude-corporate-skills --skill file-organizer安装后在 Claude Code 中输入/file-organizer确认已加载。
详细介绍
文件整理
这项技能会充当你的个人整理助手,帮助你在不必费心持续手动整理的情况下,让电脑上的文件结构保持整洁、有条理。
何时使用这项技能
- 你的 Downloads 文件夹乱成一团
- 文件散落各处,让你找不到
- 重复文件占用了空间
- 文件夹结构变得不再合理
- 你想养成更好的整理习惯
- 你正在开始一个新项目,需要合适的结构
- 你准备归档旧项目,想先清理一番
这项技能能做什么
- 分析当前结构:检查文件夹和文件,了解现有内容
- 查找重复文件:找出系统中的重复文件
- 提出整理建议:根据内容提出合理的文件夹结构
- 自动清理:在你批准后移动、重命名和整理文件
- 保留上下文:根据文件类型、日期和内容做出明智的决定
- 减少杂乱:找出可能不再需要的旧文件
使用方法
从主目录开始
cd ~
然后运行 Claude Code 并请求帮助:
Help me organize my Downloads folder
Find duplicate files in my Documents folder
Review my project directories and suggest improvements
特定整理任务
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]
说明
当用户请求文件整理帮助时:
-
了解整理范围
提出澄清问题:
- 哪个目录需要整理?(Downloads、Documents、整个主文件夹?)
- 主要问题是什么?(找不到东西、重复文件、太杂乱、没有结构?)
- 有哪些文件或文件夹需要避开?(当前项目、敏感数据?)
- 希望整理到什么程度?(保守整理还是全面清理?)
-
分析当前状态
检查目标目录:
# 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总结调查结果:
- 文件和文件夹总数
- 文件类型分布
- 大小分布
- 日期范围
- 明显的整理问题
-
确定整理模式
根据文件确定合理的分组方式:
按类型:
- 文档(PDF、DOCX、TXT)
- 图片(JPG、PNG、SVG)
- 视频(MP4、MOV)
- 压缩包(ZIP、TAR、DMG)
- 代码/项目(包含代码的目录)
- 电子表格(XLSX、CSV)
- 演示文稿(PPTX、KEY)
按用途:
- 工作与个人
- 活跃与归档
- 特定项目
- 参考资料
- 临时/草稿文件
按日期:
- 当前年份/月份
- 往年
- 很久以前的文件(适合归档)
-
查找重复文件
根据需要搜索重复文件:
# 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对于每组重复文件:
- 显示所有文件路径
- 显示大小和修改日期
- 建议保留哪个文件(通常是最新的或名称最合适的)
- 重要:删除前务必征求确认
-
提出整理方案
更改前先给出清晰的方案:
# 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) -
执行整理
获得批准后,系统地整理:
# 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"重要规则:
- 删除任何内容前务必确认
- 记录所有移动操作,以便必要时撤销
- 保留原始修改日期
- 妥善处理文件名冲突
- 遇到意外情况时停止并询问
-
提供总结和维护建议
整理完成后:
# 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]想再整理另一个文件夹吗?
Examples
Example 1: Organizing Downloads (From Justin Dielmann)
User: "My Downloads folder is a mess with 500+ files. Help me organize it."
Process:
- Analyzes Downloads folder
- Finds patterns: work docs, personal photos, installers, random PDFs
- Proposes structure:
- Downloads/
- Work/
- Personal/
- Installers/ (DMG, PKG files)
- Archive/
- ToSort/ (things needing decisions)
- Downloads/
- Asks for confirmation
- Moves files intelligently based on content and names
- Results: 500 files → 5 organized folders
Example 2: Finding and Removing Duplicates
User: "Find duplicate files in my Documents and help me decide which to keep."
Output:
# Found 23 Sets of Duplicates (156 MB total)
## Duplicate Set 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...]
示例 3:重组项目文件夹
用户:“检查我的 ~/Projects 目录并提出改进建议。”
输出:
# Analysis of ~/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)
## Proposed Structure
Projects/ ├── Active/ │ ├── client-work/ │ ├── side-projects/ │ └── learning/ ├── Archive/ │ ├── 2022/ │ ├── 2023/ │ └── 2024/ └── Templates/
## 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?
示例 4:按日期整理照片
用户:“按年份和月份整理我的照片文件夹。”
输出:创建类似这样的结构:
Photos/
├── 2023/
│ ├── 01-January/
│ ├── 02-February/
│ └── ...
├── 2024/
│ ├── 01-January/
│ └── ...
└── Unsorted/
然后根据 EXIF 数据或文件修改日期移动照片。
常见整理任务
清理下载内容
Organize my Downloads folder - move documents to Documents,
images to Pictures, keep installers separate, and archive files
older than 3 months.
整理项目
Review my Projects folder structure and help me separate active
projects from old ones I should archive.
移除重复文件
Find all duplicate files in my Documents folder and help me
decide which ones to keep.
清理桌面
My Desktop is covered in files. Help me organize everything into
my Documents folder properly.
整理照片
Organize all photos in this folder by date (year/month) based
on when they were taken.
分离工作与个人文件
Help me separate my work files from personal files across my
Documents folder.
实用技巧
- 从小处着手:先整理一个杂乱的文件夹(如“下载”),建立信任
- 定期维护:每周清理一次“下载”文件夹
- 统一命名:重要文件使用“YYYY-MM-DD - Description”格式
- 积极归档:将旧项目移至 Archive,而不是删除
- 将当前工作单独存放:明确区分当前工作和已归档工作
- 相信这个流程:让 Claude 承担判断文件去向的认知负担
最佳实践
文件夹命名
- 使用清晰、描述性强的名称
- 避免使用空格(改用连字符或下划线)
- 使用具体名称:“client-proposals”而不是“docs”
- 使用前缀排序:“01-current”、“02-archive”
文件命名
- 包含日期:“2024-10-17-meeting-notes.md”
- 描述清晰:“q3-financial-report.xlsx”
- 避免在名称中加入版本号(改用版本控制)
- 移除下载产生的冗余后缀:“document-final-v2 (1).pdf” → “document.pdf”
何时归档
- 6 个月以上未处理的项目
- 以后可能会查阅的已完成工作
- 迁移至新系统后留下的旧版本
- 不确定是否要删除的文件(先归档)
相关用例
- 为新电脑设置文件整理方式
- 为备份或归档准备文件
- 清理存储空间前整理文件
- 整理共享团队文件夹
- 规划新的项目目录结构