把本地 skill 注册到 Claude Code Plugin 的完整流程

前提:了解 local-skills marketplace

Claude Code 通过 known_marketplaces.json 管理 marketplace。本地目录类型的

marketplace 结构:

/Users/你的名字/code/skills/ ← marketplace 根目录

├── .claude-plugin/

│ └── marketplace.json ← marketplace 索引(必须)

├── badcase-analyzer/ ← 每个插件一个目录

│ ├── SKILL.md

│ └── scripts/

└── 你的新插件/

├── SKILL.md

└── scripts/


步骤一:在插件目录下创建 SKILL.md 和 scripts

SKILL.md 格式:


name: 插件名

description: 描述(触发条件写清楚)


插件标题

...


步骤二:在 marketplace.json 中注册插件

编辑 /Users/10010906/code/skills/.claude-plugin/marketplace.json,在 plugins

数组里加一条:

{

"name": "你的插件名",

"description": "简短描述",

"category": "productivity",

"source": "./你的插件目录名"

}


步骤三:在 settings.json 中启用插件

编辑 ~/.claude/settings.json,在 enabledPlugins 里加:

"你的插件名@local-skills": true


步骤四:在 installed_plugins.json 中添加安装记录

编辑 ~/.claude/plugins/installed_plugins.json,加一条:

"你的插件名@local-skills": [

{

"scope": "user",

"installPath":

"/Users/10010906/.claude/plugins/cache/local-skills/你的插件名/unknown",

"version": "unknown",

"installedAt": "2026-04-29T00:00:00.000Z",

"lastUpdated": "2026-04-29T00:00:00.000Z"

}

]

同时把插件文件复制到 cache 目录:

cp -r /Users/10010906/code/skills/你的插件名 \

~/.claude/plugins/cache/local-skills/你的插件名/unknown


步骤五:运行 /reload-plugins

验证 plugin 数量是否增加,查看 /plugin 列表。


三个关键点(血泪教训):

  1. marketplace.json 必须有插件条目,否则报 "not found in marketplace"

  2. settings.json 的 enabledPlugins 必须设为 true,这是真正的开关

  3. installed_plugins.json 提供安装记录,缺少则不显示

相关推荐
推理幻觉1 天前
Claude Code 常用命令
人工智能·开发工具·cc·claude code
F_D_Z1 天前
【清晰教程】Claude Code 安装教程
claude code
Uncertainty!!1 天前
claude code中添加skills自动生成git commit信息
git·git commit·claude code
Uncertainty!!2 天前
GitNexus安装过程记录:Code Graph RAG 并联动 Claude Code
mcp·claude code·gitnexus
zjeweler2 天前
云服务器部署 Claude Code 实战指南
运维·服务器·claude code
Orange_sparkle2 天前
superpowers、gstack、gsd原理解析与对比
ai·claude code
New_Horizons6663 天前
Claude Code的安装和使用(Win10)
大模型·claude code
维元码簿3 天前
Claude Code 深度拆解:工具系统——运行时流水线与并发调度
ai·agent·claude code·ai coding
ameyume3 天前
AI大模型ClaudeCode CLI全平台安装指南
claudecode·claude code