Skip to content

cmd: add init-plugin command for plugin scaffolding [minor-release]#14

Merged
Tanq16 merged 1 commit into
mainfrom
feat/init-plugin-command
Jul 18, 2026
Merged

cmd: add init-plugin command for plugin scaffolding [minor-release]#14
Tanq16 merged 1 commit into
mainfrom
feat/init-plugin-command

Conversation

@Tanq16

@Tanq16 Tanq16 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

What

Adds a claudex init-plugin <name> command that scaffolds a Claude Code plugin directory, so starting a new plugin doesn't mean hand-creating the tree and remembering the manifest shape.

Running claudex init-plugin my-plugin creates ./my-plugin/:

my-plugin/
├── .claude-plugin/
│   └── plugin.json      {"name": "my-plugin", "version": "0.0.1"}
├── skills/.gitkeep
├── agents/.gitkeep
├── hooks/.gitkeep
├── output-styles/.gitkeep
├── .mcp.json            {"mcpServers": {}}
├── .lsp.json            {}
└── settings.json        {}

Details

  • One required positional arg <name> (cobra.ExactArgs(1)) — becomes both the directory name and the plugin.json "name".
  • version is hardcoded to 0.0.1.
  • Empty component directories carry a .gitkeep so they survive version control; config files are written as minimal valid JSON skeletons.
  • .lsp.json is a bare {} — a standalone .lsp.json is a language→config map, so the empty form has no lspServers wrapper (unlike .mcp.json, which keeps mcpServers). Confirmed against the plugins reference.
  • Refuses to overwrite an existing ./<name> directory (exits non-zero).
  • Output goes through the utils printer, so --for-ai emits the plain [OK] path.

Verification

  • go build ./..., go vet ./..., gofmt -l all clean.
  • Exercised end-to-end: generated tree matches the layout above with 0-byte .gitkeep files and correct JSON; rerun on an existing dir refuses with exit 1; --for-ai prints the plain path.

🤖 Generated with Claude Code

Scaffold a Claude Code plugin directory from a name argument: empty
skills/agents/hooks/output-styles dirs (each with a .gitkeep), plus
.claude-plugin/plugin.json, .mcp.json, .lsp.json and settings.json
skeletons. Refuses to overwrite an existing directory.
@Tanq16
Tanq16 merged commit 0f35c0e into main Jul 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant