Community程式設計與開發github.com

plugin-creator

建立並建構 Codex 外掛目錄,包含必要的 `.codex-plugin/plugin.json`、可選的外掛資料夾/檔案、有效的預設 manifest 以及個人市集項目。適用於 Codex 需要建立新的個人外掛、新增可選外掛結構、產生或更新市集項目以管理外掛排序與可用性中繼資料,或在開發期間透過 CLI 驅動的快取清除與重新安裝流程更新現有的本地端外掛。

plugin-creator 是什麼?

Plugin Creator 是一個專門用於在 Codex 中建立和管理外掛的技能。它能自動生成標準化的外掛目錄結構,包含強制性的 `.codex-plugin/plugin.json` 清單檔案,並可選擇性地建立 `skills/`、`hooks/`、`scripts/`、`assets/` 等輔助資料夾。該技能支援個人市集(預設路徑 `~/.agents/plugins/marketplace.json`)以及團隊/儲存庫市集的建立,能自動產生包含正確 `policy.installation`、`policy.authentication` 和 `category` 的市集條目。對於開發中的本地外掛,它提供快取清除與重新安裝流程(透過 `scripts/update_plugin_cachebuster.py`),並在最後的對話回覆中產生標準的 `codex://` 深層連結(`View` 和 `Share`),方便在 Codex 應用程式中直接開啟和分享外掛。此技能支援 Windows 路徑、外掛名稱正規化(轉為小寫連字號格式),並確保產生的 manifest 不含 `[TODO: ...]` 預留位置。

相容平台✓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 的新對話。

說明文件

Plugin Creator

快速開始

  1. 執行建構腳本:
# 外掛名稱會正規化為小寫連字號格式,且長度不得超過 64 個字元。
# 產生的資料夾名稱與 plugin.json 中的 name 始終相同。
# 從技能根目錄(包含此 SKILL.md 的目錄)執行。
# 預設會在 ~/plugins/<plugin-name> 建立。
python3 scripts/create_basic_plugin.py <plugin-name>
  1. 當需求提供特定中繼資料時,編輯 <plugin-path>/.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 <name>:

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

僅在使用者明確要求該目的地時,才使用儲存庫/團隊市集:

python3 scripts/create_basic_plugin.py my-plugin \
  --path <repo-root>/plugins \
  --marketplace-path <repo-root>/.agents/plugins/marketplace.json \
  --with-marketplace

當使用者指定了市集路徑時,請在告知使用者從該市集重新安裝之前,確保該市集確實已安裝。預設的個人市集檔案位於 ~/.agents/plugins/marketplace.json,會隱含地被發現,但其他市集路徑則不會。在 Windows 上,請使用使用者設定檔下的對應路徑。

  1. 根據需要產生/調整可選的輔助資料夾:
python3 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> 的目錄(例如 ~/plugins)。

  1. 在交回產生的外掛之前,執行:
python3 scripts/validate_plugin.py <plugin-path>

對於開發期間對現有本地外掛的更新,請保持建構流程不變,並使用參考文件而非手動編輯市集檔案:

python3 scripts/update_plugin_cachebuster.py <plugin-path>

除非使用者明確要求特定的覆寫值,否則優先使用輔助預設快取清除器。關於疊代現有本地外掛時的預期快取清除與重新安裝流程,請參閱 references/installing-and-updating.md。

此技能建立的內容

  • 預設的市集支援建構應使用位於 ~/.agents/plugins/marketplace.json 的個人市集檔案,外掛通常存放在 ~/plugins/<plugin-name>/ 中。
  • 在 /<parent-plugin-directory>/<plugin-name>/ 建立外掛根目錄。
  • 總是建立 /<parent-plugin-directory>/<plugin-name>/.codex-plugin/plugin.json。
  • 使用擷取路徑接受的已驗證結構描述形狀填入 manifest。
  • 當設定了 --with-marketplace 時,建立或更新 ~/.agents/plugins/marketplace.json。
    • 如果市集檔案尚不存在,請在新增第一個外掛條目之前先建立個人市集根目錄。
  • <plugin-name> 使用技能建立器的命名規則進行正規化:
    • 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/<plugin-name>。
  • 市集根中繼資料支援頂層的 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 存在。
  • 不要在外掛 manifest 中留下 [TODO: ...] 預留位置。
  • 除非實際建立了 apps 和 mcpServers 的配套檔案,否則將它們保留在 plugin.json 之外。
  • 省略驗證會拒絕的不受支援外掛 manifest 欄位,包括 hooks。
  • 如果在現有外掛路徑內建立檔案,僅在有意覆寫時才使用 --force。
  • 保留任何現有的市集 interface.displayName。
  • 在產生市集條目時,即使其值為預設值,也務必寫入 policy.installation、policy.authentication 和 category。
  • 僅在使用者明確要求該覆寫時,才新增 policy.products。
  • 保持市集 source.path 相對於所選市集根目錄的路徑為 ./plugins/<plugin-name>。
  • 僅在建立一個名稱不應為 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 <path-to-marketplace-root>。
  • 當工作流程建立或更新了市集支援的外掛時,請在最終的使用者面向回覆中,以簡短的 Codex 應用程式交接作為結尾。請使用「若要在 Codex 應用程式中檢視此內容:」開頭,然後將「檢視 <正規化外掛名稱>」和「分享 <正規化外掛名稱>」作為 Markdown 連結撰寫,而非原始 URL 或程式碼範圍。
  • View 深層連結使用 codex://plugins/<正規化外掛名稱>?marketplacePath=<絕對 marketplace.json 路徑>。Share 深層連結使用相同的 URL,並加上 &mode=share。
  • 將預留位置替換為已建構外掛的實際正規化外掛名稱和絕對 marketplace.json 路徑。必要時,對路徑片段和查詢值進行 URL 編碼。
  • 請勿在這些深層連結中新增 pluginName 或 hostId 查詢參數。Codex 會在使用者點擊連結後推導出這兩個值。
  • 當未建立或更新市集條目時,請勿輸出「檢視 <正規化外掛名稱>」或「分享 <正規化外掛名稱>」連結。

確切規格範例的參考

有關外掛 manifest 和市集條目的確切規範範例 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 <plugin-path>

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.

相關技能