/SKILL.md
基于 AI 语义分析的智能文件整理技能,根据文件内容动态创建 Johnny Decimal 分类。 当用户提到以下内容时触发: - "整理文件"、"分类文件"、"组织下载"、"文件归档" - "文件太多了"、"下载文件夹很乱"、"文件乱七八糟" - "把文件按类别整理"、"自动分类文件" - "清理下载文件夹"、"整理文档" - "文件管理"、"文件分类整理" - 提到需要将文件从一个目录移动到另一个目录进行分类 核心功能: - AI 分析文件名语义,动态生成分类 - 使用 Johnny Decimal 编号系统(XX.YY 格式) - 自动检测重复文件(MD5 算法) - 用户确认分类计划后再执行
npx skillsauth add akira82-ai/file-organizer file-organizerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
技能启动时,首先向用户显示以下欢迎信息:
═══════════════════════════════════════════════════════════════
▌ 智能文件整理器 ▐
AI 驱动的文件分类系统
═══════════════════════════════════════════════════════════════
磊叔 │ 微信:AIRay1015 │ github.com/akira82-ai
───────────────────────────────────────────────────────────
📁 Johnny Decimal 智能分类系统
🤖 AI 语义分析,动态生成分类
🔍 内置重复文件检测(MD5)
✨ 执行前预览确认,安全可靠
═══════════════════════════════════════════════════════════════
技能已启动...
基于 AI 语义分析的智能文件整理技能,根据文件内容动态创建分类。
| 特性 | 说明 | |------|------| | 分类方式 | AI 分析文件名语义,动态生成分类 | | 交互模式 | AskUserQuestion 询问源/目标目录 | | 用户确认 | 显示分类计划后等待确认 | | 目标优先 | 优先使用目标目录现有分类 | | 重复检测 | 使用 MD5 算法自动检测重复文件 |
本技能通过自然语言触发,你可以用多种方式描述需求:
示例:
如果需要指定特定目录:
AskUserQuestion 询问源目录和目标目录~/Downloads, ./files)本技能使用 Johnny Decimal 编号系统进行文件分类。详细规范请参考:references/johnny_decimal.md
核心要点:
XX.YY 格式的分类编号(如 01-01, 10-05)01-XX 技术类,02-XX 商业类)编号_类别名称快速示例:
01-01_人工智能技术 # 技术领域
01-02_网络安全 # 技术领域
01-03_编程开发 # 技术领域
02-01_金融经济 # 商业领域(新主题,主编号递增)
02-02_消费零售 # 商业领域
检查用户是否提供了源目录和目标目录参数。
python3 scripts/manage_history.py read --type source
source_history使用 AskUserQuestion 询问用户:
source_history 不为空,将历史记录作为选项添加(标注"最近使用")示例选项:
- "/Users/xxx/Downloads"(最近使用)
- "/Users/xxx/Desktop"(历史记录)
- "下载文件夹"(~/Downloads)
- "桌面"(~/Desktop)
- "文档"(~/Documents)
- "输入新路径"
python3 scripts/manage_history.py read --type target
target_history使用 AskUserQuestion 询问用户:
target_history 不为空,将历史记录作为选项添加(标注"最近使用")示例选项:
- "/Users/xxx/Documents/Organized"(最近使用)
- "/Users/xxx/Desktop/Archive"(历史记录)
- "文档文件夹"(~/Documents)
- "桌面"(~/Desktop)
- "输入新路径"
ls -la "$target"
ls -1 "$source"
. 开头)如果目标目录有分类:将文件匹配到现有分类
如果目标目录无分类:AI 分析所有文件名,动态创建分类
重要:生成的分类名称必须带编号前缀,格式为 编号_类别名称
01-01, 01-02, 02-01, 10-05 等_ 分隔编号递增规则(关键):
01-XX,所有商业相关用 02-XX,所有行业相关用 03-XX01-01 到 01-99)01, 02, 03...)示例:
01-01_人工智能技术 # 技术领域
01-02_网络安全 # 技术领域
01-03_编程开发 # 技术领域
02-01_金融经济 # 商业领域(新主题,主编号递增)
02-02_消费零售 # 商业领域
02-03_商业管理 # 商业领域
03-01_教育培训 # 行业领域(新主题,主编号再递增)
03-02_医疗健康 # 行业领域
分类原则:
根据步骤 6 生成的分类,向用户展示整理计划。
显示策略:
[展开查看全部] 选项统计文件总数(Bash):
total_files=$(ls -1 "$source" | wc -l | tr -d ' ')
示例格式(使用实际变量):
模式 A:完整列表(≤30 个文件)
📁 源目录: $source (13 个文件)
📂 目标目录: $target (新建分类)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 01-01_学习资料 (3 files)
├── 学习笔记Python.pdf
├── 课程视频.mp4
└── 教程.md
💻 01-02_代码项目 (2 files)
├── React组件.tsx
└── script.py
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
模式 B:智能摘要(>30 个文件)
📁 源目录: $source (127 个文件)
📂 目标目录: $target (新建分类)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 01-01_学习资料 (45 files) [展开查看全部]
├── 学习笔记Python.pdf
├── 课程视频.mp4
└── 教程.md
... 还有 42 个文件
💻 01-02_代码项目 (38 files) [展开查看全部]
├── React组件.tsx
├── script.py
└── index.html
... 还有 35 个文件
📦 01-03_压缩备份 (44 files) [展开查看全部]
├── backup.zip
├── archive.tar.gz
└── documents.7z
... 还有 41 个文件
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 提示:文件数量较多,显示为智能摘要模式
注意: 显示时使用实际的 $source 和 $target 变量值,不要硬编码路径。
使用 AskUserQuestion 询问是否执行:
选项:
必须等待用户确认后才能执行移动操作
模式切换说明:
展开查看全部 选项替换为 返回摘要模式在用户确认后,保存本次使用的目录到历史记录。
# 保存源目录
python3 scripts/manage_history.py add --type source --path "$source"
# 保存目标目录
python3 scripts/manage_history.py add --type target --path "$target"
根据步骤 6 生成的分类,动态创建目录。
格式: $target/编号_类别名称
示例(根据实际分类动态创建):
# 假设 AI 生成的分类为:
# - 01-01_Claude相关
# - 01-02_AI综合应用
# - 01-03_代码项目
mkdir -p "$target/01-01_Claude相关"
mkdir -p "$target/01-02_AI综合应用"
mkdir -p "$target/01-03_代码项目"
注意: 必须使用 $target 变量,不要硬编码路径。
使用 Bash 命令批量移动文件到对应分类目录。
在移动文件完成后,检查目标目录是否存在重复文件。
# 调用 Python 脚本检查重复文件
python3 scripts/check_duplicates.py "$target"
脚本输出示例:
🔍 重复文件检查报告
============================================================
📂 目标目录: /Users/user/Documents/Archives
📄 总文件数: 45
✅ 唯一文件: 42
🔄 重复组数: 1
⚠️ 发现以下重复文件:
MD5: a1b2c3d4e5f6...
大小: 1,234,567 字节
✅ 保留: 01-01_学习资料/document.pdf
时间: 2025-02-10 14:30:00
🗑️ 重复: 01-02_代码项目/document.pdf
时间: 2025-02-15 09:20:00
处理重复文件(如果发现重复):
使用 AskUserQuestion 询问用户处理方式:
选项:
如果选择自动删除:
python3 scripts/check_duplicates.py "$target" --delete
删除策略:
如果选择保留所有:
如果未发现重复文件:
# 检查源目录是否清空
ls -1 "$source" | wc -l
# 显示各分类文件数
echo ""
echo "📊 分类统计:"
for dir in "$target"/*/; do
dir_name=$(basename "$dir")
echo " $dir_name"
done
. 开头)testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).