Developing Claude Code Plugins
Overview
This skill provides efficient workflows for creating Claude Code plugins. Use it to make plugin development fast and correct - it synthesizes official docs into actionable steps and provides working examples.
When to Use
Use this skill when:
- Creating a new Claude Code plugin from scratch
- Adding components to an existing plugin (skills, commands, hooks, MCP servers)
- Setting up a development marketplace for testing
- Troubleshooting plugin structure issues
- Understanding plugin architecture and patterns
- Releasing a plugin (versioning, tagging, marketplace distribution)
- Publishing updates or maintaining existing plugins
For comprehensive official documentation, use the working-with-claude-code skill to access full docs.
Quick Reference
| Need to... |
Read This |
Official Docs |
| Understand directory structure |
references/plugin-structure.md |
plugins.md |
| Choose a plugin pattern |
references/common-patterns.md |
plugins.md |
| Make hooks work cross-platform |
references/polyglot-hooks.md |
hooks.md |
| Debug plugin issues |
references/troubleshooting.md |
Various |
| See working examples |
examples/ directory |
N/A |
Plugin Development Workflow
Phase 1: Plan
Before writing code:
Define your plugin's purpose
- What problem does it solve?
- Who will use it?
- What components will it need?
Choose your pattern (read references/common-patterns.md)
- Simple plugin with one skill?
- MCP integration with guidance?
- Command collection?
- Full-featured platform?
Review examples
examples/simple-greeter-plugin/ - Minimal plugin
examples/full-featured-plugin/ - All components
- Installed plugins in
~/.claude/plugins/
Phase 2: Create Structure
Create directories (see references/plugin-structure.md for details):
mkdir -p my-plugin/.claude-plugin
mkdir -p my-plugin/skills
# Add other component directories as needed
Write plugin.json (required):
{
"name": "my-plugin",
"version": "1.0.0",
"description": "What your plugin does",
"author": {"name": "Your Name"}
}
See references/plugin-structure.md for complete format.
Create development marketplace (for local testing):
Create .claude-plugin/marketplace.json:
{
"name": "my-dev",
"plugins": [{
"name": "my-plugin",
"source": "./"
}]
}
See references/plugin-structure.md for complete format.
Phase 3: Add Components
Use TodoWrite to track component creation:
Example:
- Create skill: main-workflow
- Add command: /hello
- Configure hooks
- Write README
- Test installation
For each component type, see:
- Format/syntax:
references/plugin-structure.md
- When to use:
references/common-patterns.md
- Working code:
examples/ directory
Phase 4: Test Locally
Install for testing:
/plugin marketplace add /path/to/my-plugin
/plugin install my-plugin@my-dev
Then restart Claude Code.
Test each component:
- Skills: Ask for tasks matching skill descriptions
- Commands: Run
/your-command
- MCP servers: Check tools are available
- Hooks: Trigger relevant events
Iterate:
/plugin uninstall my-plugin@my-dev
# Make changes
/plugin install my-plugin@my-dev
# Restart Claude Code
Phase 5: Debug and Refine
If something doesn't work, read references/troubleshooting.md for:
- Plugin not loading
- Skill not triggering
- Command not appearing
- MCP server not starting
- Hooks not firing
Common issues are usually:
- Wrong directory structure
- Hardcoded paths (use
${CLAUDE_PLUGIN_ROOT})
- Forgot to restart Claude Code
- Missing executable permissions on scripts
Phase 6: Release and Distribute
Write README with:
- What the plugin does
- Installation instructions
- Usage examples
- Component descriptions
Version your release using semantic versioning:
- Update
version in .claude-plugin/plugin.json
- Document changes in CHANGELOG.md or RELEASE-NOTES.md
- Example:
"version": "1.2.1" (major.minor.patch)
Commit and tag your release:
git add .
git commit -m "Release v1.2.1: [brief description]"
git tag v1.2.1
git push origin main
git push origin v1.2.1
Choose distribution method:
Option A: Direct GitHub distribution
- Users add:
/plugin marketplace add your-org/your-plugin-repo
- Your plugin.json serves as the manifest
Option B: Marketplace distribution (recommended for multi-plugin collections)
- Create separate marketplace repository
- Add
.claude-plugin/marketplace.json with plugin references:{
"name": "my-marketplace",
"owner": {"name": "Your Name"},
"plugins": [{
"name": "your-plugin",
"source": {
"source": "url",
"url": "https://github.com/your-org/your-plugin.git"
},
"version": "1.2.1",
"description": "Plugin description"
}]
}
- Users add:
/plugin marketplace add your-org/your-marketplace
- Update marketplace manifest for each plugin release
Option C: Private/team distribution
Test the release:
# Test fresh installation
/plugin marketplace add your-marketplace-source
/plugin install your-plugin@marketplace-name
# Verify functionality, then clean up
/plugin uninstall your-plugin@marketplace-name
Announce and maintain:
- GitHub releases (optional)
- Team notifications
- Monitor for issues and user feedback
- Plan maintenance updates
Critical Rules
Always follow these (from references/plugin-structure.md):
.claude-plugin/ contains ONLY manifests (plugin.json and optionally marketplace.json)
- ❌ Don't put skills, commands, or other components inside
- ✅ Put them at plugin root
Use ${CLAUDE_PLUGIN_ROOT} for all paths in config files
- Makes plugin portable across systems
- Required for hooks, MCP servers, scripts
Use relative paths in plugin.json
- Start with
./
- Relative to plugin root
Make scripts executable
chmod +x script.sh
- Required for hooks and MCP servers
Resources in This Skill
references/plugin-structure.md - Directory layout, file formats, component syntax
references/common-patterns.md - When to use each plugin pattern, examples
references/polyglot-hooks.md - Cross-platform hook wrapper for Windows/macOS/Linux
references/troubleshooting.md - Debug guide for common issues
examples/simple-greeter-plugin/ - Minimal working plugin (one skill)
examples/full-featured-plugin/ - Complete plugin with all components (includes run-hook.cmd)
Cross-References
For deep dives into official documentation, use the working-with-claude-code skill to access:
plugins.md - Plugin development overview
plugins-reference.md - Complete API reference
skills.md - Skill authoring guide
slash-commands.md - Command format
hooks.md, hooks-guide.md - Hook system
mcp.md - MCP server integration
plugin-marketplaces.md - Distribution
Best Practices
- Start simple - Begin with minimal structure, add complexity when needed
- Test frequently - Install → test → uninstall → modify → repeat
- Use examples - Copy patterns from working plugins
- Follow conventions - Match style of existing plugins
- Document everything - Clear README helps users and future you
- Version properly - Use semantic versioning (major.minor.patch)
Workflow Summary
Plan → Choose pattern, review examples
Create → Make structure, write manifests
Add → Build components (skills, commands, etc.)
Test → Install via dev marketplace
Debug → Use troubleshooting guide
Release → Version, tag, distribute via marketplace
Maintain → Monitor, update, support users
The correct path is the fast path. Use references, follow patterns, test frequently.
1---2name: developing-claude-code-plugins3description: Use when working on Claude Code plugins (creating, modifying, testing, releasing, or maintaining) - provides streamlined workflows, patterns, and examples for the complete plugin lifecycle4---56# Developing Claude Code Plugins78## Overview910This skill provides efficient workflows for creating Claude Code plugins. Use it to make plugin development fast and correct - it synthesizes official docs into actionable steps and provides working examples.1112## When to Use1314Use this skill when:15- Creating a new Claude Code plugin from scratch16- Adding components to an existing plugin (skills, commands, hooks, MCP servers)17- Setting up a development marketplace for testing18- Troubleshooting plugin structure issues19- Understanding plugin architecture and patterns20- Releasing a plugin (versioning, tagging, marketplace distribution)21- Publishing updates or maintaining existing plugins2223**For comprehensive official documentation**, use the `working-with-claude-code` skill to access full docs.2425## Quick Reference2627| Need to... | Read This | Official Docs |28|-----------|-----------|---------------|29| Understand directory structure | `references/plugin-structure.md` | `plugins.md` |30| Choose a plugin pattern | `references/common-patterns.md` | `plugins.md` |31| Make hooks work cross-platform | `references/polyglot-hooks.md` | `hooks.md` |32| Debug plugin issues | `references/troubleshooting.md` | Various |33| See working examples | `examples/` directory | N/A |3435## Plugin Development Workflow3637### Phase 1: Plan3839Before writing code:40411. **Define your plugin's purpose**42 - What problem does it solve?43 - Who will use it?44 - What components will it need?45462. **Choose your pattern** (read `references/common-patterns.md`)47 - Simple plugin with one skill?48 - MCP integration with guidance?49 - Command collection?50 - Full-featured platform?51523. **Review examples**53 - `examples/simple-greeter-plugin/` - Minimal plugin54 - `examples/full-featured-plugin/` - All components55 - Installed plugins in `~/.claude/plugins/`5657### Phase 2: Create Structure58591. **Create directories** (see `references/plugin-structure.md` for details):60 ```bash61 mkdir -p my-plugin/.claude-plugin62 mkdir -p my-plugin/skills63 # Add other component directories as needed64 ```65662. **Write plugin.json** (required):67 ```json68 {69 "name": "my-plugin",70 "version": "1.0.0",71 "description": "What your plugin does",72 "author": {"name": "Your Name"}73 }74 ```75 See `references/plugin-structure.md` for complete format.76773. **Create development marketplace** (for local testing):7879 Create `.claude-plugin/marketplace.json`:80 ```json81 {82 "name": "my-dev",83 "plugins": [{84 "name": "my-plugin",85 "source": "./"86 }]87 }88 ```8990 See `references/plugin-structure.md` for complete format.9192### Phase 3: Add Components9394Use TodoWrite to track component creation:9596**Example:**97```98- Create skill: main-workflow99- Add command: /hello100- Configure hooks101- Write README102- Test installation103```104105For each component type, see:106- **Format/syntax**: `references/plugin-structure.md`107- **When to use**: `references/common-patterns.md`108- **Working code**: `examples/` directory109110### Phase 4: Test Locally1111121. **Install for testing**:113 ```bash114 /plugin marketplace add /path/to/my-plugin115 /plugin install my-plugin@my-dev116 ```117 Then restart Claude Code.1181192. **Test each component**:120 - Skills: Ask for tasks matching skill descriptions121 - Commands: Run `/your-command`122 - MCP servers: Check tools are available123 - Hooks: Trigger relevant events1241253. **Iterate**:126 ```bash127 /plugin uninstall my-plugin@my-dev128 # Make changes129 /plugin install my-plugin@my-dev130 # Restart Claude Code131 ```132133### Phase 5: Debug and Refine134135If something doesn't work, read `references/troubleshooting.md` for:136- Plugin not loading137- Skill not triggering138- Command not appearing139- MCP server not starting140- Hooks not firing141142Common issues are usually:143- Wrong directory structure144- Hardcoded paths (use `${CLAUDE_PLUGIN_ROOT}`)145- Forgot to restart Claude Code146- Missing executable permissions on scripts147148### Phase 6: Release and Distribute1491501. **Write README** with:151 - What the plugin does152 - Installation instructions153 - Usage examples154 - Component descriptions1551562. **Version your release** using semantic versioning:157 - Update `version` in `.claude-plugin/plugin.json`158 - Document changes in CHANGELOG.md or RELEASE-NOTES.md159 - Example: `"version": "1.2.1"` (major.minor.patch)1601613. **Commit and tag your release**:162 ```bash163 git add .164 git commit -m "Release v1.2.1: [brief description]"165 git tag v1.2.1166 git push origin main167 git push origin v1.2.1168 ```1691704. **Choose distribution method**:171172 **Option A: Direct GitHub distribution**173 - Users add: `/plugin marketplace add your-org/your-plugin-repo`174 - Your plugin.json serves as the manifest175176 **Option B: Marketplace distribution** (recommended for multi-plugin collections)177 - Create separate marketplace repository178 - Add `.claude-plugin/marketplace.json` with plugin references:179 ```json180 {181 "name": "my-marketplace",182 "owner": {"name": "Your Name"},183 "plugins": [{184 "name": "your-plugin",185 "source": {186 "source": "url",187 "url": "https://github.com/your-org/your-plugin.git"188 },189 "version": "1.2.1",190 "description": "Plugin description"191 }]192 }193 ```194 - Users add: `/plugin marketplace add your-org/your-marketplace`195 - Update marketplace manifest for each plugin release196197 **Option C: Private/team distribution**198 - Configure in team's `.claude/settings.json`:199 ```json200 {201 "extraKnownMarketplaces": {202 "team-tools": {203 "source": {"source": "github", "repo": "your-org/plugins"}204 }205 }206 }207 ```2082095. **Test the release**:210 ```bash211 # Test fresh installation212 /plugin marketplace add your-marketplace-source213 /plugin install your-plugin@marketplace-name214 # Verify functionality, then clean up215 /plugin uninstall your-plugin@marketplace-name216 ```2172186. **Announce and maintain**:219 - GitHub releases (optional)220 - Team notifications221 - Monitor for issues and user feedback222 - Plan maintenance updates223224## Critical Rules225226**Always follow these** (from `references/plugin-structure.md`):2272281. **`.claude-plugin/` contains ONLY manifests** (`plugin.json` and optionally `marketplace.json`)229 - ❌ Don't put skills, commands, or other components inside230 - ✅ Put them at plugin root2312322. **Use `${CLAUDE_PLUGIN_ROOT}` for all paths in config files**233 - Makes plugin portable across systems234 - Required for hooks, MCP servers, scripts2352363. **Use relative paths in `plugin.json`**237 - Start with `./`238 - Relative to plugin root2392404. **Make scripts executable**241 - `chmod +x script.sh`242 - Required for hooks and MCP servers243244## Resources in This Skill245246- **`references/plugin-structure.md`** - Directory layout, file formats, component syntax247- **`references/common-patterns.md`** - When to use each plugin pattern, examples248- **`references/polyglot-hooks.md`** - Cross-platform hook wrapper for Windows/macOS/Linux249- **`references/troubleshooting.md`** - Debug guide for common issues250- **`examples/simple-greeter-plugin/`** - Minimal working plugin (one skill)251- **`examples/full-featured-plugin/`** - Complete plugin with all components (includes `run-hook.cmd`)252253## Cross-References254255For deep dives into official documentation, use the `working-with-claude-code` skill to access:256- `plugins.md` - Plugin development overview257- `plugins-reference.md` - Complete API reference258- `skills.md` - Skill authoring guide259- `slash-commands.md` - Command format260- `hooks.md`, `hooks-guide.md` - Hook system261- `mcp.md` - MCP server integration262- `plugin-marketplaces.md` - Distribution263264## Best Practices2652661. **Start simple** - Begin with minimal structure, add complexity when needed2672. **Test frequently** - Install → test → uninstall → modify → repeat2683. **Use examples** - Copy patterns from working plugins2694. **Follow conventions** - Match style of existing plugins2705. **Document everything** - Clear README helps users and future you2716. **Version properly** - Use semantic versioning (major.minor.patch)272273## Workflow Summary274275```276Plan → Choose pattern, review examples277Create → Make structure, write manifests278Add → Build components (skills, commands, etc.)279Test → Install via dev marketplace280Debug → Use troubleshooting guide281Release → Version, tag, distribute via marketplace282Maintain → Monitor, update, support users283```284285**The correct path is the fast path.** Use references, follow patterns, test frequently.