--- name: plugin-create description: > Use when the user wants to create a new plugin in the marketplace — scaffold the directory structure, generate plugin.json manifests for Claude Code and Copilot CLI, and register the plugin in marketplace.json. Triggers: "create a new plugin", "add a plugin called X", "scaffold a plugin", "new plugin for Y". Do NOT use when auditing or refactoring existing plugins (use /marketplace-architect), authoring skill content inside a plugin (use /write-skill), adopting an external plugin into the marketplace (use /marketplace-architect), or validating existing manifests without creating anything (use /marketplace-architect). metadata: category: marketplace --- ## Required inputs - **Plugin name** — kebab-case slug; ask if not stated. Validate: lowercase letters, digits, hyphens only; not already present in `plugins/` or `.claude-plugin/marketplace.json`; not a reserved name (`anthropic-*`, `claude-*`, `agent-skills`, `official-claude-plugins`). - **Plugin description** — one sentence; ask if not stated. - **Author name** — ask if not stated. - **Author email** — ask if not stated; used in the Copilot root `plugin.json`. - **Author URL** — ask if not stated; used in Claude's `.claude-plugin/plugin.json`. ## Constraints - Load the plugin template from `assets/plugin-template/` bundled inside this skill (`${CLAUDE_PLUGIN_ROOT}/skills/create-plugin/assets/plugin-template/`). Stop if the path is missing — do not generate files from memory. - Plugin name must be kebab-case and not a reserved name (`anthropic-*`, `claude-*`, `agent-skills`, `official-claude-plugins`) — halt and ask for a replacement before Gate A if violated. - Do not write any file until Gate A (plan approval) and Gate B (file contents approval) are both explicitly confirmed. - Replace all five placeholder markers — `PLUGIN_NAME`, `PLUGIN_DESCRIPTION`, `AUTHOR_NAME`, `AUTHOR_EMAIL`, `AUTHOR_URL` — in every copied file before Gate B review. No marker may appear in written output. - Do not generate skill content — `skills/` is scaffolded as an empty directory with README only. Direct the user to `/write-skill` to add skills. - Do not set `version` in both `plugin.json` and the marketplace entry — `plugin.json` wins silently and blocks updates for existing users. - Update `.github/plugin/marketplace.json` only if it already exists — do not create it. - Do not auto-invoke `/marketplace-architect` — hand off by name at the end; let the user trigger it. ## Process 1. **Collect inputs.** Ask for plugin name, description, author name, author email, and author URL — one question at a time. Validate the plugin name: kebab-case format, not a reserved name, not already present in `plugins/` or `.claude-plugin/marketplace.json`. If any validation fails, stop and ask for a replacement before continuing. 2. **Check template.** Load the bundled template from `assets/plugin-template/` inside this skill (`${CLAUDE_PLUGIN_ROOT}/skills/create-plugin/assets/plugin-template/`). If the path is missing, stop and report it — do not proceed or generate files from memory. 3. **Gate A — plan review.** Present: the list of files that will be written (derived from `assets/plugin-template/` with `PLUGIN_NAME` substituted into filenames), the new `plugins//` directory path, the marketplace entry that will be added to `.claude-plugin/marketplace.json`, and whether `.github/plugin/marketplace.json` will also be updated. Wait for explicit approval — do not proceed on "looks good" or silence. 4. **Copy and substitute.** Copy `assets/plugin-template/` to `plugins//`. In every copied file, replace all occurrences of `PLUGIN_NAME`, `PLUGIN_DESCRIPTION`, `AUTHOR_NAME`, `AUTHOR_EMAIL`, and `AUTHOR_URL` with the collected values. Rename any file or directory whose name contains `PLUGIN_NAME`. 5. **Gate B — file contents review.** Show every file with its full substituted content. Wait for explicit approval — do not write until confirmed. 6. **Write files.** Write all substituted files to `plugins//`. Append the new plugin entry to `.claude-plugin/marketplace.json`. If `.github/plugin/marketplace.json` exists, append the same entry there. 7. **Validate.** Run `claude plugin validate .` from `plugins//`. Report all output inline — do not suppress warnings. If the command is unavailable, note it and suggest the user run it manually after local install. 8. **Hand off.** Print: "Plugin `` created and registered in `marketplace.json`. Fill in skill and agent content, then run `/marketplace-architect` to audit the full marketplace." ## Output format - `plugins//` — directory tree copied from `assets/plugin-template/` with all placeholders substituted - `.claude-plugin/marketplace.json` — updated with the new plugin entry - `.github/plugin/marketplace.json` — updated with the same entry, only if it already existed - Inline validation report from `claude plugin validate .` ## Failure handling - `assets/plugin-template/` not found at `${CLAUDE_PLUGIN_ROOT}/skills/create-plugin/assets/plugin-template/` — stop, report the path, do not generate from memory. - Plugin name already exists in `plugins/` or `marketplace.json` — stop, report the conflict, ask for a different name. - Reserved name detected — stop, report the name and the reserved list, ask for a replacement before continuing. - `claude plugin validate .` unavailable — report that automated validation was skipped; suggest running it manually with `claude --plugin-dir ./plugins/`. ## Self-check - [ ] Plugin name validated: kebab-case, not reserved, not already present in `plugins/` or `marketplace.json` - [ ] `assets/plugin-template/` verified to exist at `${CLAUDE_PLUGIN_ROOT}/skills/create-plugin/assets/plugin-template/` before any file generation - [ ] Gate A presented with file list and marketplace entry — explicit approval received - [ ] All five markers substituted in all files — none appear in written output - [ ] Gate B presented with full substituted file contents — explicit approval received - [ ] Files written only after Gate B approval - [ ] `.github/plugin/marketplace.json` updated only if it already existed — not created - [ ] `claude plugin validate .` run and results reported; or unavailability noted - [ ] Hand-off message printed directing user to `/marketplace-architect` - [ ] No skill content generated — `skills/` is empty with README only