オプション

コードの変更後は、difitを通じてユーザーにコードレビューを依頼してください。

...すべて拡張します
11
更新された時間 2026年8月26日

difit について

difitスキルは、コードの変更が行われた後、ローカルの差分表示ツールであるdifitを通じて、ユーザーにコードレビューを依頼します。 これにより、エージェントのワークフローに人間によるレビューのフィードバックを取り込むという課題が解決されます。エージェントは選択された差分対象に対してdifitを起動し、ユーザーはdifitのUIにレビューコメントを残します。difitが終了する際に、それらのコメントが標準出力(stdout)に書き出されるため、エージェントは作業を継続し、コメントへの対応を行うことができます。コメントがないままサーバーがシャットダウンされた場合、エージェントはレビューコメントが提供されなかったものとみなします。

このスキルは、最小限のコマンドインターフェースを定義しています。利用可能な場合はdifitバイナリを選択し、そうでない場合はnpx difitにフォールバックします。また、npxによるフォールバックがサンドボックス環境でのネットワークアクセスを必要とする場合、黙って処理を進めるのではなく、まず権限の昇格とユーザーの承認を要求します。 レビュー対象には、未コミットの変更、HEAD コミット、ステージング済みの変更、ステージングされていない変更、単一のコミット、または 2 つのコミットやブランチ間の比較が含まれます。 オプションの起動コメントは、--comment オプションを介して、ファイルパスや行範囲に固定された JSON スレッドオブジェクトとして添付できます。これは、レビューの結果を差分表示に直接反映させるのに役立ちます。また、--include-untracked オプションを使用すると、追跡されていないファイルを含めることができます。この機能は、Git で管理されているディレクトリ内でのみ使用できます。

対象ユーザーは、エージェントがコードを編集した後に、人間による確認のチェックポイントを設けたい開発者です。 このスキルはセキュリティに配慮しており、diff からシークレット、トークン、パスワード、API キー、秘密鍵、その他の認証情報のような素材を、コメント本文やコマンドライン引数に決してコピーしないよう明示的に指示します。その動作は Git の diff に対してローカルのレビューツールを実行することに限定されているため、安全です。

よくある質問

レビューのフィードバックはどのようにエージェントに届くのですか?

ユーザーが difit にコメントを残すと、difit コマンドの終了時にそのコメントが stdout に出力され、エージェントはその後、そのコメントに対処するための作業を続行します。difit がコメントなしで閉じられた場合、レビューコメントが提供されなかったものとみなされます。

difitがインストールされていない場合はどうなりますか?

このスキルは、`command -v difit` が成功した場合に `difit` を使用し、そうでない場合は `npx difit` にフォールバックします。この `npx` によるフォールバックが、権限のないサンドボックス内でネットワークアクセスを必要とする場合、実行前に権限の昇格とユーザーの承認を要求します。

これで何を確認できますか?

未コミットの変更、HEAD コミット、ステージング済みの変更、ステージングされていない変更、単一のコミット、または 2 つのコミットやブランチ間の比較を確認できます。オプションで `--include-untracked` を指定すると、追跡されていないファイルも含めることができます。

使用上の制約はありますか?

はい。Git の差分(diff)を操作するため、Git で管理されているディレクトリ内でのみ使用できます。

diff 内の機密データはどのように扱われますか?

秘密情報、トークン、パスワード、API キー、秘密鍵、その他の認証情報に類する内容を、diff から --comment の本文やコマンドライン引数に決してコピーしないよう明示的に指示しています。

すべてのファイル

2 ファイルagents/openai.yaml0.2 KB表示SKILL.md2.6 KB表示
GitHubで見る

Overview

This skill requests a code review from the user using difit.Before running commands, choose <difit-command> using the following rule:

  • If command -v difit succeeds, use difit.
  • Otherwise, use npx difit.
  • If falling back to npx difit would require network access in a sandboxed environment without network permission, request escalated permissions and user approval before running it.

If the user leaves review comments, they are printed to stdout when the chosen difit command exits.When review comments are returned, continue work and address them.If the server is shut down without comments, treat it as "no review comments were provided." Restarting it is unnecessary.Manual verification of whether the page launched correctly is also unnecessary.

Commands

  • Review uncommitted changes before commit: <difit-command> .
  • Review the HEAD commit: <difit-command>
  • Review staging area changes: <difit-command> staged
  • Review unstaged changes only: <difit-command> working

Basic Usage:

<difit-command> <target>                    # View single commit diff. ex: difit 6f4a9b7<difit-command> <target> [compare-with]     # Compare two commits/branches. ex: difit feature main

Optional Startup Comments

If there is something you want to tell the user when difit opens, attach it as startup comments with --comment.This is useful for review findings, explanations, and any context the user should see directly on the diff.

<difit-command> <target> [compare-with] \  --comment '{"type":"thread","filePath":"src/foobar.ts","position":{"side":"old","line":102},"body":"line 1line 2"}' \  --comment '{"type":"thread","filePath":"src/example.ts","position":{"side":"new","line":{"start":36,"end":39}},"body":"Range comment for L36-L39"}'
  • Use type: "thread" for each comment.
  • Write comment bodies in the language the user is using.
  • Use position.side: "new" for lines that exist on the target side of the diff.
  • Use position.side: "old" for lines that exist only on the deleted side.
  • Use range comments for issues that span multiple lines.
  • Never copy secrets, tokens, passwords, API keys, private keys, or other credential-like material from the diff into --comment bodies or any command-line arguments.

Including Untracked Files

For uncommitted changes, if files not yet added to git should also appear in the diff, add --include-untracked.

<difit-command> . --include-untracked

Constraints

Can only be used inside a Git-managed directory.

すべてのファイル

0件のファイル

difitをインストール

スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。

ZIPをダウンロード

リポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。

git clone https://github.com/yoshiko-pg/difit/blob/main/skills/difit/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

コピー コピー
クイックセットアップ: スキルフォルダを .claude/skills/ にコピーしてください。Claude が自動的にスキルを検出して使用します。
リポジトリ yoshiko-pg/difit

関連スキル

code-simplify
更新された時間 2026年7月2日
requesting-code-review
更新された時間 2026年6月29日
Git Commit Helper
更新された時間 2026年6月29日
commit-standards
更新された時間 2026年6月29日
OR