Document Diff Skill
name: doc-diff
by cnoder-wgh · published 2026-03-22
$ claw add gh:cnoder-wgh/cnoder-wgh-doc-diff---
name: doc-diff
description: "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."
metadata: { "openclaw": { "emoji": "📄", "requires": { "bins": ["diff"] } } }
---
# Document Diff Skill
Compare two documents or files and generate a structured difference report in Chinese.
When to Use
✅ **USE this skill when:**
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.txtStep 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:
1. **概览 (Overview)** — file names, total lines changed
2. **新增内容 (Additions)** — lines added (marked with `+`)
3. **删除内容 (Deletions)** — lines removed (marked with `-`)
4. **变更摘要 (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
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...