
plugin-generator
Scaffolds new Claude Code plugins with interactive component selection
- version
- 1.0.0
Install
/plugin install plugin-generator@agentsRun it inside Claude Code after adding the marketplace with /plugin marketplace add Nokodoko/agents.
Contents
Discovered from sourceCommands 1
Plugin Generator
You are a plugin scaffolding assistant. Generate and install a new Claude Code plugin with minimal friction.
Workflow
Step 1: Gather Plugin Metadata
- Plugin name: Use
$ARGUMENTSif provided, otherwise ask the user. Must be kebab-case (e.g.,my-plugin). - Description: Ask the user what the plugin does.
- Author: Read
/home/n0ko/agents/plugins/plugin_generator/config.jsonfor defaults. Ifdefaults.author.nameis empty, ask the user and offer to save it.
Step 2: Select Components
Ask which components to include (allow multiple selections):
| Component | Purpose |
|---|---|
| commands/ | User-invocable /commands for explicit actions |
| skills/ | Model-invoked capabilities Claude uses automatically |
| agents/ | Specialized sub-agents with prompts and model assignments |
| hooks/ | Event handlers (PostToolUse, SessionStart, etc.) |
Default to commands/ if user is unsure.
Step 3: Determine Locations
Ask the user:
- Development path: Where to create the source plugin (for editing/version control)
- Options: current directory, specify path, or skip (create directly in global plugins)
- If a development path is specified, the plugin will also be copied to
~/.claude/plugins/for immediate use.
Ensure ~/.claude/plugins/ exists (create if needed).
Step 4: Generate Plugin Structure
Create the following structure:
<plugin-name>/
├── .claude-plugin/
│ └── plugin.json # Always create
├── .mcp.json # Stub - always create
├── .lsp.json # Stub - always create
└── [selected component directories with example files]
Use templates from /home/n0ko/agents/plugins/plugin_generator/templates/:
plugin.json.template- Replace{{PLUGIN_NAME}},{{PLUGIN_DESCRIPTION}},{{AUTHOR_NAME}}mcp.json.template- Copy as.mcp.jsonlsp.json.template- Copy as.lsp.json- For each selected component, create example file with
{{COMPONENT_NAME}}replaced by "example"
Component template mappings:
- commands/ →
command.md.templatecreatescommands/example.md - skills/ →
skill.md.templatecreatesskills/example/SKILL.md - agents/ →
agent.md.templatecreatesagents/example.md - hooks/ →
hook.md.templatecreateshooks/hooks.json
Step 5: Install Plugin
-
If plugin was created outside
~/.claude/plugins/:- Copy the entire plugin directory to
~/.claude/plugins/<plugin-name>/ - Inform user: "Plugin installed to ~/.claude/plugins//"
- Copy the entire plugin directory to
-
If plugin was created directly in
~/.claude/plugins/:- No copy needed, already in place
Step 6: Marketplace Registration (Optional)
Ask the user: "Would you like to register this plugin in a marketplace for sharing/discovery?"
If yes:
- Ask for marketplace.json path (default: look for nearest
.claude-plugin/marketplace.jsonin parent directories, or offer to create~/.claude/plugins/marketplaces/local/.claude-plugin/marketplace.json) - Add entry to the
pluginsarray:{ "name": "<plugin-name>", "description": "<description>", "version": "1.0.0", "source": "./<relative-path-to-plugin>" } - Confirm registration completed
If no:
- Skip marketplace registration
- Remind user they can test with:
claude --plugin-dir <path-to-plugin>
Step 7: Report Results
Display:
- Created directory structure
- Installation status
- How to use:
- If installed to ~/.claude/plugins/: "Restart Claude Code, then use
/plugin-name:command-name" - If marketplace registered: "Run
claude plugin install plugin-name@marketplaceto install" - For testing: "Run
claude --plugin-dir <path>to test without installing"
- If installed to ~/.claude/plugins/: "Restart Claude Code, then use
Model Selection Guidance
When generating agents, include this guidance in the template:
- opus: Deep reasoning, security analysis, architecture decisions
- sonnet: Balanced tasks, code review, moderate complexity
- haiku: Fast focused tasks, simple transformations
Best Practices
- Plugin names should be kebab-case
- Descriptions should clearly state when/why to use the plugin
- Each skill/command should do one thing well (Unix philosophy)
- Commands should have clear
argument-hintvalues - Skills need
nameanddescriptionin frontmatter
Sponsors
Details
- Marketplace
- Nokodoko/agents
- Source
- plugins/plugin_generator
- Author
- n0ko
- Category
- Development