From claude-factory
Scaffold a complete Claude Code plugin with all components (skills, hooks, agents, MCP) from a natural language description. Use when creating new plugins for a marketplace or standalone. Triggers on /factory:plugin.
npx claudepluginhub lingelo/marketplace-claude-code --plugin claude-factoryThis skill is limited to using the following tools:
Official specification: @../../references/plugin-spec.md
Scaffolds complete Claude Code plugins interactively: generates plugin.json manifest, skills, agents, hooks, MCP/LSP servers, optional marketplace.json. Runs guided questionnaire, writes files to disk, prints test instructions.
Scaffolds Claude Code plugin packages: gathers requirements, creates directory structure, generates manifest, adds initial skill and README, tests installation. Triggers on 'create plugin', 'new plugin', 'scaffold plugin'.
Guides full Claude Code plugin lifecycle: scoping, initializing plugin.json, adding commands/agents/hooks/skills, validating with audits, and distributing to marketplaces.
Share bugs, ideas, or general feedback.
Official specification: @../../references/plugin-spec.md Skill spec (for sub-components): @../../references/skill-spec.md Hook spec (for sub-components): @../../references/hook-spec.md Agent spec (for sub-components): @../../references/agent-spec.md plugin.json template: @../../templates/plugin.json README template: @../../templates/readme.md
/factory:plugin "description of what the plugin should do"
/factory:plugin my-plugin "description"
Extract from $ARGUMENTS:
If empty, ask: "What should this plugin do? Describe its purpose and features."
Check if the target plugin already exists:
ls -la <target-path>/<plugin-name>/.claude-plugin/plugin.json 2>/dev/null
Break down the description to identify needed components:
| Signal in Description | Component | Example |
|---|---|---|
| "command", "skill", "/something" | Skill(s) | "a plugin with a /deploy command" |
| "block", "prevent", "validate before" | Hook (PreToolUse) | "block access to .env files" |
| "notify", "sound", "alert when" | Hook (Stop/Notification) | "play sound when done" |
| "agent", "reviewer", "analyzer" | Agent(s) | "with a code review agent" |
| "MCP", "server", "external API" | MCP config | "integrate with Figma API" |
| "template", "generate", "scaffold" | Templates dir | "generate boilerplate" |
Produce a component manifest:
Plugin: <name>
Components:
- Skills: [list of skills to create]
- Hooks: [list of hooks to create]
- Agents: [list of agents to create]
- MCP: [yes/no, which servers]
- Templates: [yes/no, which templates]
Use AskUserQuestion to gather decisions that cannot be inferred from the description. Skip questions whose answers are obvious from the description.
Ask only what is unresolved, in this order:
git config user.name 2>/dev/null
git config user.email 2>/dev/null
Present defaults and let the user confirm or override..claude-plugin/marketplace.json → write to plugins/<plugin-name>/ in the marketplace<CWD>/<plugin-name>/ (standalone plugin)ls -la <target-path>/<plugin-name>/ 2>/dev/null
If exists: show error, suggest alternative name. Do not overwrite.
Also check marketplace.json if in marketplace context:
grep -c '"<plugin-name>"' .claude-plugin/marketplace.json 2>/dev/null
.claude-plugin/plugin.json: Use template, fill in name, description, version 1.0.0, author
git config user.name 2>/dev/null
git config user.email 2>/dev/null
README.md: Use template, fill in:
For each skill in the manifest:
skills/<skill-name>/SKILL.md/factory:skillhooks/hooks.json with all hook entriesscripts/ with implementation scripts for each command-type hook/factory:hookFor each agent:
agents/<agent-name>.md/factory:agent.mcp.json with server definitions.templates/ with relevant template filesIf in a marketplace context (.claude-plugin/marketplace.json exists):
Ask: "Register this plugin in the marketplace? (recommended)"
If yes, read the existing marketplace.json and add the new plugin entry:
{
"name": "<plugin-name>",
"source": "./plugins/<plugin-name>",
"description": "<description>",
"category": "<detected-category>"
}
Category detection:
"security""development""productivity""integration"Plugin created: <plugin-name>
Location: <full-path>/<plugin-name>/
Structure:
.claude-plugin/plugin.json
README.md
[skills/<name>/SKILL.md for each skill]
[hooks/hooks.json + scripts/ for hooks]
[agents/<name>.md for each agent]
[.mcp.json for MCP servers]
Marketplace: <registered | not in marketplace context>
Next steps:
- Review generated files and customize as needed
- Run /factory:audit <plugin-path> to validate all components
- Test each skill/command manually
Triggered when Step 2 detects the plugin already exists.
Read the existing plugin.json and inventory all components:
# Read plugin metadata
cat <plugin-path>/.claude-plugin/plugin.json
# List all existing components
ls -R <plugin-path>/skills/ <plugin-path>/hooks/ <plugin-path>/agents/ <plugin-path>/.mcp.json <plugin-path>/.templates/ 2>/dev/null
Display to the user:
Existing plugin: <plugin-name> v<version>
Location: <full-path>
Description: <current description>
Author: <current author>
Components:
Skills: <list or "none">
Hooks: <list or "none">
Agents: <list or "none">
MCP: <yes/no>
Templates: <list or "none">
Use AskUserQuestion: "What would you like to change? Options:
Follow up with targeted questions based on the answer (e.g., if adding skills: "How many skills? What should each do?").
plugin.json with the Edit toolPlugin updated: <plugin-name>
Location: <full-path>
Changes:
- <summary of each modification>
Next steps:
- Review modified files
- Run /factory:audit <plugin-path> to validate