Interactive plugin setup and scaffolding tool for Claude Code plugins. Use this skill when user asks to "create plugin", "new plugin", "scaffold plugin", "setup plugin", "initialize plugin", "add command", "add skill", "add agent", "add hook", "add MCP server", or mentions creating Claude Code plugin components.
This skill is limited to using the following tools:
README.mdThis skill provides an interactive, guided workflow for creating new Claude Code plugins with proper structure, validation, and marketplace integration. It automates the entire plugin setup process from scaffolding to documentation.
Automatically invoke this skill when the user:
For comprehensive educational content, refer users to: plugins/plugin-dev/skills/plugin-setup/README.md
README contains:
This SKILL.md focuses on execution workflow while README provides user education.
This skill follows a 6-phase workflow:
Use the AskUserQuestion tool to gather all necessary information:
Question: "What should we name your plugin?"
Header: "Plugin Name"
Options:
- "Enter custom name" (allow text input)
Instructions:
- Must be kebab-case (lowercase with hyphens)
- Should be descriptive and unique
- No special characters except hyphens
- Examples: code-reviewer, test-runner, api-client
Validate the name:
ls plugins/[name]Ask for:
Question: "Which components would you like to include?"
Header: "Components"
MultiSelect: true
Options:
- "Commands - User-invoked slash commands"
- "Skills - Autonomous capabilities triggered by context"
- "Agents - Specialized subagents for complex tasks"
- "Hooks - Event-driven automation and validation"
- "MCP Servers - Model Context Protocol integrations"
Store selected components for Phase 2.
mkdir -p plugins/[plugin-name]/.claude-plugin
Read the starter-plugin manifest as reference:
Read: /Users/shawnsandy/devbox/claude-code/plugins/starter-plugin/.claude-plugin/plugin.json
Create plugin.json with gathered metadata:
{
"name": "[plugin-name]",
"version": "1.0.0",
"description": "[user-provided-description]",
"author": {
"name": "[author-name]",
"email": "[author-email]"
},
"homepage": "[homepage-url]",
"repository": "[repository-url]",
"license": "MIT",
"keywords": ["[keyword1]", "[keyword2]", "..."]
}
Write to: plugins/[plugin-name]/.claude-plugin/plugin.json
For each selected component type, create appropriate structure:
mkdir -p plugins/[plugin-name]/commandsplugins/starter-plugin/commands/example.mddescription to match plugin purposeargument-hint if command accepts parametersallowed-tools based on security requirementsplugins/[plugin-name]/commands/example-command.mdmkdir -p plugins/[plugin-name]/skills/example-skillplugins/starter-plugin/skills/example-skill/SKILL.mdname to match skill namedescription with WHAT it does AND WHEN to use (critical for triggering)allowed-tools based on security requirementsplugins/[plugin-name]/skills/example-skill/SKILL.mdOptional README for Skills:
Use AskUserQuestion to ask: "Would you like to include a README.md for this skill?"
If "Yes" selected:
templates/skill-readme-template.md or plugins/plugin-dev/skills/plugin-setup/README.md as referenceplugins/[plugin-name]/skills/example-skill/README.mdmkdir -p plugins/[plugin-name]/agentsplugins/starter-plugin/agents/example-agent.mdname and description for agent purposetools list (restrict to needed tools)model (inherit, sonnet, opus, haiku)permissionMode (auto, ask, or omit)plugins/[plugin-name]/agents/example-agent.mdmkdir -p plugins/[plugin-name]/hooks/scriptsplugins/starter-plugin/hooks/hooks.jsonplugins/starter-plugin/hooks/scripts/example-hook.sh${CLAUDE_PLUGIN_ROOT} for all script pathsplugins/[plugin-name]/hooks/hooks.json#!/bin/bashplugins/[plugin-name]/hooks/scripts/[hook-name].shchmod +x plugins/[plugin-name]/hooks/scripts/*.shplugins/starter-plugin/.mcp.json${CLAUDE_PLUGIN_ROOT}${VAR:-default}plugins/[plugin-name]/.mcp.jsonplugins/[plugin-name]/MCP-SETUP.mdRead the current marketplace catalog:
Read: .claude-plugin/marketplace.json
Parse the JSON and add new plugin entry to the "plugins" array:
{
"name": "[plugin-name]",
"source": "./plugins/[plugin-name]",
"description": "[brief-description]",
"version": "1.0.0"
}
Important: Maintain proper JSON formatting with commas between entries.
Write updated marketplace.json back to: .claude-plugin/marketplace.json
Read the current README.md:
Read: README.md
Find the "Available Plugins" section and add new plugin documentation:
### [Plugin Name]
[Plugin description]
**Components:**
- Commands: [list if included, or "None"]
- Skills: [list if included, or "None"]
- Agents: [list if included, or "None"]
- Hooks: [list if included, or "None"]
- MCP: [list if included, or "None"]
**Installation:**
\`\`\`bash
/plugin marketplace add shawnsandy/claude-code
/plugin install [plugin-name]@claude-code-marketplace
\`\`\`
**Usage:**
[Basic usage examples for each component type]
Write updated README.md back to: README.md
Run validation checks to ensure plugin is properly configured:
# Validate marketplace.json
jq empty .claude-plugin/marketplace.json
# Validate plugin.json
jq empty plugins/[plugin-name]/.claude-plugin/plugin.json
# If hooks included, validate hooks.json
jq empty plugins/[plugin-name]/hooks/hooks.json
# If MCP included, validate .mcp.json
jq empty plugins/[plugin-name]/.mcp.json
If any JSON validation fails, show error and fix the syntax.
For each component with frontmatter (commands, skills, agents):
description (required)name, description (both required)name, description (both required)If hooks included:
# Verify scripts are executable
ls -la plugins/[plugin-name]/hooks/scripts/
# If not executable, make them executable
chmod +x plugins/[plugin-name]/hooks/scripts/*.sh
# Validate bash syntax
bash -n plugins/[plugin-name]/hooks/scripts/*.sh
Verify:
.claude-plugin/plugins/[name]/commands/plugins/[name]/.claude-plugin/commands/Verify all names use kebab-case:
Check that all paths use ${CLAUDE_PLUGIN_ROOT}:
Report validation results to user with specific issues if any fail.
After successful validation, provide testing instructions:
## Testing Your New Plugin
Your plugin has been created successfully! Here's how to test it:
### 1. Add Marketplace Locally
\`\`\`bash
/plugin marketplace add /Users/shawnsandy/devbox/claude-code
\`\`\`
### 2. Verify Marketplace
\`\`\`bash
/plugin marketplace list
\`\`\`
You should see "claude-code-marketplace" in the list.
### 3. Install Your Plugin
\`\`\`bash
/plugin install [plugin-name]@claude-code-marketplace
\`\`\`
### 4. Verify Installation
\`\`\`bash
/plugin list
/plugin info [plugin-name]
\`\`\`
### 5. Test Components
[If commands included:]
**Commands:**
\`\`\`bash
/example-command [arguments]
\`\`\`
[If skills included:]
**Skills:**
Skills trigger automatically. Try asking: "[example trigger phrase]"
[If agents included:]
**Agents:**
Agents are launched via Task tool when needed for [specific scenario].
[If hooks included:]
**Hooks:**
Hooks run automatically on events. Try [action that triggers hook].
[If MCP included:]
**MCP Servers:**
See MCP-SETUP.md in the plugin directory for configuration instructions.
### Next Steps
1. Customize the example components for your use case
2. Update descriptions to match your plugin's purpose
3. Test thoroughly with different scenarios
4. Update documentation with specific examples
5. Consider creating additional components as needed
### File Locations
Your plugin files are located at:
- Plugin manifest: `plugins/[plugin-name]/.claude-plugin/plugin.json`
- Commands: `plugins/[plugin-name]/commands/`
- Skills: `plugins/[plugin-name]/skills/`
- Agents: `plugins/[plugin-name]/agents/`
- Hooks: `plugins/[plugin-name]/hooks/`
- MCP: `plugins/[plugin-name]/.mcp.json`
### Reference Documentation
- Starter Plugin: `plugins/starter-plugin/` - Complete examples
- Project Guide: `CLAUDE.md` - Architecture and patterns
- Official Docs: https://code.claude.com/docs/en/plugins-reference
chmod +x automaticallyAlways consult these reference implementations:
plugins/starter-plugin/ - Complete working examples.claude-plugin/marketplace.json - Marketplace structureCLAUDE.md - Project conventions and patterns