プラグインの貢献
このガイドでは、新しいプラグインを作成し、 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 イシューを作成する
mainからフィーチャーブランチを作成する- プラグインディレクトリを追加し、
marketplace.jsonを更新する docs/plugins/example-plugin.mdxにドキュメントページを追加するCloses #Nでイシューにリンクする PR を開く- CI の失敗を修正し、チェックが通過した後にマージする
ベストプラクティス
Section titled “ベストプラクティス”- スキルを集中させる — 1 つのスキルは 1 つのことをうまく行う
- 参照ファイルを使用する — 大規模なデータセット、スキーマ、ルックアップテーブルは SKILL.md にインラインで記述するのではなく
references/に配置する - インテリジェントにスコープを設定する — 可能な場合はコミットされていない変更を確認して、作業セットを絞り込む
- 重大度別に出力をグループ化する — ERROR、WARNING、INFO レベルを使用して、ユーザーが修正の優先順位を付けられるようにする
- README を記述する — 各スキルとコマンドが何を行うかの使用例と説明を含める