关于 plugin-creator
用于通过脚手架创建 Codex 插件的技能,面向管理个人或团队 marketplace 的插件作者。它会生成必需的清单,也可添加可选配套目录和 marketplace 条目。
主要功能
- 01生成规范化的插件脚手架
- 02创建含架构占位值的清单
- 03添加或更新 marketplace 条目
- 04按需创建 skills、hooks、scripts 和 assets
- 05按需添加 MCP 与 app 配置文件
适用场景
- 01按 Codex 所需结构启动插件
- 02将插件加入个人 marketplace
- 03按需创建含配套目录的插件脚手架
MCP 相关
可在插件脚手架中按需创建 `.mcp.json` 文件。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ openai/ plugins --skill plugin-creator安装后在 Claude Code 中输入/plugin-creator确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
agents/openai.yamlreferences/plugin-json-spec.mdscripts/create_basic_plugin.py详细介绍
插件创建器
快速开始
- 运行脚手架脚本:
# Plugin names are normalized to lower-case hyphen-case and must be <= 64 chars.
# The generated folder and plugin.json name are always the same.
# Run from repo root (or replace .agents/... with the absolute path to this SKILL).
# By default creates in ~/plugins/<plugin-name>.
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py <plugin-name>
-
打开
<plugin-path>/.codex-plugin/plugin.json,并替换[TODO: ...]占位符。 -
当插件需要出现在 Codex UI 排序中时,生成或更新个人市场条目:
# Personal marketplace entries default to ~/.agents/plugins/marketplace.json.
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin --with-marketplace
如果当前 Git 仓库已有 .agents/plugins/marketplace.json,且用户尚未说明插件是个人使用还是与团队共享,请在生成市场条目前先询问。
如果用户选择仓库市场,请使用:
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin \
--path ./plugins \
--marketplace-path ./.agents/plugins/marketplace.json \
--with-marketplace
- 根据需要生成或调整可选的配套文件夹:
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin \
--path <parent-plugin-directory> \
--marketplace-path <marketplace-json-path> \
--with-skills --with-hooks --with-scripts --with-assets --with-mcp --with-apps --with-marketplace
<parent-plugin-directory> 是用于创建插件文件夹 <plugin-name> 的目录(例如 ~/code/plugins)。
此技能会创建的内容
- 默认由市场提供支持的脚手架为个人用途:
~/plugins/<plugin-name>/以及~/.agents/plugins/marketplace.json。 - 如果当前 Git 仓库已有
.agents/plugins/marketplace.json,且用户尚未说明是个人用途还是团队用途,请在生成市场条目前询问要更新哪个市场。 - 在
/<parent-plugin-directory>/<plugin-name>/创建插件根目录。 - 始终创建
/<parent-plugin-directory>/<plugin-name>/.codex-plugin/plugin.json。 - 填充清单,包含完整的架构结构、占位值以及完整的
interface部分。 - 设置
--with-marketplace时,创建或更新所选市场。- 如果市场文件尚不存在,则在添加第一个插件条目前,填入顶层
name和interface.displayName占位符。
- 如果市场文件尚不存在,则在添加第一个插件条目前,填入顶层
<plugin-name>将按照 skill-creator 命名规则进行规范化:My Plugin→my-pluginMy--Plugin→my-plugin- 下划线、空格和标点符号会转换为
- - 结果为小写,并以连字符分隔,连续的连字符会合并
- 支持按需创建:
skills/hooks/scripts/assets/.mcp.json.app.json
市场工作流
- 个人插件使用
~/.agents/plugins/marketplace.json。 - 仓库/团队插件使用
<repo-root>/.agents/plugins/marketplace.json。 - 市场根元数据支持顶层
name,以及可选的interface.displayName。 - 将
plugins[]中的插件顺序视为 Codex 中的显示顺序。除非用户明确要求重新排序,否则将新条目追加到末尾。 displayName应放在市场的interface对象中,而不是单个plugins[]条目中。- 每个生成的市场条目都必须包含以下各项:
policy.installationpolicy.authenticationcategory
- 新条目的默认值为:
policy.installation: "AVAILABLE"policy.authentication: "ON_INSTALL"
- 仅当用户明确指定其他允许值时,才覆盖默认值。
- 允许的
policy.installation值:NOT_AVAILABLEAVAILABLEINSTALLED_BY_DEFAULT
- 允许的
policy.authentication值:ON_INSTALLON_USE
- 将
policy.products视为覆盖项。除非用户明确要求限制产品,否则省略此项。 - 生成的插件条目结构如下:
{
"name": "plugin-name",
"source": {
"source": "local",
"path": "./plugins/plugin-name"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}
-
仅当有意替换同名插件的现有市场条目时,才使用
--force。 -
如果所选市场文件尚不存在,则创建该文件,其中包含顶层
"name"、带有"displayName"的"interface"对象以及plugins数组,然后添加新条目。 -
对于全新的市场文件,根对象应如下所示:
{
"name": "[TODO: marketplace-name]",
"interface": {
"displayName": "[TODO: Marketplace Display Name]"
},
"plugins": [
{
"name": "plugin-name",
"source": {
"source": "local",
"path": "./plugins/plugin-name"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}
]
}
必需行为
- 外层文件夹名称与
plugin.json中的"name"始终使用相同的规范化插件名称。 - 不要删除必需结构;保留
.codex-plugin/plugin.json。 - 将清单值保留为占位符,直到人工或后续步骤明确填写。
- 如果在现有插件路径中创建文件,仅在有意覆盖时使用
--force。 - 保留任何现有市场条目的
interface.displayName。 - 生成市场条目时,始终写入
policy.installation、policy.authentication和category,即使其值为默认值。 - 仅当用户明确要求覆盖时,才添加
policy.products。 - 将市场条目的
source.path保持为相对于所选市场根目录的路径:./plugins/<plugin-name>。 - 如果此工作流创建或更新了一个关联市场的插件,请在最终面向用户的回复末尾添加一段简短的 Codex 应用交接说明。写上
To view this in the Codex app:,并将View <normalized plugin name>和Share <normalized plugin name>写为 Markdown 链接,不要使用原始 URL 或代码跨度。 - View 深层链接使用
codex://plugins/<normalized plugin name>?marketplacePath=<absolute marketplace.json path>。 Share 深层链接使用相同的 URL,并附加&mode=share。 - 将占位符替换为实际规范化插件名称和从搭建的插件获取的绝对
marketplace.json路径。必要时对路径段和查询值进行 URL 编码。 - 不要在这些深层链接中添加
pluginName或hostId查询参数。用户点击链接后,Codex 会自动推导这两项。 - 如果未创建或更新市场条目,不要输出
View <normalized plugin name>或Share <normalized plugin name>链接。
精确规范示例的参考
如需查看插件清单和市场条目的规范 JSON 示例,请使用:
references/plugin-json-spec.md
验证
编辑 SKILL.md 后,运行:
python3 <path-to-skill-creator>/scripts/quick_validate.py .agents/skills/plugin-creator
评论
支持 Markdown