← 返回 Skills 市场
cnoder-wgh

Document Diff

作者 cnoder-wgh · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
376
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

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: \x3Cpath>
文件 B: \x3Cpath>

📊 变更概览
- 新增行数: 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
安全使用建议
This skill appears to do what it says: it will ask for two file paths and run local diff commands, then produce a Chinese-language report. Before using it, ensure: (1) you only provide paths to files you want compared (the agent will read those files), (2) for Word/PDF comparisons the skill has no built-in extractor—install or provide text (pdftotext/pandoc or paste extracted text) if you need accurate comparisons, and (3) the host environment has the standard diff binary available. If you need remote or binary-format diffing, verify what extraction tools are available or prefer a skill that explicitly lists those tools.
功能分析
Type: OpenClaw Skill Name: doc-diff Version: 1.0.0 The skill bundle provides standard instructions for an AI agent to compare files and directories using the system 'diff' utility. The workflow in SKILL.md is consistent with its stated purpose of generating document difference reports, and it contains no evidence of malicious intent, data exfiltration, or unauthorized command execution.
能力评估
Purpose & Capability
Name/description match the declared requirement (diff). No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
Instructions are limited to asking for file paths and running diff commands, which is appropriate. One minor ambiguity: it tells the agent to 'read both files first and compare the extracted text' for Word/PDF but does not specify how to extract text (no tools or commands provided). That may lead the agent to assume other extraction tools are available or prompt for uploads.
Install Mechanism
Instruction-only skill with no install spec — low risk. It relies on the system-provided diff binary, which is reasonable for the stated purpose.
Credentials
No environment variables, credentials, or config paths requested. Access requested is proportional to the task.
Persistence & Privilege
Skill is not always-on and uses normal autonomous invocation defaults. It does not request elevated or cross-skill configuration changes.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install doc-diff
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /doc-diff 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: compare two files and generate a structured diff report
元数据
Slug doc-diff
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 376 次。

如何安装 Document Diff?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install doc-diff」即可一键安装,无需额外配置。

Document Diff 是免费的吗?

是的,Document Diff 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Document Diff 支持哪些平台?

Document Diff 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Document Diff?

由 cnoder-wgh(@cnoder-wgh)开发并维护,当前版本 v1.0.0。

💬 留言讨论