主题
Plugins 插件市场
Claude Code 自带插件系统 —— 打包 Skills + Hooks + Commands + Agents + MCP 一键安装。任何公开 GitHub repo 都能当成插件市场。
跟单独安装 Skills 的区别
- 单独 Skill:手动 clone 到
~/.claude/skills/ - Plugin:从市场一键
/plugin install,自动包含 skills+hooks+commands 等多种资源
添加官方市场
/plugin marketplace add anthropics/claude-codeClaude Code 拉取 anthropics/claude-code 仓库下的 .claude-plugin/marketplace.json,列出可用插件。
浏览 + 安装
/plugin # 列出所有已注册市场的插件
/plugin install <name>
/plugin uninstall <name>
/plugin list # 已装的
/plugin update # 升级所有自建插件市场
任何 公开 GitHub repo + 一个 .claude-plugin/marketplace.json 就是合法市场。
市场文件结构
my-marketplace/
├── .claude-plugin/
│ └── marketplace.json ← 必需
└── plugins/
├── commit-commands/
│ ├── plugin.json
│ ├── commands/
│ │ ├── commit.md
│ │ └── pr.md
│ └── skills/
│ └── conventional-commits/
│ └── SKILL.md
└── code-review/
└── ...marketplace.json 示例
json
{
"name": "My Plugin Marketplace",
"description": "Personal collection of Claude Code plugins",
"version": "1.0.0",
"plugins": [
{
"name": "commit-commands",
"description": "Conventional commit + PR automation",
"version": "1.2.0",
"path": "plugins/commit-commands"
},
{
"name": "code-review",
"description": "Multi-dimension code review automation",
"version": "0.5.0",
"path": "plugins/code-review"
}
]
}plugin.json(单个插件)
json
{
"name": "commit-commands",
"version": "1.2.0",
"description": "Git commit and PR automation",
"author": "your-name",
"license": "MIT",
"components": {
"commands": ["commands/commit.md", "commands/pr.md"],
"skills": ["skills/conventional-commits"],
"hooks": [],
"agents": []
}
}用户怎么用你的市场
/plugin marketplace add your-username/my-marketplace
/plugin install commit-commands完成后 /commit 和 /pr 命令立刻可用。
推荐的社区市场
中文友好
| 市场 | 内容 |
|---|---|
| DennisLiuCk/claude-plugin-marketplace | 繁体中文,开发/生产力/安全/学习 |
| panw3i/claude-plugins | 代码审查、文档生成、质量检查、commit |
| xiaolai/claude-plugin-marketplace | xiaolai 维护的精选集 |
| xyzbit/claude-plugins | 日常工作高频插件 |
英文/全球
| 市场 | 特色 |
|---|---|
| anthropics/claude-code | 官方市场 |
| LostAbaddon/CCMarketplace | 自建市场样板 |
| dvlin-dev/claude-code-marketplace | 中英双语 |
实战推荐:3 个必装
1. commit-commands
/plugin marketplace add DennisLiuCk/claude-plugin-marketplace
/plugin install commit-commands之后:
/commit— 自动按 conventional commit 格式生成提交消息/pr— 自动写 PR 描述
2. code-review
类似上面,提供完整的多维度代码审查 skill + 自动调用 subagent。
3. project-init
新项目快速生成 CLAUDE.md / .gitignore / 测试框架。
插件 vs 单独 Skills/Commands
| Plugin | 单独安装 | |
|---|---|---|
| 安装 | /plugin install | 手动 clone |
| 更新 | /plugin update | 手动 git pull |
| 卸载 | /plugin uninstall | 手动 rm |
| 含资源 | Skills + Hooks + Commands + Agents | 单一类型 |
| 版本管理 | ✅ | ❌ |
| 适合 | 正式发布给他人用 | 个人 / 实验 |
安全提醒
插件里有 Hooks = 任意 shell 命令
插件可能包含 hooks —— 会在你机器上跑 shell 命令。
安装陌生插件前必看:
- 该 plugin 的
hooks字段下有什么脚本 - 脚本里的
command字段是什么 - 有没有可疑的
curl | bash或rm -rf
只装可信来源:
- 官方
anthropics/claude-code - 知名社区维护者
- 看 stars 数和 last commit 时间
调试
/plugin debug <name> # 看插件加载日志
/plugin info <name> # 看插件详细信息(包含哪些 skills/hooks/commands)
/plugin doctor # 诊断所有已装插件健康度发布你自己的插件
- 创建 GitHub repo
- 加
.claude-plugin/marketplace.json - 加 plugins 目录 + plugin.json
- push 到 GitHub
- 让别人
/plugin marketplace add your-username/your-repo
无需注册 / 审批 / 上架,100% 去中心化。
