← 返回
开发者工具 中文

Document 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...
比较两个文档或文件并生成结构化的差异报告。适用场景:用户要求比较文件、查找文档差异、生成差异报告等。
cnoder-wgh
开发者工具 clawhub v1.0.0 1 版本 99856.5 Key: 无需
★ 0
Stars
📥 696
下载
💾 5
安装
1
版本
#latest

概述

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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 23:57 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,868

openviking-token-saver

cnoder-wgh
OpenViking上下文数据库,面向AI代理——分层上下文加载(L0/L1/L2)、语义搜索、文件系统记忆管理。适用场景:(1) 设置Open...
★ 0 📥 716
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 66 📥 179,901