插件脚手架与市场清单的生成规范
该技能说明如何用脚手架脚本创建插件目录,并区分仓库本地与主目录本地两种插件位置,同时规定插件清单与市场清单的固定路径和命名规则。
# 插件创建者 ## 快速启动 1. 运行脚手架脚本 : ```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). # By default creates in <repo_root>/plugins/<plugin-name>. python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py <plugin-name> ``` 2. 打开 `<plugin-path>/.codex-plugin/plugin.json` 替换 `[TODO: ...]` 占位符 。 3. 当插件出现在 Codex UI 命令中时, 生成或更新 repo 市场条目 : ```bash # 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 ``` 对于家用本地插件,请处理 `<home>` 作为根和使用: ```bash python3 .agents/skills/plugin-creator/scripts/create_basic_plugin.py my-plugin \ --path ~/plugins \ --marketplace-path ~/.agents/plugins/marketplace.json \ --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/plugins`). ## 这种技能创造了什么 - 如果用户未将插件位置明确,请询问在生成市场条目之前,他们是否想要一个repo本地插件或家用本地插件 。 - 创建插件根于 `/<parent-plugin-directory>/<plugin-name>/`. - 总是创建 `/<parent-plugin-directory>/<plugin-name>/.codex-plugin/plugin.json`. - 用完整的图案形状、占位符值和完整填充表单 `interface` 节。 - 创建或更新 `<repo-root>/.agents/plugins/marketplace.json` 何时 `--with-marketplace` 已经设定。 - 如果市场文件尚未存在, 种子顶级 `name` 加号 `interface.displayName` 在添加第一个插件条目之前,占位符 。 - `<plugin-name>` 使用技能生成器命名规则实现常态化: - `My Plugin` → `my-plugin` - `My--Plugin` → `my-plugin` - 下划线、空格和插点转换为 `-` - 结果是小写连字符限制, 连字符连续崩溃 - 支持可选创建: - `skills/` - `hooks/` - `scripts/` - `assets/` - `.mcp.json` - `.app.json` ## 采购网工作流程 - `marketplace.json` 总是住在... `<repo-root>/.agents/plugins/marketplace.json`. - 对于家用本地插件,请使用与 `<home>` 作为根 : `~/.agents/plugins/marketplace.json` 加号 `./plugins/<plugin-name>`. - 采购站根元数据支持顶级 `name` 加可选 `interface.displayName`. - 处理插件顺序 : `plugins[]` 。添加新条目,除非用户明确要求重排列表的顺序。 - `displayName` 属于市场内部 `interface` 对象,而非个人 `plugins[]` 条目。 - 每个产生的市场进入必须包括所有: - `policy.installation` - `policy.authentication` - `category` - 默认新条目为: - `policy.installation: "AVAILABLE"` - `policy.authentication: "ON_INSTALL"` - 仅当用户明确指定了另一个允许的值时,即为覆盖默认值. - 允许 `policy.installation` 数值 : - `NOT_AVAILABLE` - `AVAILABLE` - `INSTALLED_BY_DEFAULT` - 允许 `policy.authentication` 数值 : - `ON_INSTALL` - `ON_USE` - 处理 `policy.products` 关闭它,除非用户明确要求产品显示。 - 生成的插件条目形状是 : ```json { "name": "plugin-name", "source": { "source": "local", "path": "./plugins/plugin-name" }, "policy": { "installation": "AVAILABLE", "authentication": "ON_INSTALL" }, "category": "Productivity" } ``` - 使用( U) `--force` 仅当有意替换同一插件名称的现有市场条目时。 - 若为: `<repo-root>/.agents/plugins/marketplace.json` 尚未存在, 请用顶级创建它 `"name"`,一个 `"interface"` 包含对象 `"displayName"`和 a 键 `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" } ] } ``` ## 要求的行为 - 外部文件夹名称和 `plugin.json` `"name"` 总是相同的常态插件名称。 - 不删除所需的结构; 保留 `.codex-plugin/plugin.json` 现在。 - 保留作为占位符的显性值,直到人类或后续步骤明确填补它们. - 如果在现有插件路径内创建文件,则使用 `--force` 只有在覆盖是故意的。 - 保护任何现有市场 `interface.displayName`. - 生成市场条目时, 总是写 `policy.installation`, `policy.authentication`,以及 `category` 即使它们的值是默认值。 - 添加 `policy.products` 只有在用户明确要求该覆盖时。 - 保持市场 `source.path` 相对于 repo 根为 `./plugins/<plugin-name>`. ## 精确光谱样本参考 用于插件清单和市场条目的精确犬类样本JSON,使用: - `references/plugin-json-spec.md` ## 验证 编辑后 `SKILL.md`,运行 : ```bash python3 <path-to-skill-creator>/scripts/quick_validate.py .agents/skills/plugin-creator ```
查看原始来源