← 返回 Skills 市场
mypicko

docx-diff

作者 mypicko · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
64
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install docx-diff
功能描述
对比两个 Word 文档(.docx)的差异,找出文本增删改、图片变化、格式/样式变化,生成高亮标注的 Word 文档、HTML 可视化报告和纯文本报告。当用户说「对比两个 Word 文档」「找出文档的改动」「这两版有什么区别」「帮我看看哪里改了」「文档 diff」「比较文件差异」「找出修订内容」时必须使用此 s...
使用说明 (SKILL.md)

DOCX Diff — Word 文档本地差异对比

工作流

用户给出两个文件路径后,按以下步骤执行:

第一步:确认依赖

pip install python-docx

如果已安装过,跳过。

第二步:找到 skill 脚本路径

脚本在 skill 目录下的 scripts/compare_docx.py。 OpenClaw 的 skill 目录通常在:

  • Windows: %USERPROFILE%\.openclaw\skills\docx-diff\scripts\compare_docx.py
  • macOS/Linux: ~/.openclaw/skills/docx-diff/scripts/compare_docx.py

第三步:运行对比

python "路径/scripts/compare_docx.py" --file1 "旧文档.docx" --file2 "新文档.docx"

Windows 示例(路径含空格时加引号):

python "%USERPROFILE%\.openclaw\skills\docx-diff\scripts\compare_docx.py" ^
  --file1 "E:\ZTE\project\report_V1.0.docx" ^
  --file2 "E:\ZTE\project\report_V1.1.docx" ^
  --output "E:\ZTE\project\diff_output"

第四步:报告结果

运行完成后,告诉用户:

  1. 统计数字:删除/新增/修改了多少段落,图片有无变化
  2. 具体改动内容(从 *_diff.txt 读取后摘要)
  3. 输出文件位置:*_diff.html(推荐用浏览器打开)、*_diff.docx

参数说明

参数 默认 说明
--file1 必填 旧文档(基准)
--file2 必填 新文档(对比目标)
--output 与 file2 同目录 输出目录
--threshold 0.6 段落配对相似度 0~1,越低越宽松
--mode all all / text / image

输出文件

文件 说明
*_diff.html 交互式报告,浏览器打开,支持按类型筛选
*_diff.docx 高亮标注版 Word 文档(红=删除,绿=新增)
*_diff.txt 纯文本报告

标注说明

标记 含义
[-] 红色 旧文档有、新文档没有(删除)
[+] 绿色 新文档有、旧文档没有(新增)
[修改前/后] 内容相似但有改动
[样式] 黄色 文字相同但格式发生变化

注意事项

  • 仅支持 .docx,不支持旧版 .doc(需先用 Word 另存为 .docx)
  • 表格内容也会被扫描,不会遗漏
  • 图片通过 MD5 比对,改名不会误判
  • HTML 报告内嵌图片,可直接分享单个文件

常见问题

Q: threshold 怎么调?

  • 两段文字差别很大但被判为「修改」→ 提高到 0.8
  • 相似段落被判为「删除+新增」→ 降低到 0.4

Q: 文档结构差异极大,结果乱?

  • 先用 --mode text 只看文本,忽略图片干扰
安全使用建议
This skill looks purpose-aligned for local .docx diffing. Before installing, consider using a Python virtual environment, verifying the `python-docx` dependency, and treating the generated HTML/DOCX/TXT reports as potentially confidential because they may include document text and embedded images.
功能分析
Type: OpenClaw Skill Name: docx-diff Version: 1.0.0 The docx-diff skill bundle is a legitimate utility for comparing Word documents locally. The Python script (scripts/compare_docx.py) uses standard libraries such as difflib and python-docx to analyze differences in text, formatting, and images, generating local reports in DOCX, HTML, and TXT formats. There is no evidence of data exfiltration, malicious network activity, or prompt injection; the code is well-structured and its behavior aligns perfectly with the stated purpose.
能力评估
Purpose & Capability
The artifacts coherently match the stated purpose: the skill compares two .docx files and the script extracts paragraphs, styles, and images to generate diff reports.
Instruction Scope
Instructions are scoped to user-provided Word document comparisons and local reporting; there is no evidence of unrelated account access, network services, or hidden goals.
Install Mechanism
The skill asks for a user-directed `pip install python-docx` setup step, but there is no install spec or pinned dependency version in the supplied metadata.
Credentials
Reading local .docx files and writing .html/.docx/.txt reports is proportionate to the purpose, but users should treat the outputs as containing document content.
Persistence & Privilege
No credentials, elevated privileges, or background persistence are shown; persistence is limited to generated local report files.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install docx-diff
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /docx-diff 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- 首次发布 docx-diff,支持本地对比两个 Word 文档(.docx) - 自动识别文本新增、删除、修改、图片变化及格式/样式变化 - 生成高亮标注的 Word 文档、HTML 可视化报告和纯文本报告 - 支持命令行参数自定义输出目录、相似度阈值和比对模式 - 结果报告包含段落和图片变更统计及具体改动摘要
元数据
Slug docx-diff
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

docx-diff 是什么?

对比两个 Word 文档(.docx)的差异,找出文本增删改、图片变化、格式/样式变化,生成高亮标注的 Word 文档、HTML 可视化报告和纯文本报告。当用户说「对比两个 Word 文档」「找出文档的改动」「这两版有什么区别」「帮我看看哪里改了」「文档 diff」「比较文件差异」「找出修订内容」时必须使用此 s... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 64 次。

如何安装 docx-diff?

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

docx-diff 是免费的吗?

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

docx-diff 支持哪些平台?

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

谁开发了 docx-diff?

由 mypicko(@mypicko)开发并维护,当前版本 v1.0.0。

💬 留言讨论