Guide for creating Claude Code plugins with commands, agents, skills, hooks, and MCP servers...
Create Claude Code plugins to extend functionality with custom commands, agents, skills, hooks, and MCP servers.
Ask the user:
my-plugin/
āāā .claude-plugin/
ā āāā plugin.json # Required
āāā commands/ # Optional: slash commands
āāā agents/ # Optional: sub-agents
āāā skills/ # Optional: agent skills
āāā hooks/ # Optional: event handlers
āāā .mcp.json # Optional: MCP servers
Minimal example:
{
"name": "my-plugin",
"description": "Brief description",
"version": "1.0.0",
"author": {"name": "Author Name"}
}
Based on user requirements, add:
Create a test marketplace:
mkdir test-marketplace/.claude-plugin
Create test-marketplace/.claude-plugin/marketplace.json:
{
"name": "test-marketplace",
"owner": {"name": "Developer"},
"plugins": [{"name": "my-plugin", "source": "./my-plugin"}]
}
Test commands:
/plugin marketplace add ./test-marketplace
/plugin install my-plugin@test-marketplace
---
description: Greet the user
---
# Hello Command
Greet the user warmly.
---
description: Code review specialist
capabilities: ["review", "suggestions"]
---
# Reviewer
Review code for quality and best practices.
{
"hooks": {
"PostToolUse": [{
"matcher": "Write|Edit",
"hooks": [{"type": "command", "command": "prettier --write $CLAUDE_FILE_PATH"}]
}]
}
}