Plugin Creator
You scaffold new cave plugins. A cave plugin is a directory published to GitHub (or any zip URL) with a .cave-plugin/plugin.json manifest and optional sub-directories for commands, skills, agents, themes, and hooks.
Manifest Schema
{
"name": "my-plugin",
"version": "0.1.0",
"description": "A short, clear description of what this plugin does.",
"author": "your-github-handle",
"license": "MIT",
"homepage": "https://github.com/your-handle/my-plugin",
"caveVersion": ">=0.65.0",
"tags": ["productivity", "git"],
"capabilities": {
"commands": true,
"skills": true,
"agents": false,
"themes": false,
"mcp": false,
"hooks": []
}
}
Field Rules
name: kebab-case, a-z0-9 and hyphens only. Must be unique in the marketplace.
version: semver ("major.minor.patch").
description: one sentence, plain text.
tags: free-form strings for caveman plugin search matching.
capabilities.commands: set true if commands/ directory is present.
capabilities.skills: set true if skills/ directory is present.
capabilities.agents: set true if agents/ directory is present.
capabilities.themes: set true if themes/ directory is present.
capabilities.mcp: set true if .mcp.json is present.
capabilities.hooks: array of hook entries (see below).
Hook Entry Shape
{ "event": "PostToolUse", "command": "hooks/post-tool-use.sh", "matcher": "Bash" }
Directory Structure
my-plugin/
├── .cave-plugin/
│ └── plugin.json ← required
├── commands/
│ └── my-command.md ← markdown slash commands
├── skills/
│ └── my-skill/
│ └── SKILL.md ← skill with frontmatter
├── agents/
│ └── my-agent.md ← agent definition markdown
├── themes/
│ └── my-theme.json ← theme JSON (cave theme format)
├── hooks/
│ └── post-tool-use.sh ← hook scripts (chmod +x)
├── .mcp.json ← optional MCP server definitions
└── README.md
Scaffolding Steps
When the user asks to create a plugin, follow these steps:
- Ask for plugin details (name, description, which capabilities are needed).
- Create
.cave-plugin/plugin.json using the schema above.
- Create only the sub-directories that are needed (do not create empty dirs).
- Add placeholder files for each enabled capability:
commands/example.md with frontmatter ---\ndescription: Example command.\n---\n\n# Example\n\nDescribe what this command does.\n
skills/example/SKILL.md with the standard skill frontmatter.
agents/example.md with agent frontmatter.
hooks/example.sh with #!/bin/bash\n# Hook: <event>\n and chmod +x.
- Create a
README.md with install instructions and a short description.
- Validate the manifest by echoing it back and checking all required fields.
Publishing
After scaffolding, instruct the user to:
- Push the plugin to a public GitHub repository.
- Submit it to a marketplace by adding an entry to a
marketplace.json:{
"plugins": [
{
"ref": "your-handle/my-plugin",
"name": "my-plugin",
"description": "...",
"tags": ["..."],
"version": "0.1.0"
}
]
}
- Users install it with:
caveman plugin install your-handle/my-plugin
Example Interaction
User: "Create a plugin that adds a /summarize command and a post-save hook."
You:
- Create
.cave-plugin/plugin.json with "commands": true, "hooks": [{ "event": "PostToolUse", "command": "hooks/post-save.sh", "matcher": "Write" }].
- Create
commands/summarize.md with a summarize slash command description.
- Create
hooks/post-save.sh with a stub hook script.
- Create
README.md.
- Report the file tree created.
1---2name: plugin-creator3description: Scaffold a complete cave plugin bundle — generates .cave-plugin/plugin.json manifest and the standard directory structure (commands/, skills/, agents/, themes/, hooks/). Use when a user wants to create, publish, or package a cave plugin for the marketplace. Triggered by "create a plugin", "scaffold a plugin", "/plugin create", or "new cave plugin".4---56# Plugin Creator78You scaffold new cave plugins. A cave plugin is a directory published to GitHub (or any zip URL) with a `.cave-plugin/plugin.json` manifest and optional sub-directories for commands, skills, agents, themes, and hooks.910## Manifest Schema1112```json13{14 "name": "my-plugin",15 "version": "0.1.0",16 "description": "A short, clear description of what this plugin does.",17 "author": "your-github-handle",18 "license": "MIT",19 "homepage": "https://github.com/your-handle/my-plugin",20 "caveVersion": ">=0.65.0",21 "tags": ["productivity", "git"],22 "capabilities": {23 "commands": true,24 "skills": true,25 "agents": false,26 "themes": false,27 "mcp": false,28 "hooks": []29 }30}31```3233### Field Rules3435- `name`: kebab-case, a-z0-9 and hyphens only. Must be unique in the marketplace.36- `version`: semver ("major.minor.patch").37- `description`: one sentence, plain text.38- `tags`: free-form strings for `caveman plugin search` matching.39- `capabilities.commands`: set `true` if `commands/` directory is present.40- `capabilities.skills`: set `true` if `skills/` directory is present.41- `capabilities.agents`: set `true` if `agents/` directory is present.42- `capabilities.themes`: set `true` if `themes/` directory is present.43- `capabilities.mcp`: set `true` if `.mcp.json` is present.44- `capabilities.hooks`: array of hook entries (see below).4546### Hook Entry Shape4748```json49{ "event": "PostToolUse", "command": "hooks/post-tool-use.sh", "matcher": "Bash" }50```5152## Directory Structure5354```55my-plugin/56├── .cave-plugin/57│ └── plugin.json ← required58├── commands/59│ └── my-command.md ← markdown slash commands60├── skills/61│ └── my-skill/62│ └── SKILL.md ← skill with frontmatter63├── agents/64│ └── my-agent.md ← agent definition markdown65├── themes/66│ └── my-theme.json ← theme JSON (cave theme format)67├── hooks/68│ └── post-tool-use.sh ← hook scripts (chmod +x)69├── .mcp.json ← optional MCP server definitions70└── README.md71```7273## Scaffolding Steps7475When the user asks to create a plugin, follow these steps:76771. **Ask for plugin details** (name, description, which capabilities are needed).782. **Create `.cave-plugin/plugin.json`** using the schema above.793. **Create only the sub-directories that are needed** (do not create empty dirs).804. **Add placeholder files** for each enabled capability:81 - `commands/example.md` with frontmatter `---\ndescription: Example command.\n---\n\n# Example\n\nDescribe what this command does.\n`82 - `skills/example/SKILL.md` with the standard skill frontmatter.83 - `agents/example.md` with agent frontmatter.84 - `hooks/example.sh` with `#!/bin/bash\n# Hook: <event>\n` and `chmod +x`.855. **Create a `README.md`** with install instructions and a short description.866. **Validate the manifest** by echoing it back and checking all required fields.8788## Publishing8990After scaffolding, instruct the user to:91921. Push the plugin to a public GitHub repository.932. Submit it to a marketplace by adding an entry to a `marketplace.json`:94 ```json95 {96 "plugins": [97 {98 "ref": "your-handle/my-plugin",99 "name": "my-plugin",100 "description": "...",101 "tags": ["..."],102 "version": "0.1.0"103 }104 ]105 }106 ```1073. Users install it with: `caveman plugin install your-handle/my-plugin`108109## Example Interaction110111User: "Create a plugin that adds a /summarize command and a post-save hook."112113You:1141. Create `.cave-plugin/plugin.json` with `"commands": true, "hooks": [{ "event": "PostToolUse", "command": "hooks/post-save.sh", "matcher": "Write" }]`.1152. Create `commands/summarize.md` with a summarize slash command description.1163. Create `hooks/post-save.sh` with a stub hook script.1174. Create `README.md`.1185. Report the file tree created.