← 返回 Skills 市场
super9du

File Diff

作者 Super 9° · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
125
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install file-diff
功能描述
Compare two files and display their differences in a human-readable markdown format. Use when asked to "compare files", "show diff", "compare differences", "...
使用说明 (SKILL.md)

File Diff

Compare two files and display differences in a clean, readable markdown format.

Usage

Quick Compare (Two file paths)

diff \x3Csource_file> \x3Ctarget_file>

Unified Diff Format (Recommended)

diff -u \x3Csource_file> \x3Ctarget_file>

Output Format

The diff output is formatted as:

**File A**: `/path/to/file1`
**File B**: `/path/to/file2`

## Differences

### 1. [Section/Line description]
```diff
- removed line
+ added line

## Workflow

1. Identify the two files to compare
2. Run `diff -u` command
3. Parse the unified diff output
4. Format into readable markdown with:
   - File paths as headers
   - Line numbers from diff output
   - `-` prefix for removals (red)
   - `+` prefix for additions (green)
   - Context lines for clarity

## Example

Input:
```bash
diff -u /tmp/original.txt /tmp/modified.txt

Output format:

**File A**: `/tmp/original.txt`
**File B**: `/tmp/modified.txt`

## Differences

### Line 5
```diff
- old content
+ new content

## Notes

- Always use `-u` flag for unified format (more readable)
- Include both file paths in the output
- Preserve all changes including additions, deletions, and modifications
安全使用建议
This skill appears to do what it says: run 'diff -u' on two files and format the output as markdown. Before installing, consider the following: (1) Metadata omits the external dependency: the bundled script calls the system 'diff' command — ensure 'diff' is available and trustworthy on your host. (2) The skill will output the contents of any files you ask it to compare; avoid giving it paths that contain secrets (keys, passwords, tokens) or run it in a sandbox. (3) The source and homepage are unknown — prefer skills from known publishers or review the code yourself. (4) If you plan to use this in an automated agent, ensure the agent is constrained so it cannot be instructed to diff sensitive system files. If you trust the code and your environment, this is low-risk; otherwise exercise caution or request a version with declared dependency metadata and an auditable source.
功能分析
Type: OpenClaw Skill Name: file-diff Version: 1.0.0 The 'file-diff' skill is a straightforward utility designed to compare two local files and format the output into Markdown. The core logic in 'scripts/diff_to_markdown.py' uses the Python 'subprocess' module safely with argument lists to prevent shell injection, and the 'SKILL.md' instructions contain no malicious prompt injections or requests for unauthorized access.
能力评估
Purpose & Capability
The script and SKILL.md both describe running the system 'diff -u' command and formatting its output to markdown — this aligns with the skill name and description. However, the package metadata declares no required binaries while the code invokes the external 'diff' binary via subprocess, so the manifest is incomplete/inconsistent.
Instruction Scope
Instructions and the bundled script only describe running diff on two files, parsing the unified diff output, and producing markdown. There are no instructions to read unrelated system state, call external endpoints, or access environment variables. Note: because the tool reads arbitrary file paths provided to it, it can reveal the contents of any files the agent is permitted to access (including secrets) in the diff output.
Install Mechanism
There is no install spec (instruction-only) and the repository contains a small helper script. Nothing is downloaded from external URLs or installed on the system by the skill itself, which is a low-install-risk configuration. The helper delegates to the system 'diff' binary.
Credentials
The skill requests no environment variables, credentials, or config paths and the code does not read env vars. This is proportionate to the stated purpose.
Persistence & Privilege
The skill is not marked 'always' and does not request elevated persistence. Model invocation is allowed (platform default) but there is no evidence the skill attempts to modify agent-wide settings or other skills.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install file-diff
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /file-diff 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of "file-diff": compare two files and display their differences in a readable markdown format. - Supports requests in English and Chinese, triggering on key phrases like "compare files" or "diff". - Uses unified diff (`diff -u`) for clear, context-rich comparison output. - Outputs file paths and formats differences with markdown and diff-style notation for clarity. - Step-by-step workflow: file detection, diff execution, parsing, and clean markdown formatting. - Includes usage instructions, output examples, and notes for best practices.
元数据
Slug file-diff
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

File Diff 是什么?

Compare two files and display their differences in a human-readable markdown format. Use when asked to "compare files", "show diff", "compare differences", "... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 125 次。

如何安装 File Diff?

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

File Diff 是免费的吗?

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

File Diff 支持哪些平台?

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

谁开发了 File Diff?

由 Super 9°(@super9du)开发并维护,当前版本 v1.0.0。

💬 留言讨论