← 返回 Skills 市场
sxliuyu

Diff Tool

作者 SxLiuYu · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ 安全检测通过
299
总下载
0
收藏
4
当前安装
4
版本数
在 OpenClaw 中安装
/install diff-tool
功能描述
文本差异比较工具。比较两个文本、文件或字符串的差异,高亮显示新增、删除和修改的行。适合代码审查、文档对比、版本比对等场景。
使用说明 (SKILL.md)

Diff Tool 🧐

文本差异比较工具,快速比较两个文本或文件的差异。

功能

  • 📝 比较两个文本字符串的差异
  • 📄 比较两个文件的差异
  • 🔍 高亮显示新增(绿色)、删除(红色)、修改(黄色)内容
  • 📊 显示统计信息(新增/删除/修改行数)
  • 🎨 支持多种输出格式(标准/简洁/JSON)

使用方法

比较两个字符串

python3 scripts/diff.py string "第一段文本" "第二段文本"

比较两个文件

python3 scripts/diff.py file /path/to/file1.txt /path/to/file2.txt

简洁输出

python3 scripts/diff.py file /path/to/file1.txt /path/to/file2.txt --format simple

JSON 输出(适合程序处理)

python3 scripts/diff.py file /path/to/file1.txt /path/to/file2.txt --format json

示例

# 比较两段代码
python3 scripts/diff.py string "def hello(): print('hello')" "def hello(): print('Hello World')"

# 比较两个文件并显示统计
python3 scripts/diff.py file /tmp/a.txt /tmp/b.txt --stats

# 忽略空白字符差异
python3 scripts/diff.py string "a b" "a  b" --ignore-space

输出格式说明

  • 标准格式:完整 diff 输出,带颜色标注
  • 简洁格式:只显示有差异的行
  • JSON 格式:机器可读的 JSON 输出,包含差异详情和统计
安全使用建议
This appears to be a simple, local diff utility. Before installing or running it: (1) verify you trust the author/source because the package has no homepage and an opaque owner ID; (2) be aware the script will read any file paths you pass to it — avoid diffing secrets or sensitive files unless you trust the environment; (3) ensure Python 3 is available; (4) the metadata/version strings are slightly inconsistent (minor bookkeeping issue). There are no network calls or credential requests in the code, so the main risk is accidental exposure of files you choose to diff.
功能分析
Type: OpenClaw Skill Name: diff-tool Version: 1.0.2 The diff-tool skill is a standard utility for comparing text strings or files using Python's built-in difflib module. The code in scripts/diff.py is well-structured, uses only standard libraries, and contains no evidence of malicious behavior, data exfiltration, or command injection vulnerabilities.
能力评估
Purpose & Capability
Name/description describe a text/file diff utility and the package contains a Python script that implements that functionality. The only minor inconsistency is metadata: _meta.json declares a dependency on 'python3' while the top-level registry metadata lists no required binaries, and SKILL.md/version strings show 1.0.0 while registry version is 1.0.2. These are bookkeeping issues but do not indicate malicious behavior.
Instruction Scope
SKILL.md instructs running the included Python script to compare two strings or files. The runtime instructions and script operate only on provided inputs and filesystem paths the user supplies; there are no steps that read unrelated system state, exfiltrate data, call external endpoints, or access environment variables beyond normal execution.
Install Mechanism
There is no install spec — this is effectively instruction-only with an included script. No network downloads, package installs, or archive extraction are present. The code is local and will run with the system Python if executed by the user/agent.
Credentials
The skill requests no environment variables, credentials, or config paths. That matches its purpose. The only implicit requirement is a Python 3 runtime to execute scripts, which is reasonable.
Persistence & Privilege
Skill flags are default (always: false, model invocation allowed). It does not request permanent presence or modify other skills/configuration. Autonomous invocation is permitted by platform default but not combined with any high-risk requests.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install diff-tool
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /diff-tool 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
- Version bump from 1.0.0 to 1.0.2 with no file changes detected. - No new features, bug fixes, or documentation updates in this release.
v2.0.0
No changes detected in this version.
v1.0.1
No changes detected in this version. - Version number updated to 1.0.1. - No modifications to code or documentation.
v1.0.0
Initial release of diff-tool. - 支持比较两个文本字符串或文件的差异 - 高亮显示新增(绿色)、删除(红色)、修改(黄色)内容 - 输出统计信息,包括新增/删除/修改行数 - 提供标准、简洁和 JSON 多种输出格式 - 可通过命令行参数忽略空白字符差异
元数据
Slug diff-tool
版本 1.0.2
许可证 MIT-0
累计安装 4
当前安装数 4
历史版本数 4
常见问题

Diff Tool 是什么?

文本差异比较工具。比较两个文本、文件或字符串的差异,高亮显示新增、删除和修改的行。适合代码审查、文档对比、版本比对等场景。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 299 次。

如何安装 Diff Tool?

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

Diff Tool 是免费的吗?

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

Diff Tool 支持哪些平台?

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

谁开发了 Diff Tool?

由 SxLiuYu(@sxliuyu)开发并维护,当前版本 v1.0.2。

💬 留言讨论