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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "doc-diff" with this command: npx skills add cnoder-wgh/doc-diff

Document 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:

  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

  • 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

三色人格陪伴

恋人、损友、死敌三种陪伴模式。记忆完全隔离不串档,一秒切换情绪状态,承包你所有治愈、解压与情绪拉扯需求。

Registry SourceRecently Updated
General

Zero Api Key Web Search

OpenClaw skill for source-backed web search, page reading, and evidence-aware claim checking. No API keys required by default; optional providers can be enab...

Registry SourceRecently Updated
General

Novel Writer V3.2 - 小说写作引擎

专业小说写作引擎V3.2,支持短篇(3章)到超长篇(500万字)。内置AI味量化检测、四层质检、伏笔管理、角色状态追踪、断点续传。 自动根据字数裁剪流程:短篇模式(<10章)/ 中篇模式(10-50章)/ 长篇模式(50章+)。 触发场景:写小说、小说大纲、小说创作、网文写作、长篇小说、百万字小说、章节规划、 角...

Registry SourceRecently Updated
General

Hk Stock Morning Report

Generate HK stock market morning report (股市晨報) for bank trading desks. Triggers: "生成晨报","股市晨报","今日股市","港股晨報" 推送:微信個人 + 飛書群 | 數據:騰訊財經+stcn.com+格隆匯+實時搜索

Registry SourceRecently Updated