Claude Code plugin structure and requirements. Use when creating, validating, or troubleshooting plugins. Covers plugin.json schema, SKILL.md format, command frontmatter, and agent configuration.
/plugin marketplace add astoeffer/plugin-marketplace/plugin install plugin-builder@astoeffer-dev-pluginsThis skill is limited to using the following tools:
reference.mdThis skill provides comprehensive knowledge about Claude Code plugin development, including directory structure, manifest formats, and component requirements.
A properly structured Claude Code plugin follows this hierarchy:
my-plugin/
├── .claude-plugin/
│ └── plugin.json # Required - Plugin manifest
├── commands/ # Optional - Slash commands
│ └── command-name.md
├── agents/ # Optional - Custom agents
│ └── agent-name.md
├── skills/ # Optional - Agent skills
│ └── skill-name/
│ └── SKILL.md
├── hooks/ # Optional - Event handlers
│ └── hooks.json
├── .mcp.json # Optional - MCP server config
└── README.md # Recommended - Documentation
Critical Rules:
commands/, agents/, skills/, hooks/) MUST be at plugin root, NOT inside .claude-plugin/skills/skill-name/SKILL.mdLocation: .claude-plugin/plugin.json
{
"name": "my-plugin",
"description": "Brief description of plugin purpose",
"version": "1.0.0",
"author": {
"name": "Your Name"
}
}
| Field | Type | Requirements |
|---|---|---|
name | string | Lowercase, alphanumeric with hyphens only |
description | string | Brief, clear purpose statement |
version | string | Semantic versioning (e.g., "1.0.0") |
author.name | string | Author's name |
| Field | Type | Purpose |
|---|---|---|
author.email | string | Contact email |
license | string | SPDX identifier (MIT, Apache-2.0, etc.) |
keywords | array | Discovery tags |
repository | string | Source code URL |
homepage | string | Documentation URL |
commands | string/array | Path(s) to command files |
agents | string/array | Path(s) to agent files |
skills | string/array | Path(s) to skill directories |
hooks | string/object | Hooks configuration |
mcpServers | string/object | MCP server configuration |
Location: skills/skill-name/SKILL.md
---
name: skill-name
description: Brief description of what this skill does and when to use it.
allowed-tools: Read, Grep, Glob
---
| Field | Required | Max Length | Notes |
|---|---|---|---|
name | Yes | 64 chars | Lowercase, alphanumeric, hyphens |
description | Yes | 1024 chars | Include specific triggers |
allowed-tools | No | - | Comma-separated tool names |
Good (specific triggers):
description: Extract text and tables from PDF files. Use when working with PDF files, forms, or document extraction.
Bad (vague):
description: Helps with documents
After frontmatter, include:
Location: commands/command-name.md or commands/prefix/command-name.md
---
description: What this command does
argument-hint: <required-arg> [optional-arg]
allowed-tools: Read, Write, Glob
model: sonnet
---
| Field | Purpose | Default |
|---|---|---|
description | Shown in /help | First line of content |
argument-hint | Usage hint | None |
allowed-tools | Restrict tools | Inherit all |
model | Specific model | Inherit |
disable-model-invocation | Prevent auto-invoke | false |
Use subdirectories for prefixed commands:
commands/pb/validate.md → /pb:validatecommands/git/commit.md → /git:commit$ARGUMENTS - All arguments as string$1, $2, etc. - Positional arguments@filepath - Include file contents!backtickcommandbacktick`` - Execute bash commandLocation: agents/agent-name.md
---
name: agent-name
description: When to invoke this agent and what it does.
tools: Read, Grep, Glob, Bash
model: sonnet
permissionMode: default
skills: skill1, skill2
---
| Field | Required | Options/Notes |
|---|---|---|
name | Yes | Lowercase, hyphens |
description | Yes | Include invocation triggers |
tools | No | Comma-separated; omit to inherit all |
model | No | sonnet, opus, haiku, or 'inherit' |
permissionMode | No | default, acceptEdits, bypassPermissions, plan, ignore |
skills | No | Comma-separated skill names to auto-load |
After frontmatter, include:
Causes:
skills/my-skill.md) instead of directory (skills/my-skill/SKILL.md)Fixes:
--- delimiters)Causes:
.md extensionFixes:
.md--- delimiterscommands/ at plugin rootCauses:
.claude-plugin/ instead of plugin rootFixes:
Causes:
name or description in frontmatteragents/ directory.md extensionFixes:
agents/ at plugin root.md extensionBefore distributing a plugin:
.claude-plugin/plugin.json exists with required fieldsskills/name/SKILL.md format.md extensionSee reference.md for complete JSON schemas and examples.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.