← Back to Skills Marketplace
ldxs001

universal-file-ops

by Lighthexuish · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
47
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install universal-file-ops
Description
通用文件操作技能:支持常用文件(txt/py/html/md/docx/xlsx)增删查改,以及文件拷贝、移动、删除、重命名。含标准化 IO 接口、统一调度器、容灾回溯机制。
README (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
Usage Guidance
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install universal-file-ops
  3. After installation, invoke the skill by name or use /universal-file-ops
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug universal-file-ops
Version 0.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

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.

💬 Comments