专业编辑 DOCX/PPTX 文档,支持修订追踪、保持格式、添加高亮、删除线以及 Git 版本控制。
Universal Office文档编辑器 : 专业文档编辑任何来源的 DOCX/PPTX 文件. .是一项面向实际任务的技能,主要用于QQ快速引用. ask.;Apprach.;
使用时应结合输入条件选择合适的执行方式,核对必要参数、依赖环境与输出内容,并按原始要求处理异常情况。从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。
面向任意来源的任意 DOCX/PPTX 文件的专业级文档编辑能力。
| 任务 | 方法 |
|---|---|
| 从上传获取文件 | bash scripts/fetch_file.sh upload |
| 从 URL 获取文件 | bash scripts/fetch_file.sh https://example.com/file.docx |
| 从 SFTP 获取文件 | bash scripts/fetch_file.sh sftp://user@host:/path/file.docx |
| 编辑 DOCX | uv run python scripts/docx_editor.py input.docx output.docx edits.json |
| 编辑 PPTX | uv run python scripts/pptx_editor.py input.pptx output.pptx edits.json |
| 生成差异报告 | uv run python scripts/generate_diff.py old.docx new.docx diff.md |
| 交互模式 | bash scripts/interactive_edit.sh |
# 获取最新上传的 DOCX bash scripts/fetch_file.sh upload output.docx # 获取最新上传的 PPTX bash scripts/fetch_file.sh upload output.pptx
位置:~/.openclaw/workspace/media/inbound/file_*.docx
# 从本地路径复制 bash scripts/fetch_file.sh ~/Documents/report.docx output.docx # 或使用绝对路径 bash scripts/fetch_file.sh /absolute/path/file.pptx output.pptx
# 从 URL 下载 bash scripts/fetch_file.sh https://example.com/document.docx output.docx
# 通过 SFTP 获取 bash scripts/fetch_file.sh sftp://user@host:/path/file.docx output.docx
创建包含编辑指令的 edits.json 文件:
{
"description": "编辑说明",
"replacements": [
{
"search": "旧文本",
"replace": "新文本",
"style": "highlight"
}
],
"additions": [
{
"after": "在此文本之后",
"text": "添加此文本",
"style": "highlight"
}
],
"slides": [
{
"action": "rearrange",
"order": [0, 2, 1, 3]
}
]
}
replace — 直接替换highlight — 黄色高亮delete — 删除线bold — 加粗underline — 下划线rearrange — 调整幻灯片顺序add — 添加新幻灯片remove — 删除幻灯片uv run python scripts/docx_editor.py input.docx output.docx edits.json
功能特性:
uv run python scripts/pptx_editor.py input.pptx output.pptx edits.json
功能特性:
uv run python scripts/generate_diff.py input.docx output.docx diff-report.md
输出:Markdown 格式的标准 Unified Diff。
# 来自上传 bash scripts/fetch_file.sh upload input.docx # 来自 URL bash scripts/fetch_file.sh https://example.com/file.docx input.docx # 来自本地路径 bash scripts/fetch_file.sh ~/Documents/file.docx input.docx
{
"description": "IRB 审查回复",
"replacements": [
{
"search": "2026 年 2 月 28 日",
"replace": "2026 年 8 月 31 日",
"style": "highlight"
}
]
}
uv run python scripts/docx_editor.py input.docx output.docx edits.json
# Unified Diff uv run python scripts/generate_diff.py input.docx output.docx diff.md # 转换为 Markdown uv run markitdown output.docx > output.md
git add *.docx *.md diff.md git commit -m "Edit: 修改内容说明"
适用于引导式编辑:
bash scripts/interactive_edit.sh
该脚本将依次提示您完成以下步骤:
{
"replacements": [
{
"search": "February 28, 2026",
"replace": "August 31, 2026",
"style": "highlight"
}
]
}
{
"additions": [
{
"after": "What is the research topic?",
"text": "[ANSWER] Data Structures and Algorithms",
"style": "highlight"
}
]
}
{
"slides": [
{
"action": "rearrange",
"order": [0, 2, 1, 3, 4]
}
]
}
python-docx 对表格中文本的匹配要求完全一致(包括空格、标点符号、换行符)。
解决方案:
markitdown 预览表格内容.gitignorecd ~/.openclaw/workspace/skills/office-document-editor uv sync
原因:待替换文本未精确匹配
解决方案:
# 预览文档内容 uv run markitdown input.docx # 使用预览中显示的确切文本
解决方案:
cd ~/.openclaw/workspace/skills/office-document-editor uv sync
解决方案:
支持所有来源类型的通用文件获取脚本。
bash scripts/fetch_file.sh[output_filename]
支持的来源类型:
upload — 最新上传的文件/path/to/file — 本地路径https://... — 公共 URLsftp://... — SFTP 远程地址支持格式保留的 Word 文档编辑脚本。
uv run python scripts/docx_editor.py input.docx output.docx edits.json
PowerPoint 演示文稿编辑脚本。
uv run python scripts/pptx_editor.py input.pptx output.pptx edits.json
生成 Unified Diff 报告的脚本。
uv run python scripts/generate_diff.py old.docx new.docx diff.md
交互式引导编辑脚本。
bash scripts/interactive_edit.sh
端到端自动化工作流脚本。
bash scripts/workflow_complete.sh input.docx edits.json