Skills file-manager
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/buptlihang/smart-file-manager" ~/.claude/skills/openclaw-skills-file-manager && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/buptlihang/smart-file-manager" ~/.openclaw/skills/openclaw-skills-file-manager && rm -rf "$T"
manifest:
skills/buptlihang/smart-file-manager/SKILL.mdsource content
File Manager Skill
目录结构规范
/workspace/ ├── user_input_files/ # 用户发给我的输入文件 │ ├── images/ │ ├── videos/ │ ├── pdfs/ │ ├── docxs/ │ ├── excels/ │ └── others/ │ └── my_outputs/ # 我生成给用户的输出文件 ├── images/ ├── videos/ ├── pdfs/ ├── docxs/ ├── excels/ └── others/
文件命名规范
输入文件
input-{描述}-{YYYYMMDD}.{扩展名} 示例: - input-katheryne-cos-20260325.jpg - input-fushimi-inari-torii-20241004.jpg - input-zhumi-cat-20241001.jpg
输出文件
output-{描述}-{YYYYMMDD}.{扩展名} 示例: - output-katheryne-funko-20260325.png - output-katheryne-real-heart-20260325.mp4
文件类型分类
| 类型 | 目录 | 扩展名 |
|---|---|---|
| 图片 | images/ | .jpg, .jpeg, .png, .gif, .webp |
| 视频 | videos/ | .mp4, .mov, .avi |
| pdfs/ | ||
| Word | docxs/ | .docx, .doc |
| Excel | excels/ | .xlsx, .xls, .csv |
| 其他 | others/ | 其他所有格式 |
Scripts
| 脚本 | 用途 |
|---|---|
| 初始化目录结构 |
| 验证文件结构是否正确 |
| 移动文件到正确位置 |
| 修复嵌套目录问题 |
使用方法
初始化目录
bash scripts/init.sh
验证结构
bash scripts/verify.sh
移动文件
# 复制文件到正确位置 # 用法: bash scripts/move.sh <源文件> <类型> <描述> <日期> bash scripts/move.sh /path/to/file.pdf pdf invoice 20250325
修复问题
# 修复嵌套目录等常见问题 bash scripts/fix-nested.sh
常见错误与解决方案
❌ 错误1:文件散落在根目录
问题:生成的文件留在
/workspace/ 根目录,没有按类型分类
解决:
- 使用
创建目录结构scripts/init.sh - 使用
移动文件到对应分类目录scripts/move.sh - 运行
确认scripts/verify.sh
❌ 错误2:嵌套的 output 目录
问题:
/workspace/my_outputs/output/images/ 而不是 /workspace/my_outputs/images/
解决:
bash scripts/fix-nested.sh
❌ 错误3:历史文件未重命名
问题:
3888.jpg, 3969.jpg 这种编号文件名无法回溯
解决:
- 用
工具分析图片内容images_understand - 根据内容重命名:
input-{内容描述}-{日期}.jpg - 使用
移动到正确目录scripts/move.sh - 更新 FILE_MANAGEMENT.md 记录
操作流程(必须遵循)
1. 接收用户输入时
用户发送文件 → 确认文件类型 → 使用 scripts/move.sh 移动 → scripts/verify.sh 验证
2. 生成输出文件时
生成文件 → 使用 scripts/move.sh 移动到 my_outputs → scripts/verify.sh 验证 → 交付
3. 验证失败时
验证失败 → 使用 fix-nested.sh 修复 → 再次验证 → 通过后才能交付
验证触发时机
必须在以下时机运行验证脚本:
- 任何文件存档操作完成后
- 用户询问文件整理情况时
- 交付文件给用户之前
版本: 1.1.0 - 包含可执行脚本