← 返回 Skills 市场
ldxs001

universal-file-ops

作者 Lighthexuish · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
47
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install universal-file-ops
功能描述
通用文件操作技能:支持常用文件(txt/py/html/md/docx/xlsx)增删查改,以及文件拷贝、移动、删除、重命名。含标准化 IO 接口、统一调度器、容灾回溯机制。
使用说明 (SKILL.md)

\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
安全使用建议
Install only if you are comfortable giving this skill broad local file access. Use it on non-sensitive directories, avoid batch jobs from untrusted input, avoid --no-backup, and manually review every delete, overwrite, move, and directory operation before running it.
能力评估
Purpose & Capability
The artifact is coherent with a universal file operations purpose: SKILL.md and scripts disclose CRUD, copy, move, rename, delete, backup, logging, rollback, and Python script execution. The concern is not hidden purpose mismatch but the breadth of file mutation authority.
Instruction Scope
SKILL.md says high-risk delete and overwrite operations require explicit confirmation, while references/permissions.md says the current version does not support runtime authorization and all operations execute directly. The scripts also accept --no-backup and JSON batch input without an approval gate.
Install Mechanism
No suspicious install mechanism, persistence hook, network setup, package install, or credential configuration was found in the artifact files reviewed.
Credentials
The skill claims it avoids sensitive/system paths, but the implemented is_safe_path check is effectively permissive when no base is supplied, and callers use it without a base. File reads, writes, deletes, directory deletes, moves, and copies can therefore target any path the process can access.
Persistence & Privilege
It persists backups, a manifest, and operation logs under skills/.standardization/universal-file-ops/data/, which is purpose-aligned. However, rollback is incomplete for directory deletes because backup_file uses file copy semantics and can fail before shutil.rmtree proceeds.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install universal-file-ops
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /universal-file-ops 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of universal-file-ops skill. - Supports create, read, update, and delete (CRUD) for txt, py, html, md, docx, xlsx files. - Provides standardized IO interface with robust backup and rollback (disaster recovery) mechanisms. - Enables file copy, move, rename, and delete for single or batch operations. - Unified task orchestrator for sequential and parallel workflow execution. - Includes logging, operation auditing, and robust error recovery design. - Clear documentation for usage scenarios, workflow, permissions, and anti-patterns.
元数据
Slug universal-file-ops
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

universal-file-ops 是什么?

通用文件操作技能:支持常用文件(txt/py/html/md/docx/xlsx)增删查改,以及文件拷贝、移动、删除、重命名。含标准化 IO 接口、统一调度器、容灾回溯机制。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 47 次。

如何安装 universal-file-ops?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install universal-file-ops」即可一键安装,无需额外配置。

universal-file-ops 是免费的吗?

是的,universal-file-ops 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

universal-file-ops 支持哪些平台?

universal-file-ops 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 universal-file-ops?

由 Lighthexuish(@ldxs001)开发并维护,当前版本 v0.1.0。

💬 留言讨论