关于 plugin-creator
plugin-creator 是用于搭建 cave 插件的技能,面向创建并发布插件的开发者。它依据清单规范生成插件目录、能力占位文件和 README,并包含发布步骤。
主要功能
- 01按规范创建插件清单
- 02按需生成能力目录和占位文件
- 03支持命令、技能、Agent、主题、钩子及 MCP 标记
- 04生成带安装说明的 README
- 05提供市场发布步骤
适用场景
- 01为 cave 插件创建初始目录结构
- 02搭建包含命令或钩子的插件
- 03准备提交到插件市场的清单
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ juliusbrussee/ caveman-code --skill plugin-creator安装后在 Claude Code 中输入/plugin-creator确认已加载。
详细介绍
插件创建器
你可以通过脚手架搭建新的 cave 插件。cave 插件是一个发布在 GitHub(或任何 zip URL)上的目录,其中包含 .cave-plugin/plugin.json 清单,以及可选的 commands、skills、agents、themes 和 hooks 子目录。
清单架构
{
"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": []
}
}
字段规则
name:使用 kebab-case,只能包含 a-z、0-9 和连字符。在市场中必须唯一。version:semver(“major.minor.patch”)。description:一句话,纯文本。tags:用于匹配caveman plugin search的自由格式字符串。capabilities.commands:如果存在commands/目录,则设为true。capabilities.skills:如果存在skills/目录,则设为true。capabilities.agents:如果存在agents/目录,则设为true。capabilities.themes:如果存在themes/目录,则设为true。capabilities.mcp:如果存在.mcp.json,则设为true。capabilities.hooks:hook 条目数组(见下文)。
Hook 条目格式
{ "event": "PostToolUse", "command": "hooks/post-tool-use.sh", "matcher": "Bash" }
目录结构
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
脚手架搭建步骤
当用户要求创建插件时,请遵循以下步骤:
- 询问插件详情(名称、描述、需要哪些功能)。
- 使用上述架构创建
.cave-plugin/plugin.json。 - 仅创建需要的子目录(不要创建空目录)。
- 为每项已启用的功能添加占位文件:
commands/example.md,包含 frontmatter---\ndescription: Example command.\n---\n\n# Example\n\nDescribe what this command does.\nskills/example/SKILL.md,包含标准 skill frontmatter。agents/example.md,包含 agent frontmatter。hooks/example.sh,包含#!/bin/bash\n# Hook: <event>\n,并运行chmod +x。
- 创建
README.md,写入安装说明和简短描述。 - 验证清单:回显清单,并检查所有必填字段。
发布
搭建脚手架后,告知用户:
- 将插件推送到公开的 GitHub 仓库。
- 在
marketplace.json中添加条目,将其提交到市场:{ "plugins": [ { "ref": "your-handle/my-plugin", "name": "my-plugin", "description": "...", "tags": ["..."], "version": "0.1.0" } ] } - 用户使用以下命令安装:
caveman plugin install your-handle/my-plugin
示例交互
用户:“创建一个添加 /summarize 命令和 post-save hook 的插件。”
你:
- 创建
.cave-plugin/plugin.json,内容为"commands": true, "hooks": [{ "event": "PostToolUse", "command": "hooks/post-save.sh", "matcher": "Write" }]。 - 创建
commands/summarize.md,其中包含 summarize 斜杠命令的描述。 - 创建
hooks/post-save.sh,其中包含一个 hook 脚本存根。 - 创建
README.md。 - 报告创建的文件树。
评论
支持 Markdown