organize

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

文件夹整理助手

Folder Organization Assistant

功能说明

Feature Description

帮助用户梳理混乱的文件夹,按归属分类、统一命名、清理冗余,让目录结构一目了然。
  • /organize
    → 整理当前工作目录
  • /organize [路径]
    → 整理指定目录

Help users sort out messy folders, classify by ownership, unify naming, clean up redundancies, and make the directory structure clear at a glance.
  • /organize
    → Organize the current working directory
  • /organize [path]
    → Organize the specified directory

工作流程

Workflow

第1步:扫描全貌

Step 1: Scan the Full Picture

  1. ls -la
    查看根目录所有文件和文件夹(包括隐藏文件)
  2. 对子目录做一层展开,了解内容
  3. 记录文件总数、目录总数、散落文件数
关注点
  • 散落在根目录的文件(没有归入任何子目录的)
  • 命名风格不统一的目录(如有的带前缀有的不带)
  • 隐藏目录/文件(判断是工具产物还是用户文件)
  • 疑似重复的文件(文件名相似的用 md5 比对)
  1. ls -la
    to view all files and folders in the root directory (including hidden files)
  2. Expand subdirectories one level to understand the content
  3. Record the total number of files, total number of directories, and number of scattered files
Focus Points:
  • Files scattered in the root directory (not placed in any subdirectory)
  • Directories with inconsistent naming styles (e.g., some with prefixes, some without)
  • Hidden directories/files (determine if they are tool products or user files)
  • Suspected duplicate files (compare with md5 for similar file names)

第2步:分析归属

Step 2: Analyze Ownership

把所有文件和目录按归属方分类。常见的归属维度:
  1. 按所有者:客户的 / 内部的 / 个人的
  2. 按类型:文档 / 代码 / 设计 / 数据 / 媒体
  3. 按状态:活跃的 / 归档的 / 可删除的
分类原则
  • 优先按归属方分,同一归属方的东西放一起
  • 已经成体系的目录结构不动(如有明确组织的子目录)
  • 工具产生的临时文件/缓存/日志,归为"可清理"类
判断"可清理"的标准
  • 隐藏目录中只有 .DS_Store 或日志文件
  • 工具运行产生的缓存/临时目录(如 .playwright-mcp、node_modules 等)
  • 评测/调试的中间产物,已无后续使用价值
  • 重复文件中较旧的那份(需 md5 确认后才算重复)
Classify all files and directories by owner. Common ownership dimensions:
  1. By Owner: Client's / Internal / Personal
  2. By Type: Documents / Code / Design / Data / Media
  3. By Status: Active / Archived / Deletable
Classification Principles:
  • Prioritize classification by owner; place items of the same owner together
  • Do not modify directory structures that are already systematic (e.g., subdirectories with clear organization)
  • Temporary files/caches/logs generated by tools are classified as "cleanable"
Criteria for "Cleanable":
  • Hidden directories containing only .DS_Store or log files
  • Cache/temporary directories generated by tool operations (e.g., .playwright-mcp, node_modules, etc.)
  • Intermediate products from evaluation/debugging that have no subsequent use value
  • Older copies of duplicate files (only confirmed as duplicates after md5 comparison)

第3步:制定方案

Step 3: Develop a Plan

输出整理方案,包含:
  1. 目标结构:用树形图展示整理后的目录结构
  2. 操作清单
    • 新建哪些目录
    • 哪些文件/目录移动到哪里
    • 哪些目录/文件重命名
    • 哪些可以删除
  3. 不动的部分:明确哪些保持不变、为什么
方案格式
整理后结构:
目标目录/
├── 分类A/
│   ├── ...
├── 分类B/
│   ├── ...
└── 保留不动的/

操作清单:
- [新建] 分类A/
- [移动] xxx → 分类A/xxx
- [重命名] yyy → zzz(统一命名风格)
- [删除] .cache/(工具缓存,无保留价值)
- [不动] 保留不动的/(已有结构,无需调整)
Output the organization plan, including:
  1. Target Structure: Show the organized directory structure with a tree diagram
  2. Action List:
    • Which directories to create
    • Which files/directories to move where
    • Which directories/files to rename
    • Which can be deleted
  3. Unchanged Parts: Clearly state which parts remain unchanged and why
Plan Format:
Organized Structure:
Target Directory/
├── Category A/
│   ├── ...
├── Category B/
│   ├── ...
└── Retained/

Action List:
- [Create] Category A/
- [Move] xxx → Category A/xxx
- [Rename] yyy → zzz (Unify naming style)
- [Delete] .cache/ (Tool cache, no retention value)
- [Keep] Retained/ (Existing structure, no adjustment needed)

第4步:确认后执行

Step 4: Execute After Confirmation

必须等用户确认后再执行。用户可能:
  • 同意全部 → 直接执行
  • 部分调整 → 按调整后的方案执行
  • 只做清理不做分类 → 只执行删除部分
执行顺序:
  1. 先建目录
  2. 再移动文件(并行移动无依赖的文件)
  3. 再重命名
  4. 最后删除
  5. 执行完
    ls -la
    验证结果
Must wait for user confirmation before execution. Users may:
  • Agree to all → Execute directly
  • Adjust partially → Execute according to the adjusted plan
  • Only clean up without classification → Only execute the deletion part
Execution Order:
  1. Create directories first
  2. Move files next (move independent files in parallel)
  3. Rename afterwards
  4. Delete last
  5. Run
    ls -la
    to verify results after execution

第5步:展示结果

Step 5: Display Results

输出整理后的目录树,标注变化。

Output the organized directory tree, marking changes.

核心原则

Core Principles

1. 按归属分,不按格式分

1. Classify by Ownership, Not by Format

"客户A的方案.pptx" 应该放在
客户A/
下面,而不是放在
PPT/
下面。归属比格式重要。
"Client A's Proposal.pptx" should be placed under
Client A/
instead of
PPT/
. Ownership is more important than format.

2. 确认再动,不自作主张

2. Confirm Before Acting, Do Not Act Arbitrarily

整理方案必须给用户看过、确认后才执行。尤其是删除操作,宁可多问一句。
The organization plan must be reviewed and confirmed by the user before execution. Especially for deletion operations, it's better to ask one more question.

3. 统一命名风格

3. Unify Naming Styles

同级目录的命名风格要一致:
  • 要么都带前缀,要么都不带
  • 要么都用中文,要么都用英文
  • 日期格式统一
Naming styles for directories at the same level must be consistent:
  • Either all with prefixes or all without
  • Either all in Chinese or all in English
  • Unified date format

4. 不动已有结构

4. Do Not Modify Existing Structures

如果某个子目录内部已经组织得很好,不要拆散重组。整理的目标是根目录清晰,不是追求完美对称。
If a subdirectory is already well-organized internally, do not break it up and reorganize it. The goal of organization is to make the root directory clear, not to pursue perfect symmetry.

5. 疑似重复先验证

5. Verify Suspected Duplicates First

文件名相似不代表内容相同。必须用 md5 比对确认后才能判定为重复。
Similar file names do not mean identical content. Must confirm with md5 comparison before judging as duplicates.

6. 隐藏文件谨慎处理

6. Handle Hidden Files Carefully

.
开头的目录可能是工具配置(如 .claude、.git),不要随意移动或删除。只清理明确是缓存/日志的。
Directories starting with
.
may be tool configurations (e.g., .claude, .git), do not move or delete them randomly. Only clean up those clearly identified as caches/logs.