场景 027 · Codex Use Case

将工作流保存为技能

把有效的 Codex 对话、审查规则、测试命令、发布清单、设计约定、写作示例或仓库脚本保存为技能,供后续任务复用。

EngineeringWorkflow
Save workflows as skillsEngineeringWorkflow

原文核对:2026-10-13 · 中文正文 · 英文提示词与演示

场景定位

把有效的 Codex 对话、审查规则、测试命令、发布清单、设计约定、写作示例或仓库脚本保存为技能,供后续任务复用。

难度
入门
时间跨度
5 分钟

适合用于

  • 希望重复使用的明确工作流。
  • 不想每次粘贴长提示词、需要共享技能的团队。

相关工具

Skill Creator

收集工作流信息、搭建技能、保持主指令简短并验证结果。

Skill Creator ↗

起步提示词

英文原文 · 可复制后按实际材料修改

Use $skill-creator to create a Codex skill that [fixes failing Buildkite checks on a GitHub PR / turns PR notes into inline review comments / writes our release notes from merged PRs]

Use these sources when creating the skill:
- Working example: [say "use this chat," link a merged PR, or paste a good Codex answer]
- Source: [paste a Slack thread, PR review link, runbook URL, docs URL, or ticket]
- Repo: [repo path, if this skill depends on one repo]
- Scripts or commands to reuse: [test command], [preview command], [log-fetch script], [release command]
- Good output: [paste the Slack update, changelog entry, review comment, ticket, or final answer you want future tasks to match]

创建可随时使用的技能

技能为重复工作保存指令、资源和脚本,保留首次有效的任务、文档、命令或示例。

从一个成功案例开始,例如 cherry-pick PR 的对话、Notion 发布清单、有用的 PR 评论,或说明上线流程的 Slack 会话。

使用步骤

  1. 提供背景:留在要保存的 Codex 对话中,粘贴 Slack 会话或文档链接,补充要记住的规则、命令或示例。
  2. 运行起步提示词:命名技能,将要保存的任务、文档、PR、命令或输出交给 $skill-creator。
  3. 创建并验证:定义 $skill-name、触发条件及正确存放位置。~/.codex/skills 中的技能可跨仓库使用;仓库中的技能可提交给队友复用。
  4. 使用并修订:在下一次 PR、告警、审查、发布说明或设计任务中调用。测试命令不对、遗漏规则或步骤、草稿不合适时,让 Codex 把修正写回技能。

提供源材料

将说明技能如何工作的材料交给 $skill-creator。

已有材料如何提供
要保存的 Codex 对话流程留在该对话中说明“使用这个对话”,以其中背景、命令、修改和反馈为起点。
文档或操作手册粘贴发布清单、链接事故响应手册、上传 API PDF,或指出仓库 Markdown 指南。
团队讨论粘贴告警说明会话、链接包含前端规则的 PR 审查,或上传说明客户问题的客服对话。
复用脚本或命令提供测试、预览、发布、日志获取或本地辅助命令。
优秀结果提供已合并 PR、最终变更日志、已接受上线说明、已解决工单、前后截图或最终回答。

材料在 Slack、Linear、GitHub、Notion 或 Sentry 中时,可连接相应插件并在提示词中提及,或直接粘贴相关内容。

生成的内容

通常从 SKILL.md 开始,按需增加较长参考文档、脚本或素材。

  • my-skill/:SKILL.md 为必需的指令和元数据;references/ 存可选长文档;scripts/ 存可重复命令;assets/ 存模板和起始文件。

可创建的技能

需要反复阅读同一本手册、运行相同 CLI、遵循审查标准、编写团队更新或测试浏览器流程时,都可采用。例如:

  • $buildkite-fix-ci:下载失败任务日志,诊断并提出最小代码修复。
  • $fix-merge-conflicts:检出 GitHub PR、同步基准分支、解决冲突并返回准确 push 命令。
  • $frontend-skill:保留 UI 偏好、既有组件、截图 QA、素材选择和浏览器打磨流程。
  • $pr-review-comments:将审查笔记转成语气合适、带 GitHub 链接的简洁行内评论。
  • $web-game-prototyper:限定首个可玩循环、选择素材、调整手感、截图并在浏览器中完善。
展开英文原文对照

Turn a working Codex chat, review rules, test commands, release checklists, design conventions, writing examples, or repo-specific scripts into a skill Codex can use in future tasks.

Create a skill Codex can keep on hand

Use skills to give Codex reusable instructions, resources, and scripts for work you repeat. A skill can preserve the task, doc, command, or example that made Codex useful the first time.

Start with one working example: a Codex chat that cherry-picked a PR, a release checklist from Notion, a set of useful PR comments, or a Slack thread explaining a launch process.

How to use

  1. Add the context you want Codex to use. Stay in the Codex chat you want to preserve, paste the Slack thread or docs link, and add the rule, command, or example Codex should remember.
  2. Run the starter prompt. The prompt names the skill you want, then gives $skill-creator the task, doc, PR, command, or output to preserve.
  3. Let Codex create and validate the skill. The result should define the $skill-name, describe when it should trigger, and keep reusable instructions in the right place. Skills in ~/.codex/skills are available from any repo. Skills in the current repo can be committed so teammates can use them too.
  4. Use the skill, then update it from the chat. Invoke the new $skill-name on the next PR, alert, review, release note, or design task. If it uses the wrong test command, misses a review rule, skips a runbook step, or writes a draft you would not send, ask Codex to add that correction to the skill.

Provide source material

Give $skill-creator the material that explains how the skill should work.

What you haveWhat to add
A workflow from a Codex chat that you want to preserveStay in that chat and say use this chat. Codex can use the chat context, commands, edits, and feedback as the starting point.
Docs or a runbookPaste the release checklist, link the incident-response runbook, attach the API PDF, or point Codex at the markdown guide in your repo.
Team conversationPaste the Slack thread where someone explained an alert, link the PR review with frontend rules, or attach the support conversation that explains the customer problem.
Scripts or commands the skill should reuseAdd the test command, preview command, release script, log-fetch script, or local helper command you want future Codex tasks to run.
A good resultAdd the merged PR, final changelog entry, accepted launch note, resolved ticket, before/after screenshot, or final Codex answer you want future tasks to match.

If the source is in Slack, Linear, GitHub, Notion, or Sentry, connect that tool in Codex with a plugin, mention it in the starter prompt, or paste the relevant part into the chat.

What Codex creates

Most skills start as a SKILL.md file. $skill-creator can add longer references, scripts, or assets when the workflow needs them.

  • my-skill/ SKILL.md Required: instructions and metadata references/ Optional: longer docs scripts/ Optional: repeatable commands assets/ Optional: templates and starter files

Skills you could create

Use the same pattern when future tasks should read the same runbook, run the same CLI, follow the same review rubric, write the same team update, or QA the same browser flow. For example:

  • $buildkite-fix-ci downloads failed job logs, diagnoses the error, and proposes the smallest code fix.
  • $fix-merge-conflicts checks out a GitHub PR, updates it against the base branch, resolves conflicts, and returns the exact push command.
  • $frontend-skill keeps Codex close to your UI taste, existing components, screenshot QA loop, asset choices, and browser polish pass.
  • $pr-review-comments turns review notes into concise inline comments with the right tone and GitHub links.
  • $web-game-prototyper scopes the first playable loop, chooses assets, tunes game feel, captures screenshots, and polishes in the browser.