← Back to Skills Marketplace
mypicko

docx-diff

by mypicko · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
64
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install docx-diff
Description
对比两个 Word 文档(.docx)的差异,找出文本增删改、图片变化、格式/样式变化,生成高亮标注的 Word 文档、HTML 可视化报告和纯文本报告。当用户说「对比两个 Word 文档」「找出文档的改动」「这两版有什么区别」「帮我看看哪里改了」「文档 diff」「比较文件差异」「找出修订内容」时必须使用此 s...
README (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 只看文本,忽略图片干扰
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install docx-diff
  3. After installation, invoke the skill by name or use /docx-diff
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- 首次发布 docx-diff,支持本地对比两个 Word 文档(.docx) - 自动识别文本新增、删除、修改、图片变化及格式/样式变化 - 生成高亮标注的 Word 文档、HTML 可视化报告和纯文本报告 - 支持命令行参数自定义输出目录、相似度阈值和比对模式 - 结果报告包含段落和图片变更统计及具体改动摘要
Metadata
Slug docx-diff
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is docx-diff?

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

How do I install docx-diff?

Run "/install docx-diff" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is docx-diff free?

Yes, docx-diff is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does docx-diff support?

docx-diff is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created docx-diff?

It is built and maintained by mypicko (@mypicko); the current version is v1.0.0.

💬 Comments