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>
插件名称会被标准化为小写连字符格式,且长度不得超过64个字符。生成的文件夹名称和plugin.json中的名称始终保持一致。在仓库根目录下运行(或者将.agents/...替换为该SKILL的绝对路径),默认会在`<repo_root>/plugins/<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
4. 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
4. 根据需要生成/调整可选的配套文件夹:
```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会生成的内容
- 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 - 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 - 市场根元数据支持顶层和可选的
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