plugin-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlugin Creator
插件创建工具
Quick Start
快速开始
- Run the scaffold script:
bash
# 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.- 运行脚手架脚本:
bash
# 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).
Run from repo root (or replace .agents/... with the absolute path to this SKILL).
By default creates in <repo_root>/plugins/<plugin-name>.
By default creates in <repo_root>/plugins/<plugin-name>.
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py <plugin-name>
2. Open `<plugin-path>/.codex-plugin/plugin.json` and replace `[TODO: ...]` placeholders.
3. Generate or update the repo marketplace entry when the plugin should appear in Codex UI ordering:
```bashpython3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py <plugin-name>
2. 打开 `<plugin-path>/.codex-plugin/plugin.json` 并替换所有`[TODO: ...]`占位符。
3. 当插件需要展示在Codex UI的排序列表中时,生成或更新仓库的插件市场条目:
```bashmarketplace.json always lives at <repo-root>/.agents/plugins/marketplace.json
marketplace.json always lives at <repo-root>/.agents/plugins/marketplace.json
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin --with-marketplace
For a home-local plugin, treat `<home>` as the root and use:
```bash
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin \
--path ~/plugins \
--marketplace-path ~/.agents/plugins/marketplace.json \
--with-marketplace- Generate/adjust optional companion folders as needed:
bash
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin --path <parent-plugin-directory> \
--with-skills --with-hooks --with-scripts --with-assets --with-mcp --with-apps --with-marketplace<parent-plugin-directory><plugin-name>~/code/pluginspython3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin --with-marketplace
如果是用户本地目录下的插件,将`<home>`作为根目录,使用以下命令:
```bash
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin \
--path ~/plugins \
--marketplace-path ~/.agents/plugins/marketplace.json \
--with-marketplace- 根据需要生成/调整可选的配套文件夹:
bash
python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin --path <parent-plugin-directory> \
--with-skills --with-hooks --with-scripts --with-assets --with-mcp --with-apps --with-marketplace<parent-plugin-directory><plugin-name>~/code/pluginsWhat this skill creates
本SKILL会生成的内容
- If the user has not made the plugin location explicit, ask whether they want a repo-local plugin or a home-local plugin before generating marketplace entries.
- Creates plugin root at .
/<parent-plugin-directory>/<plugin-name>/ - Always creates .
/<parent-plugin-directory>/<plugin-name>/.codex-plugin/plugin.json - Fills the manifest with the full schema shape, placeholder values, and the complete section.
interface - Creates or updates when
<repo-root>/.agents/plugins/marketplace.jsonis set.--with-marketplace- If the marketplace file does not exist yet, seed top-level plus
nameplaceholders before adding the first plugin entry.interface.displayName
- If the marketplace file does not exist yet, seed top-level
- is normalized using skill-creator naming rules:
<plugin-name>- →
My Pluginmy-plugin - →
My--Pluginmy-plugin - underscores, spaces, and punctuation are converted to
- - result is lower-case hyphen-delimited with consecutive hyphens collapsed
- Supports optional creation of:
skills/hooks/scripts/assets/.mcp.json.app.json
- 如果用户没有明确指定插件位置,在生成市场条目之前,先询问用户需要仓库本地插件还是用户目录本地插件。
- 在路径下创建插件根目录。
/<parent-plugin-directory>/<plugin-name>/ - 始终会创建文件。
/<parent-plugin-directory>/<plugin-name>/.codex-plugin/plugin.json - 为清单文件填充完整的schema结构、占位符值和完整的部分。
interface - 当设置参数时,创建或更新
--with-marketplace。<repo-root>/.agents/plugins/marketplace.json- 如果市场文件尚不存在,在添加第一个插件条目之前,先初始化顶层和
name占位符。interface.displayName
- 如果市场文件尚不存在,在添加第一个插件条目之前,先初始化顶层
- 会按照skill-creator的命名规则进行标准化:
<plugin-name>- →
My Pluginmy-plugin - →
My--Pluginmy-plugin - 下划线、空格和标点符号都会被转换为
- - 最终结果为小写、连字符分隔的格式,连续的连字符会被合并
- 支持可选创建以下内容:
skills/hooks/scripts/assets/.mcp.json.app.json
Marketplace workflow
插件市场工作流
- always lives at
marketplace.json.<repo-root>/.agents/plugins/marketplace.json - For a home-local plugin, use the same convention with as the root:
<home>plus~/.agents/plugins/marketplace.json../plugins/<plugin-name> - Marketplace root metadata supports top-level plus optional
name.interface.displayName - Treat plugin order in as render order in Codex. Append new entries unless a user explicitly asks to reorder the list.
plugins[] - belongs inside the marketplace
displayNameobject, not individualinterfaceentries.plugins[] - Each generated marketplace entry must include all of:
policy.installationpolicy.authenticationcategory
- Default new entries to:
policy.installation: "AVAILABLE"policy.authentication: "ON_INSTALL"
- Override defaults only when the user explicitly specifies another allowed value.
- Allowed values:
policy.installationNOT_AVAILABLEAVAILABLEINSTALLED_BY_DEFAULT
- Allowed values:
policy.authenticationON_INSTALLON_USE
- Treat as an override. Omit it unless the user explicitly requests product gating.
policy.products - The generated plugin entry shape is:
json
{
"name": "plugin-name",
"source": {
"source": "local",
"path": "./plugins/plugin-name"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}-
Useonly when intentionally replacing an existing marketplace entry for the same plugin name.
--force -
Ifdoes not exist yet, create it with top-level
<repo-root>/.agents/plugins/marketplace.json, an"name"object containing"interface", and a"displayName"array, then add the new entry.plugins -
For a brand-new marketplace file, the root object should look like:
json
{
"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"
}
]
}- 始终位于
marketplace.json路径下。<repo-root>/.agents/plugins/marketplace.json - 对于用户目录本地插件,遵循相同的约定,将作为根目录:
<home>和~/.agents/plugins/marketplace.json。./plugins/<plugin-name> - 插件市场根元数据支持顶层和可选的
name。interface.displayName - 中的插件顺序即为Codex中的渲染顺序。除非用户明确要求重新排序列表,否则新条目默认追加到末尾。
plugins[] - 属于插件市场
displayName对象的属性,不属于单独的interface条目。plugins[] - 每个生成的插件市场条目必须包含以下所有字段:
policy.installationpolicy.authenticationcategory
- 新条目的默认值为:
policy.installation: "AVAILABLE"policy.authentication: "ON_INSTALL"
- 仅当用户明确指定其他允许值时,才覆盖默认值。
- 允许的值:
policy.installationNOT_AVAILABLEAVAILABLEINSTALLED_BY_DEFAULT
- 允许的值:
policy.authenticationON_INSTALLON_USE
- 为可选覆盖字段,除非用户明确要求产品权限控制,否则省略该字段。
policy.products - 生成的插件条目结构如下:
json
{
"name": "plugin-name",
"source": {
"source": "local",
"path": "./plugins/plugin-name"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}-
仅当有意替换同名插件的现有市场条目时,才使用参数。
--force -
如果尚不存在,创建该文件,包含顶层
<repo-root>/.agents/plugins/marketplace.json、包含"name"的"displayName"对象和"interface"数组,然后添加新条目。plugins -
对于全新的市场文件,根对象结构如下:
json
{
"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"
}
]
}Required behavior
要求行为
- Outer folder name and
plugin.jsonare always the same normalized plugin name."name" - Do not remove required structure; keep present.
.codex-plugin/plugin.json - Keep manifest values as placeholders until a human or follow-up step explicitly fills them.
- If creating files inside an existing plugin path, use only when overwrite is intentional.
--force - Preserve any existing marketplace .
interface.displayName - When generating marketplace entries, always write ,
policy.installation, andpolicy.authenticationeven if their values are defaults.category - Add only when the user explicitly asks for that override.
policy.products - Keep marketplace relative to repo root as
source.path../plugins/<plugin-name>
- 外层文件夹名称和中的
plugin.json字段始终使用相同的标准化插件名称。"name" - 不要删除必需的结构;始终保留文件。
.codex-plugin/plugin.json - 在人工或后续步骤明确填充之前,清单文件的值保留为占位符。
- 如果要在现有插件路径下创建文件,仅当有意覆盖时才使用参数。
--force - 保留所有已存在的市场值。
interface.displayName - 生成市场条目时,即使值为默认值,也始终写入、
policy.installation和policy.authentication字段。category - 仅当用户明确要求覆盖时,才添加字段。
policy.products - 市场文件中的保留相对于仓库根目录的路径:
source.path。./plugins/<plugin-name>
Reference to exact spec sample
精确规范示例参考
For the exact canonical sample JSON for both plugin manifests and marketplace entries, use:
references/plugin-json-spec.md
如需获取插件清单和市场条目的标准JSON示例,请参考:
references/plugin-json-spec.md
Validation
校验
After editing , run:
SKILL.mdbash
python3 <path-to-skill-creator>/scripts/quick_validate.py .agents/skills/plugin-creator编辑完后,运行:
SKILL.mdbash
python3 <path-to-skill-creator>/scripts/quick_validate.py .agents/skills/plugin-creator