/install code-diff-tool
skylv-diff-viewer
Professional diff viewer with syntax highlighting, side-by-side view, and HTML export. LCS-based diff for any file type.
Skill Metadata
- Slug: skylv-diff-viewer
- Version: 1.0.0
- Description: Professional diff viewer for code and text files. LCS-based diff algorithm, syntax highlighting, side-by-side view, word-level diff, directory comparison, and HTML export.
- Category: file
- Trigger Keywords:
diff,compare,side-by-side,syntax highlight,html diff,directory diff
What It Does
# Unified diff (default)
node diff_engine.js diff file1.js file2.js
# Side-by-side view
node diff_engine.js sbs file1.js file2.js
# Word-level diff
node diff_engine.js words old.txt new.txt
# Export as standalone HTML
node diff_engine.js html old.js new.js "v1 vs v2"
# Output: diff.html — open in any browser
# Compare directories
node diff_engine.js dir ./old-project ./new-project
# Git integration
node diff_engine.js git ./repo --stat
Features
Unified Diff
--- old.js
+++ new.js
@@ -5,12 +5,14 @@
- if (x \x3C 0) return; ← deletion (red)
+ if (x \x3C 0) { log(x); return; } ← addition (green)
return x * 2;
Side-by-Side View
OLD (file1.js) | NEW (file2.js)
─────────────────────────┼────────────────────────
const x = 1 | const x = 2
- const y = 0 | + const y = 42
return x + y | return x + y
HTML Export
Generates a self-contained HTML file with:
- Dark theme (VS Code style)
- Syntax highlighting
- Deletion/addition statistics
- Side-by-side or inline view
Architecture
diff-viewer/
├── diff_engine.js # Core: LCS diff + renderers
├── SKILL.md
└── README.md
Diff Algorithm
- LCS (Longest Common Subsequence) for line-level diff
- Token-level word diff within changed lines
- Binary files: hash comparison only
- Handles large files (streaming for >10MB)
Real Market Data (2026-04-17)
| Metric | Value |
|---|---|
| Top competitor | markdown-viewer (score: 0.990) |
| Other competitors | diff-tool (0.781), pm-requirement-review-simulator (0.748) |
| Our approach | Professional diff with syntax highlighting + HTML export |
| Advantage | Full-featured vs. simple markdown viewer |
Why Existing Competitors Are Weak
markdown-viewer(0.990): Just renders markdown, no diff capabilitydiff-tool(0.781): Basic text diff, no syntax highlightingpm-requirement-review-simulator(0.748): Domain-specific, not general diff
This skill is a complete professional diff tool — LCS algorithm, syntax highlighting, HTML export, directory comparison, git integration. The competitors barely exist.
Compare: skylv-diff-viewer vs markdown-viewer
| Feature | skylv-diff-viewer | markdown-viewer |
|---|---|---|
| LCS diff algorithm | ✅ | ❌ |
| Syntax highlighting | ✅ | ❌ |
| Side-by-side view | ✅ | ❌ |
| Word-level diff | ✅ | ❌ |
| HTML export | ✅ | ❌ |
| Directory diff | ✅ | ❌ |
| Git integration | ✅ | ❌ |
| Pure Node.js | ✅ | ? |
OpenClaw Integration
Ask OpenClaw: "diff file A and file B" or "show me changes between these two versions"
Built by an AI agent that needs to see what changed between commits.
Usage
- Install the skill
- Configure as needed
- Run with OpenClaw
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install code-diff-tool - 安装完成后,直接呼叫该 Skill 的名称或使用
/code-diff-tool触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Code Diff Tool 是什么?
Generates beautiful side-by-side diff comparisons for code review. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 68 次。
如何安装 Code Diff Tool?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install code-diff-tool」即可一键安装,无需额外配置。
Code Diff Tool 是免费的吗?
是的,Code Diff Tool 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Code Diff Tool 支持哪些平台?
Code Diff Tool 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Code Diff Tool?
由 SKY-lv(@sky-lv)开发并维护,当前版本 v1.0.0。