贡献插件
本指南说明如何创建新插件并将其添加到 f5-sales-demo 市场。
每个插件都存放在 plugins/ 下各自独立的目录中,
并遵循以下结构:
文件夹plugins/
文件夹example-plugin/
文件夹.claude-plugin/
- plugin.json
文件夹skills/
文件夹example-skill/
- SKILL.md
文件夹references/
- reference-data.md
文件夹commands/
- example-command.md
文件夹agents/
- example-agent.md
- README.md
-
创建插件目录
Terminal window mkdir -p plugins/example-plugin/.claude-pluginmkdir -p plugins/example-plugin/skillsmkdir -p plugins/example-plugin/commands -
编写
plugin.json创建
plugins/example-plugin/.claude-plugin/plugin.json:{"name": "example-plugin","description": "What this plugin does","version": "1.0.0","author": {"name": "f5-sales-demo"},"homepage": "https://github.com/f5-sales-demo/marketplace/tree/main/plugins/example-plugin","keywords": ["relevant", "keywords"],"license": "Apache-2.0","repository": "https://github.com/f5-sales-demo/marketplace"} -
添加技能
创建
plugins/example-plugin/skills/example-skill/SKILL.md, 并包含以下 frontmatter:---name: example-skilldescription: One-line description of what this skill does---Detailed instructions for Claude when this skill activates.将所有参考数据放置在与
SKILL.md同级的references/子目录中。 -
添加命令
创建
plugins/example-plugin/commands/example-command.md:---description: What this command doesargument_hint: "[optional-args]"allowed_tools:- Read- Glob- Grep---Instructions for Claude when the user invokes this command. -
将插件添加到 marketplace.json
在
.claude-plugin/marketplace.json的plugins数组中 添加一条条目:{"name": "example-plugin","description": "What this plugin does","version": "1.0.0","author": { "name": "f5-sales-demo" },"source": "./plugins/example-plugin","category": "productivity","homepage": "https://github.com/f5-sales-demo/marketplace/tree/main/plugins/example-plugin","license": "Apache-2.0","keywords": ["relevant", "keywords"],"tags": ["searchable", "tags"],"repository": "https://github.com/f5-sales-demo/marketplace"} -
本地测试
在发布之前,通过将 Claude Code 指向本地目录来测试插件:
Terminal window claude --plugin-dir ./plugins/example-plugin验证技能是否在正确的上下文中激活,以及 命令是否产生预期输出。
- 创建一个描述新插件的 GitHub Issue
- 从
main创建功能分支 - 添加插件目录并更新
marketplace.json - 在
docs/plugins/example-plugin.mdx添加文档页面 - 开启 PR 并通过
Closes #N关联对应 Issue - 修复所有 CI 失败问题,待检查通过后合并
- 保持技能聚焦 — 一个技能应当只做好一件事
- 使用参考文件 — 将大型数据集、模式和查找表放在
references/中,而非直接内联在 SKILL.md 中 - 合理界定范围 — 尽可能通过检查未提交的变更来缩小工作集
- 按严重程度分组输出 — 使用 ERROR、WARNING 和 INFO 级别,以便用户优先处理问题
- 编写 README — 包含使用示例,以及每个技能和命令的功能说明