From claude-plugins-validation
Add a new component (skill / agent / command / hook / mcp) to an existing plugin. Use when scaffolding a single component into a plugin without re-running the generator. Used dynamically via the-skills-menu (TRDD-478d9687).
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-plugins-validation:add-component-to-pluginWhen to use
When the cpv-main-menu user picks Manage → Add component, or any flow needs to scaffold a single component (skill/agent/command/hook/mcp) into an existing plugin
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Adds a new component (skill / agent / command / hook / mcp) to an existing plugin without re-running the generator or hand-editing scaffolds. Each component lands as a minimal but valid stub with frontmatter that passes `validate_plugin` / `validate_skill` out of the box. Loaded by `cpv-main-menu-agent` via the Manage → Add component menu branch.
Adds a new component (skill / agent / command / hook / mcp) to an existing plugin without re-running the generator or hand-editing scaffolds. Each component lands as a minimal but valid stub with frontmatter that passes validate_plugin / validate_skill out of the box. Loaded by cpv-main-menu-agent via the Manage → Add component menu branch.
uv on PATH.claude-plugin/plugin.jsonskill, agent, command, hook, mcphook / mcp, verify the JSON file already exists or will be created (the script merges entries idempotently).refresh-readme skill so the <!-- BEGIN AUTO-COMPONENTS --> block picks up the new component.plugin-validation-skill to confirm no drift was introduced.Copy this checklist and track your progress:
add_component.py invoked with all required argsrefresh_readme.pyvalidate_plugin --strict re-runskill → skills/<name>/SKILL.mdagent → agents/<name>.mdcommand → commands/<name>.mdhook → hooks/hooks.json (merged)mcp → .mcp.json (merged)| Error | Resolution |
|---|---|
existing file would be overwritten | Re-run with --force only if you genuinely intend to clobber |
unknown --type | Use one of: skill, agent, command, hook, mcp |
target is not a plugin | Confirm .claude-plugin/plugin.json exists at the path |
hook event invalid | See the canonical event list in CC docs (PreToolUse, PostToolUse, etc.) |
# Add a skill
uv run "${CLAUDE_PLUGIN_ROOT}/scripts/add_component.py" /path/to/plugin \
--type skill --name my-skill --description "What it does"
# Add an agent
uv run "${CLAUDE_PLUGIN_ROOT}/scripts/add_component.py" /path/to/plugin \
--type agent --name my-agent --description "Agent summary" --tools "Read, Bash"
# Add a slash command
uv run "${CLAUDE_PLUGIN_ROOT}/scripts/add_component.py" /path/to/plugin \
--type command --name my-command --description "What the command does" \
--allowed-tools "Bash(uv:*)"
# Append a hook entry to hooks/hooks.json (idempotent — skips dup)
uv run "${CLAUDE_PLUGIN_ROOT}/scripts/add_component.py" /path/to/plugin \
--type hook --event PreToolUse --command "echo before-tool"
# Register an MCP server in .mcp.json (stdio default; --http-url for HTTP)
uv run "${CLAUDE_PLUGIN_ROOT}/scripts/add_component.py" /path/to/plugin \
--type mcp --name my-server --command "node /path/to/server.js"
After adding, refresh the README:
uv run "${CLAUDE_PLUGIN_ROOT}/scripts/refresh_readme.py" /path/to/plugin
scaffold-skill skill — focused single-purpose skill wrapperscaffold-agent skill — focused agent scaffold wrapperscaffold-command skill — focused command scaffold wrapperadd-hook skill — focused hook merge wrapperregister-mcp skill — focused MCP registration wrapperrefresh-readme skill — refresh the auto-components README blocknpx claudepluginhub emasoft/emasoft-plugins --plugin claude-plugins-validationBlocks Edit/Write/Bash actions until Claude investigates importers, data schemas, and user instructions. Improves output quality by forcing concrete facts before edits.