貢獻插件
本指南說明如何建立新插件並將其加入 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確認技能是否在正確的情境下啟動,以及 命令是否產生預期的輸出結果。
提交您的插件
Section titled “提交您的插件”- 建立 GitHub Issue,說明新插件的內容
- 從
main建立功能分支 - 新增您的插件目錄並更新
marketplace.json - 在
docs/plugins/example-plugin.mdx新增說明文件頁面 - 開啟 PR 並以
Closes #N連結至對應的 Issue - 修正所有 CI 失敗項目,並在檢查通過後合併
- 保持技能專一 — 每個技能應只負責一件事
- 善用參考檔案 — 將大型資料集、結構描述和
查找表放入
references/,而非直接內嵌於 SKILL.md 中 - 合理縮小範圍 — 盡可能透過檢查未提交的變更來 縮小工作範圍
- 依嚴重程度分組輸出 — 使用 ERROR、WARNING 和 INFO 等級,讓使用者能夠優先處理問題
- 撰寫 README — 包含使用範例,並說明每個技能和命令的功能