π¦ ClawHub
File Diff
by @super9du
Compare two files and display their differences in a human-readable markdown format. Use when asked to "compare files", "show diff", "compare differences", "...
TERMINAL
clawhub install file-diffπ About This Skill
name: file-diff description: Compare two files and display their differences in a human-readable markdown format. Use when asked to "compare files", "show diff", "compare differences", "diff two files", or any request to analyze file differences. Triggers on phrases like "ζ―θΎζδ»Ά"γ"ζ―θΎεΌε"γ"diff"γ"show me the differences".
File Diff
Compare two files and display differences in a clean, readable markdown format.
Usage
Quick Compare (Two file paths)
diff
Unified Diff Format (Recommended)
diff -u
Output Format
The diff output is formatted as:
File A: /path/to/file1
File B: /path/to/file2Differences
1. [Section/Line description]
diff
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:
diff -u /tmp/original.txt /tmp/modified.txt
Output format:
File A: /tmp/original.txt
File B: /tmp/modified.txtDifferences
Line 5
diff
Notes
-u flag for unified format (more readable)π‘ Examples
Input:
diff -u /tmp/original.txt /tmp/modified.txt
Output format:
``
File A: /tmp/original.txt
File B: /tmp/modified.txt`
π Tips & Best Practices
-u flag for unified format (more readable)