Claude Code plugin development guide. Use when creating commands, skills, hooks, or agents for plugins. Triggers: plugin, command, skill, hook, agent development
Install
npx skillscat add shunsukehayashi/miyabi-claude-plugins/plugin-development Install via the SkillsCat registry.
SKILL.md
Plugin Development
Plugin Structure
my-plugin/
├── .claude-plugin/
│ └── plugin.json # Required: metadata
├── commands/ # Slash commands
│ └── hello.md
├── agents/ # Subagents
│ └── reviewer.md
├── skills/ # Agent skills
│ └── code-review/
│ └── SKILL.md
├── hooks/ # Event handlers
│ └── hooks.json
└── .mcp.json # MCP server configCreating Commands
File: commands/my-command.md
---
description: Short description for help
---
# Command Name
Instructions for Claude to execute this command.
Use $ARGUMENTS for user input.
Use $1, $2 for positional parameters.Command naming: /plugin-name:command-name
Creating Skills
Directory: skills/my-skill/SKILL.md
---
name: my-skill
description: Description with triggers. Triggers: keyword1, keyword2
---
# My Skill
Instructions and workflows...Creating Hooks
File: hooks/hooks.json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/script.sh"
}
]
}
]
}
}Supported Events
PreToolUse- Before tool executionPostToolUse- After successful executionPostToolUseFailure- After failed executionSessionStart- Session beginsSessionEnd- Session endsUserPromptSubmit- User sends prompt
Creating Agents
File: agents/my-agent.md
---
description: Agent specialization
capabilities: ["code-review", "testing"]
---
# Agent Name
Detailed role description...Environment Variables
${CLAUDE_PLUGIN_ROOT}- Plugin root directory$TOOL_NAME- Current tool name$TOOL_INPUT- Tool input$TOOL_OUTPUT- Tool output