プラグインの貢献
このガイドでは、新しいプラグインを作成し、 f5-sales-demo マーケットプレイスに追加する方法を説明します。
プラグインの構造
Section titled “プラグインの構造”すべてのプラグインは 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
プラグインの作成
Section titled “プラグインの作成”-
プラグインディレクトリの作成
Terminal window mkdir -p plugins/example-plugin/.claude-pluginmkdir -p plugins/example-plugin/skillsmkdir -p plugins/example-plugin/commands -
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"} -
スキルの追加
plugins/example-plugin/skills/example-skill/SKILL.mdをフロントマター付きで作成します:---name: example-skilldescription: One-line description of what this skill does---Detailed instructions for Claude when this skill activates.参照データは
SKILL.mdと同じ階層のreferences/サブディレクトリに配置してください。 -
コマンドの追加
plugins/example-plugin/commands/example-command.mdを作成します:---description: What this command doesargument_hint: "[optional-args]"allowed_tools:- Read- Glob- Grep---Instructions for Claude when the user invokes this command. -
marketplace.json へのプラグイン登録
.claude-plugin/marketplace.jsonのplugins配列にエントリを追加します:{"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"} -
ローカルでのテスト
公開前に、Claude Code をローカルディレクトリに向けてプラグインをテストします:
Terminal window claude --plugin-dir ./plugins/example-pluginスキルが適切なコンテキストで起動すること、およびコマンドが期待通りの出力を生成することを確認してください。
プラグインの提出
Section titled “プラグインの提出”- 新しいプラグインを説明する GitHub Issue を作成する
mainからフィーチャーブランチを作成する- プラグインディレクトリを追加し、
marketplace.jsonを更新する docs/plugins/example-plugin.mdxにドキュメントページを追加する- Issue に
Closes #Nでリンクした PR を作成する - CI の失敗を修正し、チェックが通過した後にマージする
ベストプラクティス
Section titled “ベストプラクティス”- スキルをフォーカスさせる — 1 つのスキルは 1 つのことに特化させる
- 参照ファイルを活用する — 大規模なデータセット、スキーマ、ルックアップテーブルは
SKILL.mdにインラインで記述するのではなくreferences/に配置する - スコープを適切に設定する — 可能であれば未コミットの変更を確認して作業対象を絞り込む
- 出力を重大度別にグループ化する — ERROR、WARNING、INFO レベルを使用してユーザーが修正の優先順位を付けられるようにする
- README を作成する — 各スキルとコマンドの使用例および説明を記載する