クイックスタート
プラグインマニフェスト
.factory-plugin/plugin.jsonにあるマニフェストファイルは、プラグインのメタデータを定義します:
必須フィールド
| フィールド | 説明 |
|---|---|
name | 一意の識別子。小文字、数字、ハイフンを使用。 |
description | プラグインマネージャーに表示される短い説明。 |
version | セマンティックバージョン(例:1.0.0)。 |
オプションフィールド
| フィールド | 説明 |
|---|---|
author | nameと任意のemailを含むオブジェクト。 |
homepage | プラグインドキュメントのURL。 |
repository | GitリポジトリのURL。 |
license | ライセンス識別子(例:MIT、Apache-2.0)。 |
スキルの追加
スキルはモデルによって呼び出される機能です。skills/ディレクトリに作成してください:
スキル形式
スキルのフロントマター
| フィールド | 必須 | 説明 |
|---|---|---|
name | はい | スキルの一意識別子 |
description | はい | このスキルをいつ使用するか(モデルがいつ呼び出すかを判断するのに役立つ) |
disable-model-invocation | いいえ | ユーザー専用にするにはtrueを設定 |
allowed-tools | いいえ | スキルが使用できるツールを制限 |
コマンドの追加
コマンドはスラッシュ記法でユーザーによって呼び出されます。commands/ディレクトリに作成してください:
コマンド形式
commands/review-pr.mdにあるコマンドは/review-prになります。
コマンド引数
ユーザー入力を取得するには$ARGUMENTSを使用します:
/greet Alice
エージェントの追加
droids/ディレクトリに特殊化されたサブエージェントを定義します:
エージェント形式
フックの追加
hooks/hooks.jsonでライフサイクルフックを定義します:
フック設定
環境変数
| 変数 | 説明 |
|---|---|
${DROID_PLUGIN_ROOT} | プラグインディレクトリへの絶対パス |
${CLAUDE_PLUGIN_ROOT} | ${DROID_PLUGIN_ROOT}のエイリアス(Claude Code互換性) |
Plugin hooks cannot be imported via
/hooks import. They only function within installed plugins where the plugin root path can be resolved.MCPサーバーの追加
プラグインルートのmcp.jsonでMCPサーバーを設定します:
プラグインのテスト
ローカルテスト
開発中のテストには、ローカルディレクトリからインストールします:検証チェックリスト
プラグインを共有する前に:- マニフェストに必須フィールドがある(
name、description、version) - すべてのスキルのフロントマターに
nameとdescriptionがある - コマンドが引数ありでもなしでも動作する
- ハードコードされたパスや機械固有の設定がない
- READMEですべてのコマンドと機能が文書化されている
プラグインの配布
マーケットプレースの作成
マーケットプレースは、利用可能なプラグインをリストするマニフェストを含むGitリポジトリです:マーケットプレースマニフェスト
.factory-plugin/marketplace.jsonを作成します:
| フィールド | 必須 | 説明 |
|---|---|---|
name | はい | マーケットプレース識別子 |
description | いいえ | マーケットプレースを閲覧時に表示 |
owner | いいえ | 連絡先情報 |
plugins[].name | はい | プラグイン識別子 |
plugins[].source | はい | プラグインディレクトリへの相対パス |
plugins[].description | いいえ | プラグインブラウザに表示 |
plugins[].category | いいえ | プラグインを整理するため |
バージョン管理
ドキュメント目的でプラグインマニフェストではセマンティックバージョニングを使用します:- メジャー(1.0.0 → 2.0.0):破壊的変更
- マイナー(1.0.0 → 1.1.0):新機能、後方互換性あり
- パッチ(1.0.0 → 1.0.1):バグ修正
Droid tracks plugin versions by Git commit hash, not semantic version. When users update a plugin, they always get the latest commit from the marketplace. Version pinning is not currently supported.
Claude Code互換性
DroidはClaude Codeプラグインと完全に互換性があります。Claude Codeプラグインを見つけた場合、直接インストールでき、Droidが自動的に形式を変換します。ベストプラクティス
Keep plugins focused
Keep plugins focused
Design plugins around a single purpose or workflow. Prefer several small plugins over one monolithic plugin that does everything.
Document thoroughly
Document thoroughly
Include a README with:
- What the plugin does
- Installation instructions
- All available commands and their usage
- Configuration options
- Examples
Use semantic versioning
Use semantic versioning
Follow semver conventions so users know when updates might break their workflows.
Test across environments
Test across environments
Ensure your plugin works on macOS, Linux, and Windows if applicable. Use portable shell commands and avoid platform-specific paths.
Handle errors gracefully
Handle errors gracefully
Scripts should fail gracefully without blocking the user. Log errors but don’t crash sessions.
Respect user privacy
Respect user privacy
Don’t collect telemetry or send data without explicit consent. Document any network requests your plugin makes.
例:完全なプラグイン
コードレビュープラグインの完全な例です:.factory-plugin/plugin.json:
commands/review.md:
skills/review-patterns/SKILL.md:
droids/reviewer.md:
