doc-diff
Compare two documents or files and generate a structured diff report. Use when: user asks to compare files, find differences between documents, generate diff report, or check what changed between two versions.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/cnoder-wgh/doc-diffDocument Diff Skill
Compare two documents or files and generate a structured difference report in Chinese.
When to Use
✅ USE this skill when:
- "对比这两个文件"
- "这两个文档有什么区别?"
- "生成差异报告"
- "找出两个版本之间的变化"
- "Compare file A and file B"
Workflow
Step 1: Get file paths
Ask the user for the two file paths to compare if not provided.
Step 2: Run diff
# Basic diff (line by line)
diff file_a.txt file_b.txt
# Unified format (shows context lines, recommended)
diff -u file_a.txt file_b.txt
# Side-by-side comparison
diff -y --width=120 file_a.txt file_b.txt
# Ignore whitespace differences
diff -u -b -B file_a.txt file_b.txt
# Word-level diff (more granular)
diff -u --word-diff=plain file_a.txt file_b.txt
Step 3: For directory comparison
# Compare two directories recursively
diff -rq dir_a/ dir_b/
# Full diff of all files in directories
diff -ru dir_a/ dir_b/
Step 4: Generate report
After running diff, present the results as a structured report with these sections:
- 概览 (Overview) — file names, total lines changed
- 新增内容 (Additions) — lines added (marked with
+) - 删除内容 (Deletions) — lines removed (marked with
-) - 变更摘要 (Summary) — brief description of what changed and why it matters
Output Format
Present the report in Chinese with clear sections:
📄 文档对比报告
================
文件 A: <path>
文件 B: <path>
📊 变更概览
- 新增行数: X
- 删除行数: X
- 变更行数: X
➕ 新增内容
...
➖ 删除内容
...
📝 变更摘要
...
Notes
- For binary files (Word, PDF), read both files first and compare the extracted text
- For large files, focus on significant changes and summarize repeated patterns
- Always show the diff output first, then explain in plain Chinese what changed
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-cnoder-wgh-doc-diff": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
openviking-context
OpenViking context database for AI agents — layered context loading (L0/L1/L2), semantic search, file-system memory management. Use when setting up OpenViking, managing agent memory/resources, performing semantic search, browsing context filesystem, or comparing token consumption. Triggers on: 'openviking', 'context database', 'viking memory', 'layered context', 'token saving', 'L0/L1/L2', 'viking://', 'memsearch', 'memread', 'context setup'.
save-all-resource
打开一个可见浏览器,让用户手动浏览目标网站,并在浏览过程中持续监听同域原始响应内容,实时落盘到本地桌面目录。
frontend-performance-audit
分析前端页面性能并输出结构化优化报告。适用于页面速度慢、lighthouse 指标差、core web vitals 不达标、首屏慢、交互卡顿、bundle 过大、阻塞渲染资源过多等场景。