Guide for creating and managing Claude Code plugins. Use when creating a new plugin, adding plugin components (commands, agents, skills, hooks, MCP servers), or validating plugin structure and configuration.
/plugin marketplace add AnthonyKazyaka/plugin-marketplace/plugin install anthonykazyaka-useful-skills@AnthonyKazyaka/plugin-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/agents.mdreferences/commands.mdreferences/hooks.mdreferences/mcp-integration.mdreferences/plugin-json-schema.mdreferences/plugin-structure.mdreferences/skills-in-plugins.mdThis skill provides comprehensive guidance for creating, developing, and managing Claude Code plugins.
Plugins are modular packages that extend Claude Code's capabilities by bundling multiple components into a single installable unit. Unlike individual skills, plugins can include:
Follow these steps to create a new plugin:
Before creating a plugin, clarify:
Ask questions to gather concrete examples:
Create basic plugin directory with .claude-plugin/plugin.json containing: name, description, version, and author fields.
For detailed initialization steps:
Based on requirements, add the appropriate components. See references for detailed guidance on each component type:
Skills are model-invoked capabilities that Claude uses automatically based on task context.
When to use: For capabilities that should activate automatically (e.g., PDF processing, spreadsheet analysis, code review)
How to add:
skills/ directory at plugin rootskills/skill-name/SKILL.mdExample:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
└── skills/
├── pdf-processor/
│ └── SKILL.md
└── data-analyzer/
└── SKILL.md
See references/skills-in-plugins.md for complete guidance.
Commands are custom slash commands for repeatable workflows.
When to use: For user-initiated workflows that should be explicitly invoked (e.g., /deploy, /review-pr, /generate-report)
How to add:
commands/ directory at plugin rootcommands/command-name.mdExample command file (commands/deploy.md):
---
description: Deploy application to production environment
---
# Deploy Command
When this command is invoked, perform these steps:
1. Run pre-deployment checks
2. Build the application
3. Deploy to production
4. Verify deployment success
Commands support arguments: /deploy staging or /deploy production
See references/commands.md for advanced command features.
Agents are specialized subagents that Claude can invoke for specific task types.
When to use: For complex multi-step tasks that benefit from dedicated focus (e.g., code review agent, testing agent)
How to add:
agents/ directory at plugin rootagents/agent-name.mdSee references/agents.md for agent development patterns.
Hooks are event handlers that execute in response to system events.
When to use: For automation triggered by events (e.g., linting after edits, logging tool usage)
How to add:
hooks/ directory at plugin roothooks/hooks.json with hook configurationNote: Hooks are configured through Claude Code settings, not traditionally through plugin files. The hooks.json in plugins primarily serves as documentation or defaults.
See references/hooks.md for available events and configuration.
MCP servers connect Claude to external tools and services.
When to use: For integrating external APIs, databases, or services (e.g., GitHub API, Slack, database access)
How to add:
.mcp.json at plugin rootSee references/mcp-integration.md for MCP configuration.
Use the validation script to check plugin structure:
python3 utils/validate_plugin.py path/to/my-plugin
The validator checks:
Fix any validation errors before proceeding.
After creating and validating a new plugin, check if there is a marketplace configuration file that should be updated to include it:
For marketplace repositories:
.claude-plugin/marketplace.json exists in the repositoryplugins arrayExample marketplace.json entry:
{
"name": "my-plugin",
"source": {
"source": "github",
"repo": "username/repo-name"
},
"description": "Plugin description",
"version": "1.0.0",
"author": {
"name": "Author Name"
}
}
Important: Ask the user how they want to handle the newly created plugin:
The user's preference will determine whether marketplace configuration updates are needed.
Install the plugin locally for testing:
# Install from local directory
claude plugin install /path/to/my-plugin
Test all components:
/command-nameIterate based on testing feedback.
Choose distribution method:
Option 1: Git Repository
# Users install from git URL
claude plugin install https://github.com/username/my-plugin
Option 2: Plugin Marketplace
Option 3: Local/Team Distribution
For detailed information:
This skill includes detailed reference documentation for each plugin component:
Load these references as needed when working on specific components.
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.