Skip to content
Development
Command

/sync

Skill を source からすべての targets にプッシュします。

From plugin
skillshare
2.7k34 skills34 commands
Install
$ npx -y skills add runkids/skillshare --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/sync

Context preview

What this command does when you run it.

Skill を source からすべての targets にプッシュします。

Command definition

sync.md
sidebar_position: 2

sync

Skill を source からすべての targets にプッシュします。

MCP 接続設定には `skillshare sync mcp` を、skills、agents、extras、MCP をまとめて含めるには `skillshare sync --all` を使用してください。MCP の同期は skill のシンボリックリンクではなく、 エントリの所有権とコンフリクトチェックを使用します。[mcp](/docs/reference/commands/mcp) を参照してください。

:::info sync はなぜ独立したコマンドなのか? `install` や `uninstall` のような操作は source のみを変更します — sync は targets に反映します。これにより、変更をバッチ処理し、`--dry-run` でプレビューし、targets が更新されるタイミングを制御できます。[Why Sync is a Separate Step](/docs/understand/source-and-targets#why-sync-is-a-separate-step) を参照してください。 :::

使うタイミング

  • Skill をインストール、uninstall、編集した後 — 変更をすべての targets に反映する
  • target の sync mode を変更した後 — 新しい mode を適用する
  • 定期的に、すべての targets が sync されていることを確認する

コマンド概要

| タイプ | コマンド | 方向 | |------|---------|-----------| | **Local sync** | `sync` / `collect` | Source ↔ Targets | | **Remote sync** | `push` / `pull` | Source ↔ Git Remote |

  • `sync` = Source から Targets へ配布
  • `collect` = Targets から Source へ収集
  • `push` = git remote へプッシュ
  • `pull` = git remote からプルして sync

概要

flowchart TD
    REMOTE["`Remote
(git)`"]
    SOURCE["`SOURCE
~/.config/skillshare/skills/`"]
    CLAUDE["Claude"]
    CURSOR["Cursor"]
    CODEX["Codex"]

    SOURCE -- push --> REMOTE
    REMOTE -- pull --> SOURCE
    SOURCE -- sync --> CLAUDE
    SOURCE -- sync --> CURSOR
    SOURCE -- sync --> CODEX
    CLAUDE -- collect --> SOURCE
    CURSOR -- collect --> SOURCE
    CODEX -- collect --> SOURCE

| コマンド | 方向 | 説明 | |---------|-----------|-------------| | `sync` | Source → Targets | Skill をすべての targets にプッシュ | | `collect <target>` | Target → Source | target から source へ skill を収集 | | `push` | Source → Remote | git にコミットしてプッシュ | | `pull` | Remote → Source → Targets | git からプルし、その後 sync |

---

Project Mode

カレントディレクトリに `.skillshare/config.yaml` が存在する場合、sync は project mode を自動検出します。

cd my-project/
skillshare sync          # 自動検出された project mode
skillshare sync -p       # 明示的な project mode

**Project sync** はデフォルトで merge mode(skill ごとのシンボリックリンク)になりますが、`skillshare target <name> --mode copy -p` によって各 target を copy または symlink mode に設定できます。バックアップは作成されません(project の targets は source から再現可能なため)。

.skillshare/skills/                 .claude/skills/
├── my-skill/          ────────►    ├── my-skill/ → (symlink)
├── pdf/               ────────►    ├── pdf/      → (symlink)
└── ...                             └── local/    (preserved)

デフォルトパスが移動した後のクリーンアップ {#project-path-cleanup}

Project の設定はパスではなく target 名を保存するため、target は組み込みのデフォルトパスに従います。ツールがそのデフォルトを変更すると — goose と openhands が `.agents/skills` を採用したときのように — skillshare が以前のディレクトリに書き込んだ Skill が残り、ツールは両方の場所を読み込んですべての Skill を二重に一覧表示してしまいます。

Project sync はそれらを削除します。明示的な `path:` を持たない各 target について、その target のランタイムがあわせてスキャンするディレクトリを調べ、そのうち設定済みのどの target も書き込まないディレクトリから、skillshare が作成したエントリを削除します。自分で作成したフォルダや、project の外を指すシンボリックリンクが変更されることはありません。

→ Cleaned 1 leftover skill(s) from .goose/skills: the default path for 'goose' moved to .agents/skills

target に明示的な `path:` を設定すると、その target はクリーンアップの対象外になります。また `--dry-run` は、何も変更せずに削除される対象をプレビューします。

---

Sync

Skill を source からすべての targets にプッシュします。

skillshare sync              # skill をすべての targets に sync
skillshare sync agents       # agents のみを sync
skillshare sync --all        # skills + agents + extras + MCP を sync
skillshare sync --dry-run    # 変更をプレビュー
skillshare sync -n           # 短縮形
skillshare sync --force      # 管理対象のすべての skill を上書き
skillshare sync -f           # 短縮形

| フラグ | 短縮形 | 説明 | |------|-------|-------------| | `--all` | | skills の後に agents、extras、MCP も sync(plugins は除く) | | `--dry-run` | `-n` | 書き込まずに変更をプレビュー | | `--force` | `-f` | チェックサムに関わらず管理対象のすべてのエントリを上書き(copy mode)、または既存のディレクトリをシンボリックリンクに置き換え(merge mode) | | `--json` | | JSON として出力 | | `--quiet` | `-q` | トークンサマリーと budget 警告を抑制 |

JSON 出力

skillshare sync --json
{
  "targets": 3,
  "linked": 12,
  "local": 2,
  "updated": 0,
  "pruned": 1,
  "ignored_count": 2,
  "ignored_skills": ["_team/vendor/lib", "test-draft"],
  "dry_run": false,
  "duration": "0.234s",
  "details": [
    {
      "name": "claude",
      "mode": "merge",
      "linked": 8,
      "local": 2,
      "updated": 0,
      "pruned": 1
    },
    {
      "name": "cursor",
      "mode": "merge",
      "linked": 4,
      "local": 0,
      "updated": 0,
      "pruned": 0
    }
  ],
  "context_cost": {
    "groups": [
      {
        "targets": ["claude", "cursor"],
        "always_loaded_tokens": 12400,
        "on_demand_tokens": 58200
      }
    ]
  }
}

`ignored_count` と `ignored_skills` フィールドは、`.skillignore`(および存在する場合は `.skillignore.local`)によって除外された skill を示します。これらは discovery 時にフィルタリングされ、どの target にも到達しません。`.skillignore.local` が有効な場合、テキスト出力には `.local` の source ヒントが含まれます。パターンの構文については [.skillignore](/docs/reference/appendix/file-structure#skillignore-optional) を参照してください。

実行内容

flowchart TD
    TITLE["skillshare sync"]
    S1["1. Backup targets (global only)"]
    S2["2. For each target"]
    MERGE["merge mode"]
    SYMLINK["symlink mode"]
    S3["3. Report results"]
    TITLE --> S1 --> S2
    COPY["copy mode"]
    S2 --> MERGE --> S3
    S2 --> COPY --> S3
    S2 --> SYMLINK --> S3

出力例

<p> <img src="/img/sync-demo.png" alt="sync demo" width="720" /> </p>

---

Collect

target から source へ skill を収集します。

skillshare collect claude           # Claude から収集
skillshare collect claude --dry-run # プレビュー
skillshare collect --all            # すべての targets から収集

**使うタイミング**: target(例: `~/.claude/skills/`)で直接 skill を作成/編集し、それを source に取り込みたい場合。

flowchart TD
    TITLE["skillshare collect claude"]
    S1["1. Find local skills in target"]
    S2["2. Copy to source"]
    S3["3. Replace with symlink"]
    TITLE --> S1 --> S2 --> S3

**収集後:**

skillshare collect claude
skillshare sync  # ← 他の targets に配布

---

Pull

git remote からプルし、すべての targets に sync します。

skillshare pull              # git
Read more
Ships withskillshare

📚 Sync skills across all AI CLI tools with one command and simplify team sharing. Supporting Codex, Claude Code, OpenClaw & more

Get the whole plugin
Stats
2,695
Stars
169
Forks
Active
Maintenance
Go
Language
MIT
License
8h ago
Last commit
8mo ago
Created

Repo: runkids/skillshare

Other commands on skillshare.