universal-file-ops
/install universal-file-ops
\r \r
universal-file-ops\r
\r 通用文件操作技能:支持常用文件增删查改与文件管理操作,标准化 IO 接口,统一调度,鲁棒可回溯。\r \r
触发场景\r
\r 当用户提出以下意图时触发本技能:\r
- 创建/读取/更新/删除文件(txt、py、html、md、docx、xlsx 等)\r
- 拷贝、移动、重命名、删除文件或目录\r
- 批量文件操作(多文件同时处理)\r
- 要求对文件操作具备容灾回溯能力\r \r 否定条件(以下情况不触发):\r
- 仅询问文件操作理论知识,不实际执行\r
- 涉及敏感路径(系统目录、凭证文件)的操作\r
- 用户明确说「不要使用 universal-file-ops」\r \r
核心能力\r
\r
📚 渐进式加载:本技能采用渐进式 MD 体系,
SKILL.md为入口(≤230行),详细内容拆分到references/*.md按需加载。\r \r | # | 功能 | 说明 |\r |---|------|------|\r | 1 | 文件 CRUD | 支持 txt/py/html/md/docx/xlsx 增删查改,标准化 JSON IO 接口 |\r | 2 | 文件管理操作 | 拷贝、移动、重命名、删除,支持单文件与批量 |\r | 3 | 统一调度器 |scripts/orchestrator.py支持串行/并行多任务编排 |\r | 4 | 容灾回溯 | 操作前自动备份、支持回滚、操作日志审计 |\r | 5 | 鲁棒性设计 | 重复执行稳定、异常自动恢复、幂等性保证 |\r \r
快速开始\r
\r
# 查看所有可用操作\r
python scripts/orchestrator.py --list\r
\r
# 读取文件内容\r
python scripts/text_crud.py --action read --file path/to/file.txt\r
\r
# 写入文件内容(自动备份原文件)\r
python scripts/text_crud.py --action create --file path/to/file.txt --content "Hello"\r
\r
# 拷贝文件(支持批量)\r
python scripts/file_ops.py --action copy --src path/to/src --dst path/to/dst\r
\r
# 多操作串行执行(通过 orchestrator)\r
python scripts/orchestrator.py --batch batch_config.json\r
\r
# batch_config.json 格式示例:\r
# {\r
# "tasks": [\r
# {"op": "text_crud", "args": {"action": "create", "file": "a.txt", "content": "Hello"}},\r
# {"op": "file_ops", "args": {"action": "copy", "src": "a.txt", "dst": "b.txt"}}\r
# ],\r
# "parallel": false,\r
# "stop_on_error": true\r
# }\r
```\r
\r
→ 完整 API 参考详见 `references/guide.md`\r
\r
## 工作流程\r
\r
1. **解析请求** → 识别操作类型(CRUD/管理)、目标文件、参数\r
2. **预检查** → 验证文件存在性、权限、路径合法性\r
3. **备份(如需要)** → 对写操作自动创建备份至 `skills/.standardization/universal-file-ops/data/backup/`\r
4. **执行操作** → 调用对应 `scripts/*.py`,标准化 JSON IO\r
5. **验证结果** → 检查操作是否成功、输出标准化结果\r
6. **记录日志** → 写入 `skills/.standardization/universal-file-ops/data/logs/ops.log`,支持审计回溯\r
\r
**异常处理**:任何步骤失败 → 自动回滚(如已备份)→ 返回标准化错误 JSON\r
\r
→ 详细工作流程详见 `references/guide.md`\r
\r
→ 更多反模式详见 `references/antipatterns.md`\r
\r
→ 更多常见问题详见 `references/faq.md`\r
\r
## 权限说明\r
\r
本技能权限权重:**MEDIUM**\r
- 仅操作用户明确指定的文件路径\r
- 不访问网络、不读取凭证/Token\r
- 备份目录限于 `skills/.standardization/universal-file-ops/data/backup/`\r
- 所有高风险操作(删除、覆盖)需显式确认\r
\r
→ 详细权限说明详见 `references/permissions.md`\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install universal-file-ops - After installation, invoke the skill by name or use
/universal-file-ops - Provide required inputs per the skill's parameter spec and get structured output
What is universal-file-ops?
通用文件操作技能:支持常用文件(txt/py/html/md/docx/xlsx)增删查改,以及文件拷贝、移动、删除、重命名。含标准化 IO 接口、统一调度器、容灾回溯机制。 It is an AI Agent Skill for Claude Code / OpenClaw, with 47 downloads so far.
How do I install universal-file-ops?
Run "/install universal-file-ops" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is universal-file-ops free?
Yes, universal-file-ops is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does universal-file-ops support?
universal-file-ops is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created universal-file-ops?
It is built and maintained by Lighthexuish (@ldxs001); the current version is v0.1.0.