text-diff について
text-diff は、ファイルやテキストを比較し、差分表示やパッチを生成する開発スキルです。変更を確認したいユーザー向けに、統一形式と左右比較の出力コマンドを用意しています。
主な機能
- 01ファイルとテキストの比較
- 02統一形式の差分出力
- 03左右比較表示
- 04パッチ生成
活用シーン
- 01ファイルの版間の変更確認
- 02テキスト差分の左右比較
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ aidotnet/ moyucode --skill text-diffインストール後、Claude Code で/text-diffを入力して読み込まれたか確認します。
同梱ファイルscripts/text_diff.py
詳細
テキスト差分ツール
説明
ファイルやテキストの内容を比較し、統一形式の差分出力、左右並列表示、パッチ生成を行います。
起動条件
/diffコマンド- ファイルを比較したい場合
- 変更箇所を確認したい場合
使用方法
# Compare two files
python scripts/text_diff.py file1.txt file2.txt
# Unified diff format
python scripts/text_diff.py old.py new.py --unified
# Side-by-side view
python scripts/text_diff.py file1.txt file2.txt --side-by-side
# Generate patch
python scripts/text_diff.py old.txt new.txt --patch > changes.patch
タグ
diff、compare、patch、text、files
互換性
- Codex:✅
- Claude Code:✅
コメント
Markdown 対応