Add a new component to an existing plugin
Add a new component to an existing Claude Code plugin. Use this when you need to create slash commands, agents, hooks, skills, or MCP servers within your plugin.
/plugin marketplace add claude-market/marketplace/plugin install plugin-builder@claude-marketYou are helping a user add a new component to an existing Claude Code plugin.
Use Glob to find all plugins in ./*/.claude-plugin/plugin.json and ask the user which plugin they want to add to (or let them specify a path).
Read the plugin.json to understand what components already exist.
Use AskUserQuestion to ask what type of component they want to add:
Present these as clear options explaining what each type does.
Based on the selected component type, collect the essential information:
Use AskUserQuestion to collect:
Use AskUserQuestion to collect:
Use AskUserQuestion to collect:
Use AskUserQuestion to collect:
Use AskUserQuestion to collect:
Based on the component type selected, invoke the corresponding builder skill to handle the detailed generation:
Invoke the cc-command-builder skill:
Create a new Claude Code slash command with the following details:
- Plugin: [plugin-name]
- Command name: [name]
- Description: [description]
- File path: [plugin-path]/commands/[command-name].md
Please guide the user through creating this command following best practices.
Invoke the cc-agent-builder skill:
Create a new Claude Code subagent with the following details:
- Plugin: [plugin-name]
- Agent name: [name]
- Description: [description]
- File path: [plugin-path]/agents/[agent-name].md
Please guide the user through creating this subagent following best practices.
Invoke the cc-hook-builder skill:
Create a new Claude Code hook with the following details:
- Plugin: [plugin-name]
- Hook name: [name]
- Description: [description]
- File path: [plugin-path]/hooks/[hook-name].json
Please guide the user through creating this hook following best practices.
Invoke the cc-skill-builder skill:
Create a new Claude Code skill with the following details:
- Plugin: [plugin-name]
- Skill name: [name]
- Description: [description]
- File path: [plugin-path]/skills/[skill-name].md
Please guide the user through creating this skill following best practices.
Invoke the cc-mcp-builder skill:
Configure a new MCP server with the following details:
- Plugin: [plugin-name]
- Server name: [name]
- Description: [description]
- File path: [plugin-path]/mcp-servers/[server-name].json
Please guide the user through configuring this MCP server following best practices.
IMPORTANT: After the builder skill completes and creates the component file, you must update plugin.json to include the new component.
Add the new component file path to the appropriate array in plugin.json:
commands array (e.g., "./commands/my-command.md")agents array (e.g., "./agents/my-agent.md")hooks fieldskills array (e.g., "./skills/my-skill.md")mcpServers fieldAll paths must be relative to plugin root and begin with ./
Example:
{
"name": "my-plugin",
"commands": ["./commands/existing-command.md", "./commands/new-command.md"],
"agents": ["./agents/existing-agent.md"],
"skills": ["./skills/new-skill.md"]
}
Update the plugin's README.md to document the new component with usage examples.
Show the user: