清单里没写的字段,和写了的一样重要;但这些规则会变,以你手上的版本实测为准
第三章 第5节 你自己做插件时,plugin.json 最少只需要一个 name
ECC 的 plugin.json 也不长,四十来行。值得看的是它刻意没写的那几个字段,每一个没写,背后都是一次踩坑
另一个收获:我拿最新的 Claude Code 把 ECC 记录的这些坑实测了一遍,有一半已经不成立了
一、完整的 plugin.json

.claude-plugin/plugin.json(省略了 keywords,description 有删节):
json
{
"name": "ecc",
"version": "2.2.3",
"description": "Harness-native ECC plugin for engineering teams - 71 agents, 302 skills, ...",
"author": { "name": "Affaan Mustafa", "url": "https://x.com/affaanmustafa" },
"homepage": "https://ecc.tools",
"repository": "https://github.com/affaan-m/ECC",
"license": "MIT",
"userConfig": {
"hooks_enabled": {
"type": "boolean",
"title": "Enable ECC hooks",
"description": "Run ECC's local lifecycle, quality, and safety automation. ...",
"default": true
},
"hook_profile": {
"type": "string",
"title": "ECC hook profile",
"description": "Choose minimal, standard, or strict. Invalid values safely fall back to standard.",
"default": "standard"
}
},
"mcpServers": {},
"skills": ["./skills/"],
"commands": ["./commands/"]
}逐个看关键字段:
| 字段 | 值 | 说明 |
|---|---|---|
name |
ecc |
插件名,也是命名空间:Skill 调用是 /ecc:xxx,子代理是 ecc:planner |
version |
2.2.3 |
版本号,下面的实测会讲它到底是不是必填 |
userConfig |
两个开关 | 让用户选要不要开 Hook、开到哪一档,第四部分讲 |
mcpServers |
{} |
空对象,刻意留空,第三部分讲 |
skills / commands |
["./skills/"] |
写成数组,ECC 认为只有一项也不能写成字符串 |
再看少了什么:没有 agents,也没有 hooks。可 ECC 明明有 71 个子代理和一整套 Hook
二、没写的字段:agents 和 hooks

原因是 Claude Code 按约定自动发现它们
- 插件根目录的
agents/下的.md,自动注册成子代理 - 插件根目录的
hooks/hooks.json,自动加载
东西放对位置,就不用在清单里再声明。你的 my-plugin 也没写这两个字段,照样能用
ECC 在 hooks 这个字段上来回翻车了好几次。仓库里有一份文档 .claude-plugin/PLUGIN_SCHEMA_NOTES.md 记录了这段历史:
| 提交 | 动作 | 起因 |
|---|---|---|
22ad036 |
加上 hooks | 用户反馈 Hook 没加载 |
a7bc5f2 |
删掉 hooks | 用户反馈 Hook 重复 |
779085e |
又加上 | 用户反馈 agents 没加载 |
e3a1306 |
又删掉 | 用户反馈 Hook 重复 |