How this skill is triggered — by the user, by Claude, or both
Slash command
/plugin-creator:create-pluginThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
帮助用户快速创建 Claude Code 插件及其组件。
帮助用户快速创建 Claude Code 插件及其组件。
/create-plugin| 类型 | 用途 | 触发方式 | 是否执行任务 |
|---|---|---|---|
| Agent | 自动执行复杂任务 | 被 Command 或用户调用 | ✅ 是 |
| Command | 提供快捷入口 | 用户输入 /命令名 | ❌ 只触发 Agent |
| Skill | 提供知识库 | 自动激活或手动调用 | ❌ 只提供信息 |
| Hook | 自动化处理 | 事件触发 | ✅ 是(脚本) |
问题:你想实现什么功能?
┌─────────────────────────────────────────────────────────────┐
│ "我想要自动执行一系列操作" │
│ → 选择 Agent │
│ 示例:自动部署、代码审查、运行测试 │
├─────────────────────────────────────────────────────────────┤
│ "我想要一个简单的命令来触发功能" │
│ → 选择 Command │
│ 示例:/deploy、/review、/test │
├─────────────────────────────────────────────────────────────┤
│ "我想要提供领域知识和最佳实践" │
│ → 选择 Skill │
│ 示例:API 设计规范、安全最佳实践、编码风格 │
├─────────────────────────────────────────────────────────────┤
│ "我想要在某些事件发生时自动执行操作" │
│ → 选择 Hook │
│ 示例:记录日志、验证输入、自动提交 │
└─────────────────────────────────────────────────────────────┘
plugin-name/
├── .claude-plugin/
│ ├── plugin.json # 必需:插件元数据
│ ├── marketplace.json # 必需:市场配置
│ └── README.md # 安装说明
├── agents/ # Agent 定义
│ └── agent-name.md
├── commands/ # Command 定义 (文件名即命令名)
│ └── command-name.md
├── skills/ # Skill 定义 (目录结构)
│ └── skill-name/
│ └── SKILL.md
├── hooks/ # Hook 定义
│ └── hook-name.md
└── rules/ # Rule 定义
└── rule-name.md
my-plugins/
├── .claude-plugin/
│ └── marketplace.json # 根目录的市场配置(必需)
├── plugins/
│ ├── plugin-a/
│ │ ├── .claude-plugin/
│ │ │ └── plugin.json # 子插件只需要 plugin.json
│ │ ├── agents/
│ │ └── commands/
│ └── plugin-b/
│ ├── .claude-plugin/
│ │ └── plugin.json
│ ├── skills/
│ └── hooks/
└── README.md
多插件 marketplace.json:
{
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
"name": "my-plugins",
"description": "插件集合描述",
"owner": { "name": "作者名" },
"plugins": [
{
"name": "plugin-a",
"source": "./plugins/plugin-a",
"description": "插件 A 描述",
"version": "1.0.0"
},
{
"name": "plugin-b",
"source": "./plugins/plugin-b",
"description": "插件 B 描述",
"version": "1.0.0"
}
]
}
| 问题 | 原因 | 解决方案 |
|---|---|---|
| Marketplace not found | marketplace.json 位置错误 | 放在根目录 .claude-plugin/ 下 |
| 插件加载失败 | source 路径错误 | 使用 ./plugins/plugin-name 格式 |
| 重复配置冲突 | 子插件有 marketplace.json | 子插件只保留 plugin.json |
| 目录层级错误 | 缺少 plugins/ 目录 | 按多插件结构创建目录 |
创建前确认:
多插件特别注意:
plugins/ 下plugin.json,无 marketplace.jsonplugins/ 前缀文件位置: agents/agent-name.md
---
name: agent-name # 必需:小写、连字符分隔
description: Agent 的简短描述 # 必需:用于选择 Agent
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] # 可选
model: opus # 可选:opus | sonnet | haiku
---
# Agent 标题
你是 [角色描述]。
## 工作流程
### 步骤 1: [步骤名称]
[具体操作说明]
### 步骤 2: [步骤名称]
[具体操作说明]
## 输出格式
[期望的输出格式示例]
可用工具:
Read - 读取文件Write - 创建文件Edit - 编辑文件Bash - 执行命令Grep - 搜索内容Glob - 查找文件Agent - 调用其他 AgentWebFetch - 获取网页WebSearch - 网络搜索AskUserQuestion - 询问用户文件位置: commands/command-name.md(文件名即命令名)
---
description: 命令的简短描述(显示在命令列表中)
---
# 命令标题
[命令的详细说明]
## 用法
/命令名 [参数]
## 功能
- 功能 1
- 功能 2
## 示例
用户: /命令名
Agent: [执行示例]
## 相关 Agent
此命令会触发 `agent-name` Agent。
重要提示:
name 字段description 字段文件位置: skills/skill-name/SKILL.md(必须是目录结构)
---
name: skill-name # 必需
description: Skill 的简短描述 # 必需
---
# Skill 标题
[Skill 的详细内容]
## When to Activate
定义何时自动激活此 Skill:
- 用户询问关于 [主题] 的问题
- 代码中包含 [特定模式]
- 正在处理 [特定类型] 的任务
## 核心概念
[详细的知识内容]
## 最佳实践
[推荐的实践方法]
## 示例
[具体示例]
重要提示:
skills/skill-name/SKILL.mdSKILL.mdWhen to Activate 帮助 Claude 理解何时使用文件位置: hooks/hook-name.md
---
name: hook-name # 必需
event: PreToolCall # 必需:触发事件
tools: ["Bash", "Write"] # 可选:监听特定工具
---
# Hook 标题
[Hook 的说明]
## 脚本
#!/bin/bash
# Hook 脚本内容
input=$(cat)
# 处理逻辑
echo "$input"
可用事件:
PreToolCall - 工具调用前PostToolCall - 工具调用后SessionStart - 会话开始SessionEnd - 会话结束Notification - 通知事件Stop - 停止请求{
"name": "plugin-name",
"version": "1.0.0",
"description": "插件描述",
"author": {
"name": "作者名",
"url": "https://github.com/author"
},
"license": "MIT",
"keywords": ["claude-code", "plugin"]
}
{
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
"name": "plugin-name",
"description": "插件描述",
"owner": { "name": "作者名" },
"plugins": [
{
"name": "plugin-name",
"source": "./",
"description": "插件描述",
"version": "1.0.0",
"author": { "name": "作者名" },
"license": "MIT",
"keywords": ["keyword1"],
"category": "workflow",
"strict": false
}
]
}
npx claudepluginhub jimloop/custom-claude-package --plugin plugin-creatorGuides developers in creating, scaffolding, validating, and publishing Claude Code plugins including directory structure, plugin.json schema, YAML frontmatter, agents, commands, skills, and marketplace deployment.
Creates Claude Code plugin directory structure with .claude-plugin/plugin.json manifest and optional components like commands, agents, skills, hooks, MCP servers, scripts. Use when building a new plugin from scratch.
Guides creation of Claude Code plugins including skills, commands, agents, hooks, MCP servers, and configuration. Use for 'create plugin', 'make skill', scaffolding structures.