Files
skillshare/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/diff.md
T
Willie 49a52498e9 docs: add current screenshots and diagrams to the guides
The dashboard screenshots predated the Projects page and showed codex at
its old path, and the guides for dashboard-only features (AGENTS.md
sharing, MCP, plugins, backups, hubs) had no pictures at all.

- Re-shoot the dashboard screenshots (docs and README copies) and add
  ones for targets, extras, shared AGENTS.md, MCP, project MCP, plugins,
  backups, hubs and project mode.
- Add diagrams for sharing AGENTS.md, MCP sync and migrating with
  collect; fix codex's path in the getting-started diagram.
- Replace terminal screenshots with real output as text, and remove
  images nothing referenced.
- Fix text that no longer matched the dashboard (project mode, hub
  navigation, backup list output).
2026-09-28 21:02:12 +08:00

8.2 KiB
Raw Blame History

sidebar_position
sidebar_position
2

diff

Source と Target 間の差分を表示します。

skillshare diff              # すべての Target(インタラクティブ TUI)
skillshare diff claude       # 特定の Target
skillshare diff agents       # Agent Target のみ
skillshare diff --stat       # ファイル単位の変更
skillshare diff --patch      # 完全な unified diff
skillshare diff --no-tui

Summary: 6 targets — 6 need sync

claude, claude-work, gemini, opencode, universal
─────────────────────────────────────────
  1 new
  + New 1 skill:
      remotion-captions

cursor
─────────────────────────────────────────
  1 local only, 1 new
  ← Local Only 1 skill:
      cursor-shortcuts
  + New 1 skill:
      remotion-captions

→ Run 'skillshare sync' to apply changes
→ Run 'skillshare collect' to import local skills to source

Extras
─────────────────────────────────────────
✓   rules → ~/.claude/rules: synced (merge)
✓   rules → ~/.cursor/rules: synced (merge)
✓   commands → ~/.claude/commands: synced (merge)
✓   team → ~/.codex: synced (symlink)
✓   team → ~/.claude: synced (import)
✓   team → ~/.gemini: synced (copy)
✓   team → ~/notes: synced (symlink)

インタラクティブ TUI

TTY 上では、diff は左右 2 パネルレイアウトのインタラクティブ TUI を起動します。

  • 左パネル — ステータスアイコン付きの Target リスト(✓ 同期済み、! 差分あり、✗ エラー)
  • 右パネル — 選択した Target の詳細ビュー(mode、フィルタ、分類された diff)
  • Enter を押すと Skill のファイル単位の diff を展開
  • / でTarget をフィルタ、Ctrl+d/u で詳細をスクロール、q で終了

プレーンテキスト出力には --no-tui を使うか、パイプすると自動的に TUI が無効になります。

使うタイミング

  • sync する前に、Source と Target の間で正確に何が異なるかを確認する
  • Target にのみ存在する Skill(まだ収集されていないローカル専用)を見つける
  • symlink に置き換えられるローカルコピーを特定する
  • --stat でファイル単位の変更、--patch で完全なテキスト diff を確認する

出力例

claude
  + New 2 skills:
      missing-skill
      another-skill
  ! Local Override 1 skill:
      local-copy
  ← Local Only 1 skill:
      my-local-skill

  2 new, 1 local override, 1 local only

cursor: fully synced

グループ化された複数 Target の出力

複数の Target が同一の diff 結果を持つ場合、ノイズを減らすために 1 つのブロックにまとめられます。

claude, agents
  + New 2 skills:
      skill-1
      skill-2

cursor
  + New 1 skill:
      skill-1

codex, copilot: fully synced

(include/exclude フィルタなどの理由で)結果が異なる Target は個別に表示されます。

シンボル

シンボル ラベル 意味 動作
+ New Source にあり、Target にない sync が追加する
+ Restore Target にあったが削除された sync が復元する
~ Modified 内容が変更された(copy mode) sync が更新する
! Local Override symlink ではなくローカルコピー sync --force で置き換え
- Orphan マニフェストにあるが Source にない sync が刈り取る
← Local Only Target のみに存在し、Source にない collect でインポート

ファイル単位の詳細

--stat

各 Skill 内でどのファイルが異なるかを表示します。

skillshare diff --stat
claude
  ~ Modified 1 skill:
      my-skill
        + new-file.md
        ~ SKILL.md
        - old-file.md

--patch

変更されたファイルの完全な unified テキスト diff を表示します。

skillshare diff --patch
claude
  ~ Modified 1 skill:
      my-skill
        --- SKILL.md
        - old line
        + new line

--stat と --patch はどちらも --no-tui(プレーンテキスト出力)を暗黙的に指定します。

diff が示す内容

merge mode の Target

merge mode(デフォルト)を使う Target の場合:

  • まだ Target に symlink されていない、Source 内の Skill を一覧表示する
  • symlink ではなくローカルコピーとして存在する Skill を表示する
  • Target 内のローカル専用の Skill を特定する(Source にない — sync で保持される)

copy mode の Target

copy mode を使う Target の場合:

  • まだ管理下にない(マニフェストにない)、Source 内の Skill を一覧表示する
  • チェックサム比較による内容の変更を表示する
  • Source にもう存在しない、孤立した管理下のコピーを表示する(sync 時に刈り取られる)
  • ローカル専用の Skill(Source になく、管理もされていない)を特定する

symlink mode を使う Target の場合:

  • symlink が正しい Source を指しているかを単純に確認する
  • 「Fully synced」を表示するか、誤った symlink について警告する

ユースケース

sync 前

何が変更されるかを確認します。

skillshare diff
# sync が何を行うかを確認してから:
skillshare sync

ローカル Skill を見つける

Target 内に直接作成した Skill を発見します。

skillshare diff claude
# 表示: ← Local Only 1 skill: my-local-skill

skillshare collect claude  # Source にインポート

変更内容の確認

sync 前に、Skill 内で何が変更されたかを正確に確認します。

skillshare diff --patch claude   # 完全なテキスト diff
skillshare diff --stat claude    # ファイル単位のサマリー

トラブルシューティング

sync ステータスに問題が表示された場合:

skillshare status          # 「needs sync」を表示
skillshare diff claude     # 何が異なるかを正確に確認
skillshare sync            # 修正する

Agent Diff

agents キーワードを使うと、Agent Target のみを diff します。

skillshare diff agents             # すべての Agent 対応 Target
skillshare diff agents claude      # 特定の Target
skillshare diff agents --json      # JSON 出力

Agent diff は、不足している agent(sync が必要)、孤立した symlink(prune が必要)、ローカル専用の agent ファイルを表示します。agents パス設定を持つ Target のみが対象です。全リストは Agents — 対応 Target を参照してください。


オプション

フラグ 説明
--project, -p project mode を使う
--global, -g global mode を使う
--stat ファイル単位の変更を表示(--no-tui を暗黙指定)
--patch 完全な unified diff を表示(--no-tui を暗黙指定)
--no-tui プレーンテキスト出力(インタラクティブ TUI をスキップ)
--json JSON として出力(--no-tui を暗黙指定)

JSON 出力

skillshare diff --json
{
  "targets": [
    {
      "name": "claude",
      "mode": "merge",
      "synced": false,
      "items": [
        {"action": "link", "name": "missing-skill", "reason": "not in target", "is_sync": true},
        {"action": "update", "name": "local-copy", "reason": "local override", "is_sync": true}
      ],
      "include": [],
      "exclude": []
    }
  ],
  "duration": "0.045s"
}

関連項目

  • sync — Target へ同期
  • collect — ローカル Skill をインポート
  • status — 概要をすばやく確認