create-plugin について
Claude Code と Codex の両方に対応するプラグインのリポジトリ構成とファイル内容を生成するスキルです。両環境向けのプラグインを作る開発者を対象としています。
主な機能
- 01リポジトリとプラグイン情報の収集
- 02ディレクトリツリーの生成
- 03必須ファイル内容の出力
- 04Git・インストールコマンドの提示
活用シーン
- 01Skills や Agents を含むプラグインの作成
- 02プラグインの Hooks や MCP サーバー設定
- 03リポジトリ初期化とインストール手順の準備
MCP 対応
選択された場合、プラグイン内の MCP サーバー設定用に `.mcp.json` を生成します。
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ alexsmedile/ hormozi-skills --skill create-pluginインストール後、Claude Code で/create-pluginを入力して読み込まれたか確認します。
詳細
スキル:プラグイン作成(Claude Code + Codex)
目的
Claude Code と Codex の両方で同時に動作するプラグインとして機能する GitHub リポジトリをスキャフォールディングします。必須ファイルごとに、すぐにコピーできるファイルの内容と Git コマンドを出力します。
ステップ 1:入力情報を収集する
ユーザーに次の質問をまとめて尋ねてください。
- リポジトリ名 — kebab-case(例:
my-skills) - GitHub のユーザー名または組織名 — (例:
alexsmedile) - プラグインの説明 — 1 文
- 作成者名
- このプラグインに含めるものは何ですか? — 該当するものをすべて選択してください。
- スキル(
skills/) - エージェント(
agents/) - フック(
hooks/hooks.json) - MCP サーバー(
.mcp.json)
- スキル(
- ライセンス — デフォルト:
MIT
少なくともリポジトリ名、GitHub のユーザー名、説明、作成者名を取得するまでは先に進まないでください。
ステップ 2:ファイル構成を生成する
選択内容に基づく完全なディレクトリツリーを表示し、続けてすべてのファイルの内容をコピーできる状態で出力してください。
常に必要なファイル
.claude-plugin/plugin.json
{
"name": "{{repo-name}}",
"version": "1.0.0",
"description": "{{description}}",
"author": {
"name": "{{author}}"
},
"homepage": "https://github.com/{{username}}/{{repo-name}}",
"repository": "https://github.com/{{username}}/{{repo-name}}",
"license": "{{license}}",
"keywords": []
}
skills/とagents/内のスキルとエージェントは自動検出されるため、plugin.jsonにパスを指定する必要はありません。
.claude-plugin/marketplace.json
{
"name": "{{repo-name}}",
"owner": {
"name": "{{author}}"
},
"metadata": {
"description": "{{description}}",
"version": "1.0.0"
},
"plugins": [
{
"name": "{{repo-name}}",
"source": "./",
"description": "{{description}}",
"version": "1.0.0",
"author": {
"name": "{{author}}"
},
"homepage": "https://github.com/{{username}}/{{repo-name}}",
"repository": "https://github.com/{{username}}/{{repo-name}}",
"license": "{{license}}",
"category": "productivity"
}
]
}
.codex-plugin/plugin.json
{
"name": "{{repo-name}}",
"version": "1.0.0",
"description": "{{description}}",
"author": {
"name": "{{author}}"
},
"homepage": "https://github.com/{{username}}/{{repo-name}}",
"repository": "https://github.com/{{username}}/{{repo-name}}",
"license": "{{license}}",
"skills": "./skills/"
}
.codex-plugin/marketplace.json
{
"name": "{{repo-name}}",
"interface": {
"displayName": "{{repo-name}}"
},
"plugins": [
{
"name": "{{repo-name}}",
"source": {
"source": "local",
"path": "./"
},
"category": "Productivity"
}
]
}
.gitignore
.DS_Store
**/.DS_Store
output/*
!output/.gitkeep
output/.gitkeep
空のファイルです。output/ フォルダーを Git の追跡対象として維持します。
スキルを選択した場合:skills/example-skill/SKILL.md
---
name: example-skill
description: Replace this description with specific trigger phrases. Use when the user asks to "..."
---
# Skill: Example
Describe what this skill does and how to use it.
example-skill/を実際のスキル名に変更してください。スキルは/{{repo-name}}:example-skillとして呼び出します。
エージェントを選択した場合:agents/example-agent.md
---
name: example-agent
description: Replace with what this agent does and when to invoke it.
tools: Read, Write, Bash
model: sonnet
---
# Agent: Example
Describe the agent's role, expertise, and behavior here.
実際のエージェント名に変更してください。
フックを選択した場合:hooks/hooks.json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "echo 'File changed'"
}
]
}
]
}
}
MCP サーバーを選択した場合:.mcp.json
{
"mcpServers": {
"example-server": {
"command": "${CLAUDE_PLUGIN_ROOT}/bin/server",
"args": []
}
}
}
ステップ 3:重要なルール
ユーザーがファイルを作成する前に、次の内容を明確に伝えてください。
| ルール | 詳細 |
|---|---|
skills/ と agents/ はリポジトリのルートに配置する | .claude-plugin/ や .codex-plugin/ の中には絶対に配置しないでください |
| プラグイン名 = スキルの名前空間 | プラグインが foo の場合、スキルは /foo:skill-name として実行されます |
plugin.json は自動検出される | カスタムの場所を使用する場合を除き、skills や agents のパスを列挙する必要はありません |
marketplace.json に skills/agents を追加しない | デフォルトの strict: true ではスキーマ検証エラーが発生します |
marketplace.json の source: "./" | リポジトリのルートを指します。単一プラグインのリポジトリではこれが正しい設定です |
ステップ 4:Git のセットアップとインストールコマンド
ユーザーの値に置き換えて、以下をそのまま出力してください。
# Create repo (if not exists)
gh repo create {{username}}/{{repo-name}} --public
# Init and push
git init
git add .
git commit -m "feat: initial plugin scaffold"
git remote add origin https://github.com/{{username}}/{{repo-name}}.git
git push -u origin main
Claude Code にインストール:
/plugin marketplace add {{username}}/{{repo-name}}
/plugin install {{repo-name}}@{{repo-name}}
変更後に再読み込み:
/reload-plugins
インストールせずにローカルでテスト:
claude --plugin-dir ./
ステップ 5:インストール後
スキルは名前空間付きです:/{{repo-name}}:skill-name
エージェントは /agents に表示されます。
更新するには、GitHub にプッシュしてから /plugin marketplace update {{repo-name}} を実行します。
リリースごとに plugin.json と marketplace.json の version を更新してください。Claude Code はこのバージョンを使って更新を検出します。