把常用流程沉澱成 Skills
說明如何把反覆有效的 Codex thread、review rules、test commands 和 release checklist 沉澱成 skill。
當某個 Codex thread、review rules、test commands、release checklist、design conventions、writing examples 或 repo-specific scripts 反覆有用時,不要每次都重貼 prompt。把它做成一個 skill,讓 Codex 後續執行緒可以直接呼叫。
官方頁面:https://developers.openai.com/codex/use-cases/reusable-codex-skills
適合什麼任務
| 場景 | Codex 應該做什麼 |
|---|---|
| 有一個已經跑通的 workflow 想複用 | 用 $skill-creator 把上下文、規則和命令沉澱成 skill |
| 團隊不想每個 thread 貼上長 prompt | 寫成 $skill-name,讓未來任務按 description 自動觸發 |
| workflow 依賴 repo 命令、runbook、review rubric 或 good output | 把這些材料變成 SKILL.md、references、scripts 或 assets |
使用的能力
| 能力 | 用法 | 連結 |
|---|---|---|
$skill-creator | 收集 workflow 資訊,scaffold skill,保持主說明簡短,並驗證結果 | https://github.com/openai/skills/tree/main/skills/.system/skill-creator |
相關官方說明:
- Agent skills:https://developers.openai.com/codex/skills
- Codex plugins:https://developers.openai.com/codex/plugins
起始提示詞
请使用 $skill-creator 创建一个 Codex skill,用来 [修复 GitHub PR 上失败的 Buildkite checks / 把 PR notes 转成 inline review comments / 根据已合并 PR 写 release notes]。
创建 skill 时使用这些来源:
- Working example:[写 "use this thread",链接一个 merged PR,或粘贴一份好的 Codex answer]
- Source:[粘贴 Slack thread、PR review link、runbook URL、docs URL 或 ticket]
- Repo:[repo path;如果这个 skill 依赖某个 repo]
- 要复用的 scripts 或 commands:[test command]、[preview command]、[log-fetch script]、[release command]
- Good output:[粘贴你希望未来 threads 对齐的 Slack update、changelog entry、review comment、ticket 或 final answer]這個 prompt 要給 $skill-creator 一個 working example 和 good output。skill 不是抽象願望,而是把跑透過的工作方式固定下來。
使用步驟
-
新增上下文 留在你想保留的 Codex thread 裡,貼上 Slack thread 或 docs link,並加入 Codex 應記住的 rule、command 或 example。
-
執行 starter prompt prompt 命名你要的 skill,並把 thread、doc、PR、command 或 output 交給
$skill-creator。 -
讓 Codex 建立並驗證 skill 結果應該定義
$skill-name,說明何時觸發,並把 reusable instructions 放在正確位置。 -
使用 skill,再從 thread 更新它 在下一個 PR、alert、review、release note 或 design task 裡呼叫
$skill-name。如果它用錯 test command、漏掉 review rule、跳過 runbook step 或寫出你不會傳送的 draft,讓 Codex 把修正加入 skill。
~/.codex/skills 裡的 skills 可在任意 repo 使用;當前 repo 內的 skills 可以提交給 teammates 共用。
提供 Source Material
| 你已有的材料 | 應該給 Codex 什麼 |
|---|---|
| 想保留的 Codex thread workflow | 留在該 thread,說 use this thread,讓 Codex 用 conversation、commands、edits、feedback 作為起點 |
| docs 或 runbook | 貼上 release checklist、連結 incident-response runbook、attach API PDF,或指向 repo 內 markdown guide |
| team conversation | 貼上 Slack thread、PR review link、support conversation,說明 alert、frontend rules 或 customer problem |
| 要複用的 scripts 或 commands | test command、preview command、release script、log-fetch script、local helper command |
| good result | merged PR、final changelog entry、accepted launch note、resolved ticket、before/after screenshot、final Codex answer |
如果 source 在 Slack、Linear、GitHub、Notion 或 Sentry,可以用 Codex plugin 連線,也可以在 starter prompt 中 mention,或把相關片段貼上進 thread。
Codex 會建立什麼
多數 skills 從 SKILL.md 開始。$skill-creator 可以在 workflow 需要時新增 longer references、scripts 或 assets。
一個好的 skill 應該:
- description 說清觸發場景。
- main instructions 簡短。
- 複雜細節放 references。
- 可執行命令放 scripts 或明確步驟。
- 有驗證方式。
可以建立的 Skills
$buildkite-fix-ci:下載 failed job logs,診斷錯誤,提出最小程式碼修復。$fix-merge-conflicts:checkout GitHub PR,基於 base branch 更新,解決 conflicts,返回 exact push command。$frontend-skill:記錄 UI taste、existing components、screenshot QA loop、asset choices、browser polish pass。$pr-review-comments:把 review notes 轉成 concise inline comments,帶正確語氣和 GitHub links。$web-game-prototyper:定義 first playable loop,選擇 assets,調整 game feel,截圖並在 browser 中 polish。