# 市场架构参考 (Marketplace Schema Reference)
## 市场结构
市场是一个 JSON 目录,用于实现插件的发现和分发。
**文件位置:** `.claude-plugin/marketplace.json`
## 必需字段
{
"name": "marketplace-identifier",
"owner": {
"name": "Maintainer Name",
"email": "
[email protected]"
},
"plugins": []
}
**name**: Kebab-case 格式的市场标识符
**owner**: 维护者联系信息
**plugins**: 插件条目数组
## 可选市场字段
**description**: 市场概述文本
**version**: 发布版本
**pluginRoot**: 相对插件源的基础路径
## 插件条目架构
`plugins` 数组中的每个插件条目:
**必需:**
- `name`: 插件标识符 (kebab-case,必须与 plugin.json 匹配)
- `source`: 插件来源规范
**可选:**
- `description`: 插件用途
- `version`: 插件版本 (语义化版本控制)
- `author`: 创建者信息
- `homepage`: URL
- `repository`: URL
- `license`: SPDX 标识符
- `keywords`: 搜索词数组
- `category`: 分类 (例如 "framework", "productivity")
- `tags`: 额外的发现标签
- `commands`: 命令目录路径
- `agents`: 智能体目录路径
- `hooks`: 钩子配置路径
- `mcpServers`: MCP 配置路径
## 来源规范
### 相对路径来源
{
"name": "my-plugin",
"source": "./plugins/my-plugin"
}
### GitHub 来源
{
"name": "my-plugin",
"source": {
"source": "github",
"repo": "owner/repo"
}
}
### 通用 Git 来源
{
"name": "my-plugin",
"source": {
"source": "url",
"url": "https://git.example.com/plugin.git"
}
}
## 完整示例
{
"name": "example-marketplace",
"description": "Example plugin marketplace",
"version": "1.0.0",
"owner": {
"name": "Marketplace Owner",
"email": "
[email protected]"
},
"pluginRoot": "./plugins",
"plugins": [
{
"name": "example-plugin",
"source": "./example-plugin",
"description": "Example plugin",
"version": "1.0.0",
"keywords": ["example"],
"category": "productivity"
}
]
}
## 团队分发
通过 `.claude/settings.json` 配置自动化的市场可用性:
{
"extraKnownMarketplaces": [
{
"source": {
"source": "github",
"repo": "company/marketplace"
}
}
]
}