コンテンツにスキップ

プラグインの貢献

このガイドでは、新しいプラグインを作成し、 f5-sales-demo マーケットプレイスに追加する方法を説明します。

すべてのプラグインは plugins/ 配下の専用ディレクトリに配置され、 以下の構造に従います:

  • ディレクトリplugins/
    • ディレクトリexample-plugin/
      • ディレクトリ.claude-plugin/
        • plugin.json
      • ディレクトリskills/
        • ディレクトリexample-skill/
          • SKILL.md
          • ディレクトリreferences/
            • reference-data.md
      • ディレクトリcommands/
        • example-command.md
      • ディレクトリagents/
        • example-agent.md
      • README.md
  1. プラグインディレクトリの作成

    Terminal window
    mkdir -p plugins/example-plugin/.claude-plugin
    mkdir -p plugins/example-plugin/skills
    mkdir -p plugins/example-plugin/commands
  2. plugin.json の作成

    plugins/example-plugin/.claude-plugin/plugin.json を作成します:

    {
    "name": "example-plugin",
    "description": "What this plugin does",
    "version": "1.0.0",
    "author": {
    "name": "f5-sales-demo"
    },
    "homepage": "https://github.com/f5-sales-demo/marketplace/tree/main/plugins/example-plugin",
    "keywords": ["relevant", "keywords"],
    "license": "Apache-2.0",
    "repository": "https://github.com/f5-sales-demo/marketplace"
    }
  3. スキルの追加

    plugins/example-plugin/skills/example-skill/SKILL.md をフロントマター付きで作成します:

    ---
    name: example-skill
    description: One-line description of what this skill does
    ---
    Detailed instructions for Claude when this skill activates.

    参照データは SKILL.md と同じ階層の references/ サブディレクトリに配置してください。

  4. コマンドの追加

    plugins/example-plugin/commands/example-command.md を作成します:

    ---
    description: What this command does
    argument_hint: "[optional-args]"
    allowed_tools:
    - Read
    - Glob
    - Grep
    ---
    Instructions for Claude when the user invokes this command.
  5. marketplace.json へのプラグイン登録

    .claude-plugin/marketplace.jsonplugins 配列にエントリを追加します:

    {
    "name": "example-plugin",
    "description": "What this plugin does",
    "version": "1.0.0",
    "author": { "name": "f5-sales-demo" },
    "source": "./plugins/example-plugin",
    "category": "productivity",
    "homepage": "https://github.com/f5-sales-demo/marketplace/tree/main/plugins/example-plugin",
    "license": "Apache-2.0",
    "keywords": ["relevant", "keywords"],
    "tags": ["searchable", "tags"],
    "repository": "https://github.com/f5-sales-demo/marketplace"
    }
  6. ローカルでのテスト

    公開前に、Claude Code をローカルディレクトリに向けてプラグインをテストします:

    Terminal window
    claude --plugin-dir ./plugins/example-plugin

    スキルが適切なコンテキストで起動すること、およびコマンドが期待通りの出力を生成することを確認してください。

  1. 新しいプラグインを説明する GitHub Issue を作成する
  2. main からフィーチャーブランチを作成する
  3. プラグインディレクトリを追加し、marketplace.json を更新する
  4. docs/plugins/example-plugin.mdx にドキュメントページを追加する
  5. Issue に Closes #N でリンクした PR を作成する
  6. CI の失敗を修正し、チェックが通過した後にマージする
  • スキルをフォーカスさせる — 1 つのスキルは 1 つのことに特化させる
  • 参照ファイルを活用する — 大規模なデータセット、スキーマ、ルックアップテーブルは SKILL.md にインラインで記述するのではなく references/ に配置する
  • スコープを適切に設定する — 可能であれば未コミットの変更を確認して作業対象を絞り込む
  • 出力を重大度別にグループ化する — ERROR、WARNING、INFO レベルを使用してユーザーが修正の優先順位を付けられるようにする
  • README を作成する — 各スキルとコマンドの使用例および説明を記載する