building-plugins
Expert at creating and managing Claude Code plugins that bundle agents, skills, commands, and hooks into cohesive packages. Auto-invokes when the user wants to create, structure, validate, or publish a complete plugin, or needs help with plugin architecture and best practices. Also auto-invokes proactively when Claude is about to create plugin directory structures, write plugin.json manifests, or implement tasks that involve bundling components into a plugin package.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o building-plugins.zip https://jpskill.com/download/17676.zip && unzip -o building-plugins.zip && rm building-plugins.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17676.zip -OutFile "$d\building-plugins.zip"; Expand-Archive "$d\building-plugins.zip" -DestinationPath $d -Force; ri "$d\building-plugins.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
building-plugins.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
building-pluginsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 4
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Building Plugins Skill
あなたは Claude Code プラグインの作成のエキスパートです。プラグインは、エージェント、スキル、コマンド、およびフックをまとめたパッケージであり、まとまりのある配布可能なユニットとして機能します。
プラグインとは?
プラグインとは、関連する Claude Code コンポーネントをまとめたパッケージです。
- Agents: 委任されたタスクのための専門的なサブエージェント
- Skills: 自動的に呼び出される専門知識モジュール
- Commands: ユーザーがトリガーするスラッシュコマンド
- Hooks: イベント駆動型の自動化
プラグインを使用すると、ユーザーは単一のコマンドで完全な機能をインストールできます。
個々のコンポーネントではなくプラグインを作成するタイミング
次の場合には PLUGIN を使用します。
- 複数の関連コンポーネントをまとめて配布したい場合
- まとまりのある機能セットまたはドメインの専門知識を構築している場合
- ユーザーに 1 つのコマンドですべてをインストールさせたい場合
- コンポーネント間でバージョンの互換性を維持する必要がある場合
- 特定のドメイン向けの再利用可能なツールキットを作成している場合
次の場合には INDIVIDUAL COMPONENTS を使用します。
- 単一のエージェント、スキル、またはコマンドのみが必要な場合
- コンポーネントが関連しておらず、独立して使用できる場合
- 特定のプロジェクト向けにカスタマイズしている場合
- 配布または共有する予定がない場合
プラグインの作成プロセス
プラグインの作成には、次の手順が含まれます。
- 要件の収集 (名前、コンポーネント、メタデータ)
- ディレクトリ構造の作成
plugin.jsonマニフェストの記述- 各コンポーネントの作成 (エージェント、スキル、コマンド、フック)
- 包括的な
README.mdの記述 - 完全なプラグインの検証
コンポーネントの作成: 各コンポーネントタイプ (エージェント、スキル、コマンド、フック) は、それぞれのベストプラクティスに従う必要があります。各タイプの作成に関する専門知識については、対応する building-* スキルを使用してください。
プラグインの構造とスキーマ
ディレクトリ構造
plugin-name/
├── .claude-plugin/
│ └── plugin.json # 必須: プラグインマニフェスト
├── agents/ # オプション: エージェント定義
│ ├── agent1.md
│ └── agent2.md
├── skills/ # オプション: スキルディレクトリ
│ ├── skill1/
│ │ ├── SKILL.md
│ │ ├── scripts/
│ │ ├── references/
│ │ └── assets/
│ └── skill2/
│ └── SKILL.md
├── commands/ # オプション: スラッシュコマンド
│ ├── command1.md
│ └── command2.md
├── hooks/ # オプション: イベントフック
│ ├── hooks.json
│ └── scripts/
├── scripts/ # オプション: ヘルパースクリプト
│ └── setup.sh
├── .mcp.json # オプション: MCP サーバー構成
└── README.md # 必須: ドキュメント
最小限のプラグイン構造
有効なプラグインの絶対的な最小構成:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
└── README.md
plugin.json スキーマ
必須フィールド
{
"name": "plugin-name",
"version": "1.0.0",
"description": "What the plugin does"
}
推奨フィールド
{
"name": "plugin-name",
"version": "1.0.0",
"description": "Comprehensive description of plugin functionality",
"author": {
"name": "Your Name",
"email": "your.email@example.com",
"url": "https://github.com/yourname"
},
"homepage": "https://github.com/yourname/plugin-name",
"repository": "https://github.com/yourname/plugin-name",
"license": "MIT",
"keywords": ["keyword1", "keyword2", "keyword3"]
}
コンポーネントの登録
{
"commands": "./commands/",
"agents": ["./agents/agent1.md", "./agents/agent2.md"],
"skills": "./skills/",
"hooks": ["./hooks/hooks.json"]
}
注:
- ディレクトリパス (
"./commands/") を使用して、ディレクトリ内のすべてのファイルを含めます - ファイル配列 (
["file1.md", "file2.md"]) を使用して、特定のファイルをリストします - パスはプラグインのルートディレクトリからの相対パスです
⚠️ 重要な形式に関する警告
配列には、オブジェクトではなく、単純なパス文字列を含める必要があります!
❌ 不正 (ロードに失敗します):
"commands": [ {"name": "init", "path": "./commands/init.md", "description": "..."}, {"name": "status", "path": "./commands/status.md"} ]✅ 正解:
"commands": [ "./commands/init.md", "./commands/status.md" ]これは、すべてのコンポーネント配列 (
agents、skills、commands、およびhooks) に適用されます。注意: 単一項目の配列も、文字列ではなく配列である必要があります。
- ❌
"agents": "./agents/my-agent.md"(文字列 - ロードされません)- ✅
"agents": ["./agents/my-agent.md"](配列 - 正しい)
オプション: MCP サーバー
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-name"],
"env": {
"API_KEY": "${API_KEY}"
}
}
}
}
命名規則
プラグイン名:
- 小文字の文字、数字、およびハイフンのみ (アンダースコアは使用できません!)
- 最大 64 文字
- 説明的でドメイン固有
- 例:
code-review-suite、data-analytics-tools、git-workflow-automation
コンポーネント名:
- 個々のコンポーネントの命名規則に従います
- Agents: アクション指向 (
code-reviewer、test-generator) - Skills: 動名詞形式が推奨されます (
analyzing-data、reviewing-code) - Commands: 動詞を最初に (
new-feature、run-tests) - 一貫性: プラグイン内で同様の命名パターンを使用します
セマンティックバージョニング
プラグインはセマンティックバージョニングに従う必要があります: MAJOR.MINOR.PATCH
- MAJOR: 破壊的な変更 (例: コンポーネントの削除、インターフェースの変更)
- MINOR: 新機能 (例: 新しいコマンド、機能の強化)
- PATCH: バグ修正と軽微な改善
例:
1.0.0→ 初回リリース1.1.0→ 新しいコマンドを追加1.1.1→ 既存のコマンドのバグを修正2.0.0→ 非推奨のエージェントを削除 (破壊的な変更)
プラグインの作成
次の手順に従って、適切に構造化されたプラグインを作成します。
ステップ 1: 要件の収集
ユーザーに次のことを尋ねます。
- プラグインの名前と目的: このプラグインは何をしますか?
- ターゲットドメイン: どのような問題を解決しますか?
- 必要なコンポーネント:
- エージェントはいくつ必要ですか? どのようなタスクを実行しますか?
- スキルはいくつ必要ですか? どのような専門知識を提供しますか?
- コマンドはいくつ必要ですか? どのようなワークフローを実行しますか?
- 何かフックはありますか?
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Building Plugins Skill
You are an expert at creating Claude Code plugins. Plugins are bundled packages that combine agents, skills, commands, and hooks into cohesive, distributable units.
What is a Plugin?
A plugin is a package that bundles related Claude Code components:
- Agents: Specialized subagents for delegated tasks
- Skills: Auto-invoked expertise modules
- Commands: User-triggered slash commands
- Hooks: Event-driven automation
Plugins enable users to install complete functionality with a single command.
When to Create a Plugin vs Individual Components
Use a PLUGIN when:
- You want to distribute multiple related components together
- You're building a cohesive feature set or domain expertise
- You want users to install everything with one command
- You need to maintain version compatibility across components
- You're creating a reusable toolkit for a specific domain
Use INDIVIDUAL COMPONENTS when:
- You only need a single agent, skill, or command
- Components are unrelated and can be used independently
- You're customizing for a specific project
- You don't plan to distribute or share
Plugin Creation Process
Creating a plugin involves:
- Gathering requirements (name, components, metadata)
- Creating the directory structure
- Writing the plugin.json manifest
- Creating each component (agents, skills, commands, hooks)
- Writing comprehensive README.md
- Validating the complete plugin
Component Creation: Each component type (agents, skills, commands, hooks) should follow its respective best practices. Use the corresponding building-* skills for expertise on creating each type.
Plugin Structure & Schema
Directory Structure
plugin-name/
├── .claude-plugin/
│ └── plugin.json # Required: Plugin manifest
├── agents/ # Optional: Agent definitions
│ ├── agent1.md
│ └── agent2.md
├── skills/ # Optional: Skill directories
│ ├── skill1/
│ │ ├── SKILL.md
│ │ ├── scripts/
│ │ ├── references/
│ │ └── assets/
│ └── skill2/
│ └── SKILL.md
├── commands/ # Optional: Slash commands
│ ├── command1.md
│ └── command2.md
├── hooks/ # Optional: Event hooks
│ ├── hooks.json
│ └── scripts/
├── scripts/ # Optional: Helper scripts
│ └── setup.sh
├── .mcp.json # Optional: MCP server configuration
└── README.md # Required: Documentation
Minimal Plugin Structure
The absolute minimum for a valid plugin:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
└── README.md
plugin.json Schema
Required Fields
{
"name": "plugin-name",
"version": "1.0.0",
"description": "What the plugin does"
}
Recommended Fields
{
"name": "plugin-name",
"version": "1.0.0",
"description": "Comprehensive description of plugin functionality",
"author": {
"name": "Your Name",
"email": "your.email@example.com",
"url": "https://github.com/yourname"
},
"homepage": "https://github.com/yourname/plugin-name",
"repository": "https://github.com/yourname/plugin-name",
"license": "MIT",
"keywords": ["keyword1", "keyword2", "keyword3"]
}
Component Registration
{
"commands": "./commands/",
"agents": ["./agents/agent1.md", "./agents/agent2.md"],
"skills": "./skills/",
"hooks": ["./hooks/hooks.json"]
}
Notes:
- Use directory paths (
"./commands/") to include all files in a directory - Use file arrays (
["file1.md", "file2.md"]) to list specific files - Paths are relative to plugin root directory
⚠️ CRITICAL FORMAT WARNING
Arrays MUST contain simple path strings, NOT objects!
❌ WRONG (will silently fail to load):
"commands": [ {"name": "init", "path": "./commands/init.md", "description": "..."}, {"name": "status", "path": "./commands/status.md"} ]✅ CORRECT:
"commands": [ "./commands/init.md", "./commands/status.md" ]This applies to all component arrays:
agents,skills,commands, andhooks.Also note: Single-item arrays must still be arrays, not strings:
- ❌
"agents": "./agents/my-agent.md"(string - won't load)- ✅
"agents": ["./agents/my-agent.md"](array - correct)
Optional: MCP Servers
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-name"],
"env": {
"API_KEY": "${API_KEY}"
}
}
}
}
Naming Conventions
Plugin Name:
- Lowercase letters, numbers, and hyphens only (no underscores!)
- Max 64 characters
- Descriptive and domain-specific
- Examples:
code-review-suite,data-analytics-tools,git-workflow-automation
Component Names:
- Follow individual component naming rules
- Agents: Action-oriented (
code-reviewer,test-generator) - Skills: Gerund form preferred (
analyzing-data,reviewing-code) - Commands: Verb-first (
new-feature,run-tests) - Consistency: Use similar naming patterns within a plugin
Semantic Versioning
Plugins must follow semantic versioning: MAJOR.MINOR.PATCH
- MAJOR: Breaking changes (e.g., removed components, changed interfaces)
- MINOR: New features (e.g., new commands, enhanced capabilities)
- PATCH: Bug fixes and minor improvements
Examples:
1.0.0→ Initial release1.1.0→ Added new command1.1.1→ Fixed bug in existing command2.0.0→ Removed deprecated agent (breaking change)
Creating a Plugin
Follow these steps to create a well-structured plugin:
Step 1: Gather Requirements
Ask the user:
- Plugin name and purpose: What will this plugin do?
- Target domain: What problem does it solve?
- Components needed:
- How many agents? What tasks?
- How many skills? What expertise?
- How many commands? What workflows?
- Any hooks? What events?
- Metadata:
- Author information
- License type (MIT, Apache 2.0, etc.)
- Repository URL
- Keywords for searchability
Step 2: Design Plugin Architecture
Plan the component structure:
Example: Code Review Plugin
code-review-suite/
├── agents/
│ ├── code-reviewer.md # Deep code analysis
│ └── security-auditor.md # Security scanning
├── skills/
│ ├── reviewing-code/ # Always-on review expertise
│ └── detecting-vulnerabilities/ # Security pattern matching
├── commands/
│ ├── review.md # /review [file]
│ ├── security-scan.md # /security-scan
│ └── suggest-improvements.md # /suggest-improvements
└── hooks/
└── hooks.json # Pre-commit validation
Design Principles:
- Cohesion: Components should work together toward a common goal
- Single Responsibility: Each component has a clear, focused purpose
- Minimal Overlap: Avoid duplicating functionality
- Progressive Complexity: Start simple, add features iteratively
Step 3: Create Directory Structure
mkdir -p plugin-name/.claude-plugin
mkdir -p plugin-name/agents
mkdir -p plugin-name/skills
mkdir -p plugin-name/commands
mkdir -p plugin-name/hooks
mkdir -p plugin-name/scripts
Step 4: Create plugin.json Manifest
Use the plugin.json schema template and populate all fields:
{
"name": "plugin-name",
"version": "1.0.0",
"description": "Detailed description of what this plugin provides",
"author": {
"name": "Author Name",
"email": "email@example.com",
"url": "https://github.com/username"
},
"homepage": "https://github.com/username/plugin-name",
"repository": "https://github.com/username/plugin-name",
"license": "MIT",
"keywords": ["domain", "automation", "tools"],
"commands": "./commands/",
"agents": "./agents/",
"skills": "./skills/",
"hooks": ["./hooks/hooks.json"]
}
Critical Validation:
- Valid JSON syntax (use
python3 -m json.tool plugin.json) - Name follows lowercase-hyphens convention
- Version is semantic (X.Y.Z)
- All paths reference actual directories/files
Step 5: Create Components
Create each component using the appropriate expertise:
For Agents:
- Follow the building-agents skill guidance
- Use the agent-template.md as a starting point
- Place in
plugin-name/agents/
For Skills:
- Follow the building-skills skill guidance
- Create a directory with SKILL.md
- Place in
plugin-name/skills/skill-name/
For Commands:
- Follow the building-commands skill guidance
- Use command-template.md as a starting point
- Place in
plugin-name/commands/
For Hooks:
- Follow the building-hooks skill guidance
- Create hooks.json configuration
- Place in
plugin-name/hooks/
Step 6: Write Comprehensive README.md
Use the README template from {baseDir}/templates/plugin-readme-template.md.
Required Sections:
- Title and Description: What the plugin does
- Features: Key capabilities
- Installation: How to install
- Components: List all agents/skills/commands/hooks
- Usage: Examples and workflows
- Configuration: Any setup required
- License: License information
Optional Sections:
- Screenshots/demos
- Architecture diagrams
- Troubleshooting
- Contributing guidelines
- Changelog
Step 7: Validate the Plugin
Run the validation script:
python3 {baseDir}/scripts/validate-plugin.py plugin-name/
Validation Checks:
- [ ]
plugin.jsonexists and has valid JSON - [ ] Required fields present (name, version, description)
- [ ] Name follows conventions (lowercase-hyphens, max 64 chars)
- [ ] Version follows semantic versioning
- [ ] All referenced paths exist
- [ ] All components are valid (agents, skills, commands, hooks)
- [ ] README.md exists and is comprehensive
- [ ] License file exists (if license specified)
- [ ] No security issues (exposed secrets, dangerous scripts)
Step 8: Test the Plugin
Testing Checklist:
- Installation Test: Symlink to
.claude/plugins/and verify Claude loads it - Component Tests:
- Invoke each agent manually
- Trigger skill auto-invocation
- Run each command with various arguments
- Trigger hooks with relevant events
- Integration Tests: Verify components work together
- Edge Cases: Test with invalid inputs, missing files, etc.
Step 9: Document Usage
Provide clear instructions:
## Installation
### Manual Installation
1. Clone this repository
2. Symlink to Claude's plugin directory:
```bash
ln -s /path/to/plugin-name ~/.claude/plugins/plugin-name
- Restart Claude Code
Marketplace Installation (if published)
claude plugin install plugin-name
Quick Start
-
Run your first command:
/plugin-name:command arg1 arg2 -
Invoke an agent:
Ask Claude to use the agent-name agent -
Auto-invoked skills: Skills activate automatically when relevant.
Plugin Templates
This skill provides three plugin templates for different use cases:
1. Minimal Plugin Template
File: {baseDir}/templates/minimal-plugin-template/
Use when:
- Creating a simple, single-purpose plugin
- Only need 1-2 components
- Minimal complexity
Structure:
minimal-plugin/
├── .claude-plugin/plugin.json
├── commands/
│ └── main-command.md
└── README.md
2. Standard Plugin Template
File: {baseDir}/templates/standard-plugin-template/
Use when:
- Building a typical plugin with multiple components
- Need agents + commands or skills + hooks
- Moderate complexity
Structure:
standard-plugin/
├── .claude-plugin/plugin.json
├── agents/
│ └── main-agent.md
├── commands/
│ ├── command1.md
│ └── command2.md
├── scripts/
│ └── helper.sh
└── README.md
3. Full Plugin Template
File: {baseDir}/templates/full-plugin-template/
Use when:
- Building a comprehensive plugin suite
- Need all component types
- High complexity with multiple integrations
Structure:
full-plugin/
├── .claude-plugin/plugin.json
├── agents/
│ ├── agent1.md
│ └── agent2.md
├── skills/
│ ├── skill1/
│ │ ├── SKILL.md
│ │ └── scripts/
│ └── skill2/
│ └── SKILL.md
├── commands/
│ ├── cmd1.md
│ ├── cmd2.md
│ └── cmd3.md
├── hooks/
│ ├── hooks.json
│ └── scripts/
├── scripts/
│ └── setup.sh
├── .mcp.json
├── LICENSE
└── README.md
Common Plugin Patterns
Pattern 1: Development Tools Plugin
Purpose: Automate common development workflows
Components:
- Agents:
code-reviewer,test-generator,refactoring-assistant - Skills:
reviewing-code,writing-tests,refactoring-code - Commands:
/format,/lint,/test,/build - Hooks:
PreToolUsefor code quality checks
Example: dev-tools-suite, code-quality-automation
Pattern 2: Domain Expertise Plugin
Purpose: Provide specialized knowledge for a domain
Components:
- Skills: Domain-specific expertise (auto-invoked)
- Commands: Workflows specific to the domain
- Agents: Deep analysis for complex domain tasks
Example: data-analytics-tools, api-design-suite, security-analysis
Pattern 3: Workflow Automation Plugin
Purpose: Automate repetitive tasks and processes
Components:
- Commands: User-triggered workflows
- Hooks: Event-driven automation
- Scripts: Helper utilities
- Skills: Background expertise for automation
Example: git-workflow-automation, deployment-automation, project-scaffolding
Pattern 4: Integration Plugin
Purpose: Connect Claude to external tools and services
Components:
- MCP Servers: External service connections
- Commands: Trigger integrations
- Agents: Process external data
- Skills: Context about external services
Example: github-integration, jira-connector, database-tools
Marketplace Integration
If you're creating plugins for the Claude Code marketplace repository, you MUST maintain the central registry.
marketplace.json Registration
File: .claude-plugin/marketplace.json (at repository root)
This file is the central registry for all plugins in the marketplace.
When Adding a NEW Plugin
Update .claude-plugin/marketplace.json:
{
"metadata": {
"name": "Claude Code Plugin Marketplace",
"version": "X.Y.Z", // ← Increment MINOR version
"stats": {
"totalPlugins": N, // ← Increment count
"lastUpdated": "YYYY-MM-DD" // ← Update date
}
},
"plugins": [
// ... existing plugins ...
{
"name": "new-plugin-name",
"source": "./new-plugin-name", // ← Path to plugin directory
"description": "Plugin description",
"version": "1.0.0",
"category": "development-tools", // or "automation", "integration", etc.
"keywords": ["keyword1", "keyword2"],
"author": {
"name": "Author Name",
"url": "https://github.com/username"
},
"repository": "https://github.com/username/repo",
"license": "MIT",
"homepage": "https://github.com/username/repo/tree/main/plugin-name"
}
]
}
When Updating an EXISTING Plugin
Update both files:
1. Plugin's plugin.json:
- Increment version (following semantic versioning)
- Update description if changed
- Update components array if changed
2. Root marketplace.json:
{
"metadata": {
"version": "X.Y.Z", // ← Increment PATCH version
"stats": {
"lastUpdated": "YYYY-MM-DD" // ← Update date
}
},
"plugins": [
{
"name": "existing-plugin",
"version": "1.2.0", // ← Must match plugin's plugin.json
"description": "Updated description if changed"
// ... other fields
}
]
}
Critical: Keep Versions in Sync
- The version in
marketplace.jsonMUST match the plugin'splugin.jsonversion - Inconsistencies break installation and updates
Why This Matters
- Discovery: Users browse marketplace.json to find plugins
- Installation: CLI uses marketplace.json to locate and install plugins
- Updates: Version tracking relies on marketplace.json
- Documentation: Plugin listings are generated from marketplace.json
Validation Scripts
validate-plugin.py
Location: {baseDir}/scripts/validate-plugin.py
Usage:
python3 {baseDir}/scripts/validate-plugin.py /path/to/plugin/
Validates:
-
Directory Structure
.claude-plugin/plugin.jsonexists- Referenced directories exist
- README.md exists
-
plugin.json Schema
- Valid JSON syntax
- Required fields present
- Name follows conventions
- Version is semantic
- Paths reference existing files
-
Component Validation
- Agents: Valid YAML frontmatter and schema
- Skills: Valid SKILL.md and directory structure
- Commands: Valid YAML frontmatter
- Hooks: Valid hooks.json schema
-
Security Checks
- No exposed secrets in files
- Safe script permissions
- No dangerous bash operations
-
Documentation
- README.md completeness
- LICENSE file if license specified
Exit Codes:
0: All validations passed1: Critical errors found2: Warnings only (non-blocking)
Example Output:
✅ PLUGIN VALIDATION: my-plugin
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 plugin.json
✓ Valid JSON syntax
✓ Required fields present
✓ Name follows conventions
✓ Semantic versioning
📁 Directory Structure
✓ .claude-plugin/plugin.json exists
✓ All referenced paths exist
✓ README.md exists
🔧 Components (5 total)
✓ 2 agents validated
✓ 1 skill validated
✓ 2 commands validated
🔒 Security
✓ No exposed secrets
✓ Safe script permissions
📝 Documentation
⚠ README.md missing usage examples
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ VALIDATION PASSED (1 warning)
Security Considerations
When creating plugins:
-
Input Validation
- Validate all command arguments
- Sanitize file paths
- Avoid command injection in scripts
-
Permissions
- Use minimal
allowed-toolsin skills - Require user confirmation for destructive operations
- Don't pre-approve dangerous tools (Bash, Write) unless necessary
- Use minimal
-
Secrets Management
- Never hardcode API keys, tokens, or credentials
- Use environment variables:
${API_KEY} - Add
.envto.gitignore - Document required environment variables
-
Script Safety
- Validate script inputs
- Avoid
eval()and dynamic code execution - Use absolute paths, not relative
- Set restrictive permissions (644 for files, 755 for executables)
-
Dependencies
- Document all external dependencies
- Pin versions for reproducibility
- Avoid unnecessary dependencies
Best Practices
1. Start Simple, Iterate
Begin with minimal functionality:
- 1-2 components initially
- Test thoroughly
- Add features based on feedback
- Version bumps for each addition
2. Clear Documentation
Users should understand:
- What the plugin does (elevator pitch)
- How to install it
- How to use each component
- Configuration requirements
- Troubleshooting common issues
3. Consistent Naming
Use a naming scheme across components:
plugin-name:category:actionfor namespaced commands- Similar prefixes for related components
- Descriptive, not cute or clever
4. Version Thoughtfully
- Start at
1.0.0for initial release - Bump MAJOR for breaking changes
- Bump MINOR for new features
- Bump PATCH for bug fixes
- Update marketplace.json to match
5. Test Comprehensively
Before publishing:
- Manual testing of all components
- Edge case testing
- Integration testing
- Installation testing (clean environment)
- Validation script passing
6. Maintain Quality
After publishing:
- Monitor user feedback
- Fix bugs promptly
- Add features carefully
- Keep documentation updated
- Respond to issues
Reference Documentation
Comprehensive guides and examples:
-
- Design patterns and best practices
- Component composition strategies
- Scalability considerations
-
- Publishing to marketplace
- Versioning strategies
- Update workflows
-
- Real-world plugin examples
- Common patterns and anti-patterns
- Case studies
Your Role
When the user asks to create a plugin:
- Assess Scope: Understand what the plugin should do
- Recommend Architecture: Suggest component breakdown
- Validate Approach: Ensure cohesive, not fragmented
- Guide Creation: Use templates and validation
- Ensure Quality: Comprehensive testing and documentation
- Register Plugin: Update marketplace.json if applicable
Be proactive in:
- Recommending plugins over scattered components
- Suggesting cohesive component architectures
- Identifying security concerns early
- Ensuring comprehensive documentation
- Validating before considering "done"
Your goal is to help users create high-quality, well-structured plugins that provide real value and follow best practices.
Plugin Settings Pattern
Plugins can implement user-configurable settings using the .claude/plugin-name.local.md pattern. This allows users to customize plugin behavior on a per-project basis.
File Location and Format
Location: .claude/<plugin-name>.local.md in the project root
Format: YAML frontmatter + markdown body
---
# Plugin configuration (YAML frontmatter)
enabled: true
mode: strict
custom_option: value
---
# Plugin Context (markdown body)
Additional context or instructions that the plugin should consider.
This content can be loaded by hooks or skills.
Use Cases
1. Hook Activation Control
---
validation_enabled: true
auto_format: false
---
The hook script checks this setting:
#!/bin/bash
CONFIG_FILE=".claude/${PLUGIN_NAME}.local.md"
# Quick exit if config doesn't exist
[ ! -f "$CONFIG_FILE" ] && exit 0
# Parse enabled setting from frontmatter
ENABLED=$(sed -n '/^---$/,/^---$/p' "$CONFIG_FILE" | grep "^validation_enabled:" | cut -d: -f2 | tr -d ' ')
[ "$ENABLED" != "true" ] && exit 0
# Continue with hook logic...
2. Agent State Management
---
assigned_tasks:
- review-api-endpoints
- update-documentation
completed_reviews: 5
last_run: "2025-01-15"
---
3. Project-Specific Context
---
enabled: true
---
## Project Conventions
- Use TypeScript for all new code
- Follow the Airbnb style guide
- All API endpoints must have tests
## Domain Knowledge
This project manages customer billing. Key concepts:
- Subscriptions have monthly/annual cycles
- Invoices generate on billing dates
Parsing Settings in Hooks
Extract string/boolean fields:
get_setting() {
local file="$1"
local key="$2"
sed -n '/^---$/,/^---$/p' "$file" | grep "^${key}:" | cut -d: -f2 | tr -d ' '
}
ENABLED=$(get_setting ".claude/my-plugin.local.md" "enabled")
MODE=$(get_setting ".claude/my-plugin.local.md" "mode")
Extract markdown body:
get_body() {
local file="$1"
sed '1,/^---$/d' "$file" | sed '1,/^---$/d'
}
CONTEXT=$(get_body ".claude/my-plugin.local.md")
Best Practices
- Use
.local.mdsuffix: Indicates user-local settings, should be in.gitignore - Provide sensible defaults: Plugin should work without settings file
- Document all settings: List options in plugin README
- Validate settings: Check for required values in hooks
- Handle missing file: Always check if settings file exists first
- Restart required: Settings only load at session start
Template: Plugin Settings File
---
# my-plugin settings
# Copy to .claude/my-plugin.local.md and customize
# Enable/disable the plugin for this project
enabled: true
# Validation strictness: strict | normal | lenient
mode: normal
# Custom options (plugin-specific)
option1: value1
option2: value2
---
# Project-Specific Context
Add any project-specific information here that the plugin should consider.
Integration with Components
In hooks (most common):
CONFIG=".claude/my-plugin.local.md"
[ -f "$CONFIG" ] && ENABLED=$(get_setting "$CONFIG" "enabled")
In skills (via description triggers): Skills can mention checking for project settings in their workflow.
In commands (via argument defaults): Commands can read settings for default values.
Common Questions
Q: When should I create a plugin vs individual components? A: Create a plugin when you have 3+ related components or want to distribute functionality as a package. Individual components are fine for one-off customizations.
Q: Can I include other plugins as dependencies? A: Not directly. Document required plugins in README.md and instruct users to install them separately.
Q: How do I handle plugin updates? A: Increment version in plugin.json, update marketplace.json, document changes in README.md, and test thoroughly before releasing.
Q: Can plugins have configuration files?
A: Yes! Use .plugin-name.config.json or similar. Document configuration options in README.md.
Q: What's the difference between plugin keywords and categories? A: Keywords are for search (array of strings). Categories group plugins by type (single string). Both improve discoverability.
Q: How do I deprecate a plugin component? A: Document in README.md, add deprecation notice in component description, maintain for at least one MAJOR version, then remove and bump MAJOR version.
Summary
Creating plugins is about bundling expertise into reusable, distributable packages. Follow the structure, validate thoroughly, document comprehensively, and test extensively. Plugins should feel like natural extensions of Claude's capabilities, providing value without friction.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (27,475 bytes)
- 📎 references/plugin-architecture-guide.md (11,068 bytes)
- 📎 references/plugin-distribution-guide.md (13,296 bytes)
- 📎 scripts/validate-plugin.py (15,277 bytes)