| name | pack-components |
| description | Pack a folder of standalone components (skill/agent/command/hook/mcp/lsp/monitor/output-style) into a new installable plugin. Use when bundling loose components into a single publishable plugin. Used dynamically via the-skills-menu (TRDD-478d9687). |
| when_to_use | When the cpv-main-menu user picks Create → Pack components, or any flow needs to bundle a folder of standalone components into a single installable plugin |
| user-invocable | false |
pack-components
Overview
Converts a folder of standalone Claude Code components into a single installable plugin. Useful for recovering from "Phase 0 plugin-shape detection refused" — wrap the detected components into a real plugin shape that loads correctly. Also useful for rolling skills / agents / commands from disparate projects into a shared plugin, or migrating ad-hoc component folders to publishable plugins without hand-editing manifests. The script discovers every supported component type, validates the selection, then scaffolds a fresh plugin and copies the components into their canonical locations. Loaded dynamically via the-skills-menu, reached via the Create → Pack components menu branch.
Prerequisites
uv on PATH
- A source folder containing one or more detectable components
- For marketplace integration: optional marketplace path
Instructions
- Run
--list-only first to discover what's in the source folder (no writes).
- Choose
--all (pack every discovered component) or --include (multi-select per type).
- Provide the new plugin's
--name, --description, --author, --author-email, and optionally --github-owner.
- Optionally chain
--add-to-marketplace or --create-marketplace for one-shot publishing.
- After packing, run plugin validation on the new plugin (see
plugin-validation-skill).
- If any CRITICAL / MAJOR finding appears, dispatch the plugin-fixer agent with
min_severity=MAJOR to remediate before publishing.
Copy this checklist and track your progress:
Output
- A new plugin directory at the target path with:
.claude-plugin/plugin.json
- Canonical component subdirectories (
skills/, agents/, commands/, hooks/, etc.)
- The source components copied to their canonical locations
- Optional marketplace registration if
--add-to-marketplace or --create-marketplace was passed.
Error Handling
| Code | Meaning |
|---|
| 0 | OK |
| 1 | Invalid args / source not found |
| 2 | Source folder has no detectable components |
| 3 | Selection conflict (duplicates, --all + --include, ...) |
| 4 | Scaffolding or pack step failed |
| 5 | Marketplace operation failed |
Examples
uv run --with pyyaml python "${CLAUDE_PLUGIN_ROOT}/scripts/cpv_pack_components.py" \
/path/to/source-folder --list-only
uv run --with pyyaml python "${CLAUDE_PLUGIN_ROOT}/scripts/cpv_pack_components.py" \
/path/to/source-folder /path/to/new-plugin \
--name my-plugin --description "What the plugin does" \
--author "Alice" --author-email "alice@example.com" \
--github-owner alice \
--all
uv run --with pyyaml python "${CLAUDE_PLUGIN_ROOT}/scripts/cpv_pack_components.py" \
/path/to/source-folder /path/to/new-plugin \
--name my-plugin \
--author "Alice" --author-email "alice@example.com" \
--include "skill=my-skill,other-skill" \
--include "agent=my-agent"
uv run --with pyyaml python "${CLAUDE_PLUGIN_ROOT}/scripts/cpv_pack_components.py" \
/path/to/source /path/to/target --name my-plugin --all --json
Resources
- Components and Marketplace — discovered types, marketplace integration flags
Component types discovered · Marketplace integration
create-plugin skill — scaffold a plugin from scratch
plugin-validation-skill — validate the newly packed plugin
fix-validation skill — fix-up recipes after packing
marketplace-authoring-contract skill — when chaining --add-to-marketplace