developing-claude-code-plugins
mikekelly/developing-claude-code-pluginsBuild, test, and distribute Claude Code plugins with slash commands, agents, skills, hooks, MCP servers, and LSP servers. MUST be loaded when creating, reviewing, debugging, or distributing plugins. Use PROACTIVELY when user mentions plugins, extensions, marketplaces, or wants to add custom commands/agents to Claude Code.
SKILL.md
name: developing-claude-code-plugins description: "Build, test, and distribute Claude Code plugins with slash commands, agents, skills, hooks, MCP servers, and LSP servers. MUST be loaded when creating, reviewing, debugging, or distributing plugins. Use PROACTIVELY when user mentions plugins, extensions, marketplaces, or wants to add custom commands/agents to Claude Code."
<essential_principles>
How Claude Code Plugins Work
Plugins extend Claude Code with reusable functionality: custom slash commands, agents, skills, hooks, MCP servers, and LSP servers. Unlike standalone .claude/ configurations, plugins are namespaced, versioned, and distributable through marketplaces.
1. Plugin Structure Is Sacred
my-plugin/
├── .claude-plugin/
│ └── plugin.json # ONLY manifest here (required)
├── commands/ # Slash commands (plugin root)
├── agents/ # Subagent definitions (plugin root)
├── skills/ # Agent Skills (plugin root)
├── hooks/
│ └── hooks.json # Event handlers (plugin root)
├── .mcp.json # MCP server configs (plugin root)
└── .lsp.json # LSP server configs (plugin root)
CRITICAL: Never put commands/, agents/, skills/, or hooks/ inside .claude-plugin/. Only plugin.json goes there.
2. Namespacing Prevents Conflicts
Plugin commands use format /plugin-name:command-name. The name field in plugin.json becomes the namespace prefix. Choose names carefully - they're public-facing.
3. Use ${CLAUDE_PLUGIN_ROOT} for Paths
All paths in hooks, MCP servers, and scripts must use ${CLAUDE_PLUGIN_ROOT} to reference plugin files. Plugins are copied to a cache directory, so relative paths like ../ won't work.
4. Test with --plugin-dir During Development
claude --plugin-dir ./my-plugin
This loads your plugin without installation. Restart Claude Code after changes.
</essential_principles>
- Create a new plugin
- Add a component (command, agent, skill, hook, MCP, LSP)
- Test or debug a plugin
- Create a marketplace for distribution
- Something else
Wait for response before proceeding.
After reading the workflow, follow it exactly.
<verification_loop>
After Every Change
- Validate plugin structure:
claude plugin validate ./my-plugin
- Test plugin loads:
claude --plugin-dir ./my-plugin
- Verify components appear:
- Commands:
/helpshows plugin commands - Agents:
/agentslists plugin agents - MCP:
/mcpshows server status
Report to user:
- "Plugin validates: ✓"
- "Commands registered: X"
- "Ready for testing" </verification_loop>
<reference_index>
Domain Knowledge
All in references/:
Structure: plugin-structure.md Components: commands.md, agents.md, skills.md, hooks.md, mcp-lsp.md Distribution: marketplace.md Issues: troubleshooting.md </reference_index>
<workflows_index>
Workflows
All in workflows/:
| Workflow | Purpose |
|---|---|
| create-plugin.md | Create new plugin from scratch |
| add-component.md | Add command, agent, skill, hook, MCP, or LSP |
| test-debug-plugin.md | Test locally and fix issues |
| create-marketplace.md | Create and host plugin marketplace |
| </workflows_index> |
README
developing-claude-code-plugins
A Claude Code skill for building, testing, and distributing Claude Code plugins.
What This Skill Does
This skill provides comprehensive guidance for the full plugin development lifecycle:
- Create plugins with slash commands, agents, skills, hooks, MCP servers, and LSP servers
- Add components to existing plugins
- Test and debug plugins during development
- Create marketplaces for distributing plugins to teams and communities
Installation
This skill is installed as a personal skill in ~/.claude/skills/developing-claude-code-plugins/.
Usage
The skill is automatically invoked when you mention plugins, extensions, marketplaces, or want to add custom commands/agents to Claude Code.
Example prompts:
- "Create a new Claude Code plugin"
- "Add a slash command to my plugin"
- "How do I distribute my plugin?"
- "My plugin hooks aren't working"
Structure
developing-claude-code-plugins/
├── SKILL.md # Main skill file with router
├── workflows/ # Step-by-step procedures
│ ├── create-plugin.md
│ ├── add-component.md
│ ├── test-debug-plugin.md
│ └── create-marketplace.md
└── references/ # Domain knowledge
├── plugin-structure.md
├── commands.md
├── agents.md
├── skills.md
├── hooks.md
├── mcp-lsp.md
├── marketplace.md
└── troubleshooting.md
Source Documentation
Based on official Claude Code documentation:
- https://code.claude.com/docs/en/plugins.md
- https://code.claude.com/docs/en/plugins-reference.md
- https://code.claude.com/docs/en/skills.md
- https://code.claude.com/docs/en/hooks.md
- https://code.claude.com/docs/en/slash-commands.md
- https://code.claude.com/docs/en/sub-agents.md
- https://code.claude.com/docs/en/plugin-marketplaces.md