Community编程与开发github.com

插件创建器

为 Codex 创建并搭建插件目录,包含必需的 `.codex-plugin/plugin.json`、可选的插件文件夹/文件、有效的清单默认值,以及默认的个人市场条目。当 Codex 需要创建新的个人插件、添加可选的插件结构、生成或更新用于插件排序和可用性元数据的市场条目,或在开发过程中通过 CLI 驱动的缓存破坏器和重新安装流程更新现有本地插件时使用。

插件创建器 是什么?

该技能(插件创建器)为 Codex 代理提供了一个高效的工作流程,用于生成、验证和更新本地插件。它的核心是一个基于 Python 脚本的脚手架工具(`scripts/create_basic_plugin.py`),该工具会创建一个包含必需 `plugin.json` 的标准化插件目录结构,并附带有效默认值,避免了手动编写清单的繁琐工作。该技能支持创建可选的功能文件夹(如 `skills/`、`hooks/`、`scripts/`、`assets/` 以及 MCP 和应用配置文件),使其能够适应各种插件架构的需要。该技能的一大重点是其与市场系统的集成:在创建插件时,可以自动在用户的家目录(默认位置 `~/.agents/plugins/marketplace.json`)或特定仓库/团队路径下生成或更新个人市场条目。这些条目具有 `policy.installation` 和 `policy.authentication` 等受控属性,确保插件在 Codex UI 中正确显示和排序。该技能还包含用于更新现有本地插件缓存破坏器(确保开发迭代期间清单正确重新加载)的专用脚本,以及一个全面的验证脚本(`scripts/validate_plugin.py`),用于在返回生成的插件之前检查其是否符合清单模式。通过使用命名规范化规则处理输入(例如“My Plugin”变为“my-plugin”)并提供丰富的命令行选项用于自定义市场路径和名称,该技能简化了从初始脚手架到持续开发的整个插件生命周期管理。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/openai/codex/tree/main/codex-rs/skills/src/assets/samples/plugin-creator

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

插件创建器 是做什么的?

快速开始

  1. 运行脚手架脚本:
# 插件名会被规范化为小写连字符格式,且长度不得超过64个字符。
# 生成的文件夹和 plugin.json 的名称始终一致。
# 从技能根目录(包含此 `SKILL.md` 的目录)运行。
# 默认在 `~/plugins/<插件名>` 下创建。
python3 scripts/create_basic_plugin.py <插件名>
  1. 当请求包含特定元数据时,编辑 <插件路径>/.codex-plugin/plugin.json。 脚手架会提供有效的默认值,且不得包含 [TODO: ...] 占位符。

  2. 当插件应出现在 Codex UI 排序中时,生成或更新个人市场条目:

# 个人市场条目默认为 `~/.agents/plugins/marketplace.json`。
python3 scripts/create_basic_plugin.py my-plugin --with-marketplace

仅在默认的 personal 市场名称已被占用或安装,且你需要创建另一个不同的新市场文件时,才指定 --marketplace-name <名称>:

python3 scripts/create_basic_plugin.py my-plugin \
  --with-marketplace \
  --marketplace-name team-local

仅在用户明确指定该目标时才使用仓库/团队市场:

python3 scripts/create_basic_plugin.py my-plugin \
  --path <仓库根目录>/plugins \
  --marketplace-path <仓库根目录>/.agents/plugins/marketplace.json \
  --with-marketplace

当用户指定了市场路径时,在告知用户从此市场重新安装前,务必确保该市场确实已安装。默认的个人市场文件 ~/.agents/plugins/marketplace.json 会被隐式发现,但其他市场路径则不会。在 Windows 上,请使用用户配置文件下的等效路径。

  1. 根据需��生成或调整可选的配套文件夹:
python3 scripts/create_basic_plugin.py my-plugin \
  --path <父插件目录> \
  --marketplace-path <市场JSON路径> \
  --with-skills --with-hooks --with-scripts --with-assets --with-mcp --with-apps --with-marketplace

<父插件目录> 是插件文件夹 <插件名> 将创建的位置(例如 ~/plugins)。

  1. 在交付生成的插件之前,执行:
python3 scripts/validate_plugin.py <插件路径>

在开发过程中更新现有本地插件时,保持脚手架流程不变,使用参考,而不要手动编辑市场文件:

python3 scripts/update_plugin_cachebuster.py <插件路径>

除非用户明确要求特定覆盖值,否则优先使用默认的缓存破坏器。有关在迭代现有本地插件时的预期缓存破坏器和重新安装流程,请参见 references/installing-and-updating.md。

该技能创建的内容

  • 默认的基于市场的脚手架使用位于 ~/.agents/plugins/marketplace.json 的个人市场文件,插件通常存储在 ~/plugins/<插件名>/。
  • 在 /<父插件目录>/<插件名>/ 创建插件根目录。
  • 始终创建 /<父插件目录>/<插件名>/.codex-plugin/plugin.json。
  • 使用引入路径接受的已验证模式填充清单。
  • 当设置了 --with-marketplace 时,创建或更新 ~/.agents/plugins/marketplace.json。
    • 如果市场文件尚不存在,则在添加第一个插件条目之前创建个人市场根目录。
  • <插件名> 使用技能创建者的命名规则进行规范化:
    • My Plugin → my-plugin
    • My--Plugin → my-plugin
    • 下划线、空格和标点符号转换为 -
    • 结果为小写连字符分隔,连续连字符被合并
  • 支持可选创建:
    • skills/
    • hooks/
    • scripts/
    • assets/
    • .mcp.json
    • .app.json

市场工作流

  • 个人市场创建默认指向 ~/.agents/plugins/marketplace.json。此处,“个人市场”指的是该路径下的市场文件。
  • 仅在用户明确请求时,通过同时使用 --path 和 --marketplace-path 来启用仓库/团队市场的创建。
  • --marketplace-name 是一个例外路径。仅当默认的 personal 市场名称已被占用,且你需要创建另一个不同的新市场文件时使用它。
  • 不要使用 --marketplace-name 来原地重命名现有的市场文件。如果文件已存在,其顶级 name 必须已匹配。
  • 如果用户指定了不同的市场路径,将该市场视为需要通过 codex plugin marketplace add 显式安装。
  • 当你需要从任何 marketplace.json 文件中获取市场名称时,优先使用 scripts/read_marketplace_name.py。不带参数时,它读取默认的个人市场;带显式路径时,它也适用于仓库/团队市场。
  • 在任一位置,生成的源路径保持为 ./plugins/<插件名>。
  • 市场根元数据支持顶级 name 以及可选的 interface.displayName。
  • 将插件在 plugins[] 中的顺序视为 Codex 中的渲染顺序。除非用户明确要求重新排序列表,否则追加新条目。
  • 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 视为覆盖项。除非用户明确要求产品门控,否则忽略它。
  • 生成的插件条目形状如下:
{
  "name": "plugin-name",
  "source": {
    "source": "local",
    "path": "./plugins/plugin-name"
  },
  "policy": {
    "installation": "AVAILABLE",
    "authentication": "ON_INSTALL"
  },
  "category": "Productivity"
}
  • 仅在有意替换现有市场中同名插件条目时使用 --force。

  • 如果目标市场文件尚不存在,则创建它,包含顶级 "name"、一个包含 "displayName" 的 "interface" 对象以及一个 plugins 数组,然后添加新条目。

  • 对于全新的市场文件,根对象应如下所示:

{
  "name": "personal",
  "interface": {
    "displayName": "Personal"
  },
  "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 存在。
  • 不要在插件清单中留下 [TODO: ...] 占位符。
  • 除非实际创建了配套文件,否则不要将 apps 和 mcpServers 放入 plugin.json。
  • 省略验证拒绝的不受支持的插件清单字段,包括 hooks。
  • 如果在现有插件路径内创建文件,仅当有意覆盖时才使用 --force。
  • 保留任何现有的市场 interface.displayName。
  • 生成市场条目时,始终写入 policy.installation、policy.authentication 和 category,即使它们的值是默认值。
  • 仅当用户明确要求该覆盖时才添加 policy.products。
  • 保持市场 source.path 相对于所选市场根目录为 ./plugins/<插件名>。
  • 仅当创建新市场文件且其名称不应为 personal,因为该名称已被占用或安装在别处时,才使用 --marketplace-name。
  • 如果 Codex 需要批准才能写入市场文件,请在继续之前请求该批准。如果用户更愿意自己执行写入,请提供确切的脚手架命令,然后从验证或后续插件编辑继续,而不是使工作流模糊不清。
  • 在开发过程中更新现有本地插件时,不要手动编辑市场配置或 marketplace.json。使用 references/installing-and-updating.md 和 scripts/update_plugin_cachebuster.py 中记录的更新流程。
  • 不要告诉用户对默认的个人市场流程运行 codex plugin marketplace add。该命令适用于显式的非默认市场配置,而不是标准的 ~/.agents/plugins/marketplace.json 路径。
  • 如果用户提供了非默认的 --marketplace-path,请在给出重新安装说明之前确保该市场已安装。当该显式市场尚未配置时,使用 codex plugin marketplace add <市场根目录路径>。
  • 当工作流创建或更新了基于市场的插件时,以简短的 Codex 应用移交结束最终面向用户的响应。说 To view this in the Codex app:,并写 View <规范化插件名> 和 Share <规范化插件名> 作为 Markdown 链接,而不是原始 URL 或代码跨度。
  • View 深度链接使用 codex://plugins/<规范化插件名>?marketplacePath=<marketplace.json的绝对路径>。Share 深度链接使用相同的 URL 并附加 &mode=share。
  • 将占位符替换为实际规范化的插件名和来自脚手架的绝对 marketplace.json 路径。必要时对路径段和查询值进行 URL 编码。
  • 不要在这些深度链接中添加 pluginName 或 hostId 查询参数。Codex 会在用户点击链接后派生这两者。
  • 当没有创建或更新市场条目时,不要输出 View <规范化插件名> 或 Share <规范化插件名> 链接。

参考确切规范示例

有关插件清单和市场条目的确切规范样本 JSON,请使用:

  • references/plugin-json-spec.md
  • references/installing-and-updating.md:用于迭代现有本地插件时的更新/重新安装指导,以及重新安装后的新线程拾取行为

验证

编辑 SKILL.md 后,运行:

python3 ../skill-creator/scripts/quick_validate.py .

在交付生成的插件之前,执行:

python3 scripts/validate_plugin.py <插件路径>

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.

code-review

Run a final code review on a pull request

code-review-change-size

Change size guidance (800 lines)

code-review-context

Model visible context

code-review-testing

Test authoring guidance

codex-bug

Diagnose GitHub bug reports in openai/codex. Use when given a GitHub issue URL from openai/codex and asked to decide next steps such as verifying against the repo, requesting more info, or explaining why it is not a bug; follow any additional user-provided instructions.

codex-issue-digest

Run a GitHub issue digest for openai/codex by feature-area labels, all areas, and configurable time windows. Use when asked to summarize recent Codex bug reports or enhancement requests, especially for owner-specific labels such as tui, exec, app, or similar areas.

codex-pr-body

Update the title and body of one or more pull requests.

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

openai/babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor a PR, watch CI, handle review comments, or keep an eye on failures and feedback on an open PR.

openai-docs

Use when the user asks how to build with OpenAI products or APIs, asks about Codex itself or choosing Codex surfaces, needs up-to-date official documentation with citations, help choosing the latest model for a use case, or model upgrade and prompt-upgrade guidance; use OpenAI docs MCP tools for non-Codex docs questions, use the Codex manual helper first for broad Codex self-knowledge, and restrict fallback browsing to official OpenAI domains.

openai/test-tui

Guide for testing Codex TUI interactively

path-types

Choose Rust types for operating system paths across the Codex repository. Use when defining new path-bearing types or explicitly migrating existing ones.

pushing-ci-changes

Pushing GitHub Actions changes, resolving push rejection, requesting upload exceptions.

remote-tests

Testing against remote executors in integration tests.

skill-creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations.

skill-installer

Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).

test-tui

Guide for testing Codex TUI interactively

update-v8-version

Update Codex's pinned `v8` / `rusty_v8` versions, validate the release-candidate path, and investigate failed V8 canary or artifact builds. Use when asked to bump V8, update `rusty_v8` artifacts, prepare or validate a V8 release candidate, check `v8-canary`, or diagnose why a V8 version update no longer builds.

相关技能