首页 › LLM大语言模型 › Codex专栏 › Codex中文教程 › 第六章:可复用Skills工作流

第六章:可复用Skills工作流

Skill 是什么​

App 中怎么调用 Skill​

常见方式:​

​

代码块​

Plain Text

$code-review 审查当前 diff,重点看安全、测试和边界情况。​

​

​

▫️

调用前先确认三件事:​

当前 App 是否能看到这个 Skill。​

Skill 是用户级、项目级,还是插件带来的。​

会不会读取额外资源、运行脚本或调用工具​

​

Skill 的文件结构​

最小结构:​

​

代码块​

Plain Text

.codex/skills/code-review/​

SKILL.md​

​

​

#wADWsLgJubqZ text { white-space: pre; }#wADWsLgJubqZ .fb0 { stroke: var(--N900-FG, 0.15); }#wADWsLgJubqZ .fb0 {stroke: rgba(31,35,41, 0.15)}#wADWsLgJubqZ .fx0 { stroke-miterlimit: 10; }#wADWsLgJubqZ .fx0 {stroke-miterlimit: 10}#wADWsLgJubqZ .fa1 { fill: rgb(187, 191, 196); }#wADWsLgJubqZ .fa1 {fill: rgb(187, 191, 196)}#wADWsLgJubqZ .fx1 { font: 400 12px MonospacedNumber, LarkHackSafariFont, LarkEmojiFont, LarkChineseQuote, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Tahoma, "PingFang SC", "Microsoft Yahei", Arial, "Hiragino Sans GB", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }#wADWsLgJubqZ .fx1 {font-style: normal}#wADWsLgJubqZ .fx2 { text-anchor: middle; }#wADWsLgJubqZ .fx2 {text-anchor: middle}#wADWsLgJubqZ .fx3 { dominant-baseline: central; }#wADWsLgJubqZ .fx3 {dominant-baseline: central}#wADWsLgJubqZ .fx4 { stroke: none; }#wADWsLgJubqZ .fx4 {stroke: none}#wADWsLgJubqZ .fc0 { fill: var(--text-caption); }#wADWsLgJubqZ .fc0 {fill: #646a73}#wADWsLgJubqZ .fa2 { fill: var(--text-link-disabled); }#wADWsLgJubqZ .fa2 {fill: rgb(187, 191, 196)}#wADWsLgJubqZ .fa3 { fill: rgb(222, 224, 227); }#wADWsLgJubqZ .fa3 {fill: rgb(222, 224, 227)}#wADWsLgJubqZ .fx5 { font: 400 13px MonospacedNumber, LarkHackSafariFont, LarkEmojiFont, LarkChineseQuote, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Tahoma, "PingFang SC", "Microsoft Yahei", Arial, "Hiragino Sans GB", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }#wADWsLgJubqZ .fx5 {font-style: normal}#wADWsLgJubqZ .fx6 { text-anchor: start; }#wADWsLgJubqZ .fx6 {text-anchor: start}#wADWsLgJubqZ .fx7 { dominant-baseline: alphabetic; }#wADWsLgJubqZ .fx7 {dominant-baseline: alphabetic}#wADWsLgJubqZ .fc1 { fill: rgb(78, 131, 253); }#wADWsLgJubqZ .fc1 {fill: rgb(78, 131, 253)}#wADWsLgJubqZ .fc2 { fill: rgb(0, 0, 0); }#wADWsLgJubqZ .fc2 {fill: rgb(0, 0, 0)}#wADWsLgJubqZ .fx8 { font: 400 13px LarkHackSafariFont, LarkEmojiFont, ui-monospace, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Noto Sans", Tahoma, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Source Han Sans CN", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", STHeiti, SimHei, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", system-ui; }#wADWsLgJubqZ .fx8 {font-style: normal}#wADWsLgJubqZ .fb1 { fill: var(--N900-FG, 0.15); }#wADWsLgJubqZ .fb1 {fill: rgba(31,35,41, 0.15)}#wADWsLgJubqZ .fb2 { fill: rgb(209, 217, 224); }#wADWsLgJubqZ .fb2 {fill: rgb(209, 217, 224)}#wADWsLgJubqZ .fa4 { fill: var(--bg-body); }#wADWsLgJubqZ .fa4 {fill: #fff}AB1234位置适合项目级 用户级 skills 目录插件内 Skill当前仓库专用 SOP个人跨项目复用团队或市场分发的能力包.codex/skills/

​

项目级 Skill 更适合教程,因为读者打开仓库就能看到规则;用户级 Skill 适合个人工作流,不应该写进团队仓库。​

示例:​

​

代码块​

Markdown

---name: code-reviewdescription: Review code changes for bugs, regressions, security risks, and missing tests.---# Code Review## Workflow1. Inspect the current diff.​

2. Identify behavior changes.​

3. Look for bugs, security risks, and missing tests.​

4. Report findings first, ordered by severity.​

​

## Output- Findings with file and line references.​

- Open questions.​

- Test gaps.​

​

## Rules- Do not rewrite code unless explicitly asked.​

- Do not praise changes before listing findings.​

​

好 Skill 的标准​

​

#dfQBCCxvJqAW text { white-space: pre; }#dfQBCCxvJqAW .fb0 { stroke: var(--N900-FG, 0.15); }#dfQBCCxvJqAW .fb0 {stroke: rgba(31,35,41, 0.15)}#dfQBCCxvJqAW .fx0 { stroke-miterlimit: 10; }#dfQBCCxvJqAW .fx0 {stroke-miterlimit: 10}#dfQBCCxvJqAW .fa1 { fill: rgb(187, 191, 196); }#dfQBCCxvJqAW .fa1 {fill: rgb(187, 191, 196)}#dfQBCCxvJqAW .fx1 { font: 400 12px MonospacedNumber, LarkHackSafariFont, LarkEmojiFont, LarkChineseQuote, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Tahoma, "PingFang SC", "Microsoft Yahei", Arial, "Hiragino Sans GB", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }#dfQBCCxvJqAW .fx1 {font-style: normal}#dfQBCCxvJqAW .fx2 { text-anchor: middle; }#dfQBCCxvJqAW .fx2 {text-anchor: middle}#dfQBCCxvJqAW .fx3 { dominant-baseline: central; }#dfQBCCxvJqAW .fx3 {dominant-baseline: central}#dfQBCCxvJqAW .fx4 { stroke: none; }#dfQBCCxvJqAW .fx4 {stroke: none}#dfQBCCxvJqAW .fc0 { fill: var(--text-caption); }#dfQBCCxvJqAW .fc0 {fill: #646a73}#dfQBCCxvJqAW .fa2 { fill: var(--text-link-disabled); }#dfQBCCxvJqAW .fa2 {fill: rgb(187, 191, 196)}#dfQBCCxvJqAW .fa3 { fill: rgb(222, 224, 227); }#dfQBCCxvJqAW .fa3 {fill: rgb(222, 224, 227)}#dfQBCCxvJqAW .fx5 { font: 400 13px MonospacedNumber, LarkHackSafariFont, LarkEmojiFont, LarkChineseQuote, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Tahoma, "PingFang SC", "Microsoft Yahei", Arial, "Hiragino Sans GB", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }#dfQBCCxvJqAW .fx5 {font-style: normal}#dfQBCCxvJqAW .fx6 { text-anchor: start; }#dfQBCCxvJqAW .fx6 {text-anchor: start}#dfQBCCxvJqAW .fx7 { dominant-baseline: alphabetic; }#dfQBCCxvJqAW .fx7 {dominant-baseline: alphabetic}#dfQBCCxvJqAW .fc1 { fill: rgb(245, 74, 69); }#dfQBCCxvJqAW .fc1 {fill: rgb(245, 74, 69)}#dfQBCCxvJqAW .fc2 { fill: rgb(0, 0, 0); }#dfQBCCxvJqAW .fc2 {fill: rgb(0, 0, 0)}#dfQBCCxvJqAW .fb1 { fill: var(--N900-FG, 0.15); }#dfQBCCxvJqAW .fb1 {fill: rgba(31,35,41, 0.15)}#dfQBCCxvJqAW .fb2 { fill: rgb(209, 217, 224); }#dfQBCCxvJqAW .fb2 {fill: rgb(209, 217, 224)}#dfQBCCxvJqAW .fa4 { fill: var(--bg-body); }#dfQBCCxvJqAW .fa4 {fill: #fff}AB1234567标准说明目标明确触发清晰步骤可执行输出稳定资源最小安全边界明确一句话说清它解决什么问题用户点名或描述能稳定触发不写空泛原则有明确交付格式只带必要参考文件和脚本写清哪些动作不能做

​

什么时候从 prompt 升级成 Skill​

满足任一条件就考虑 Skill:​

•

同一流程重复使用三次以上。​

•

团队多人需要统一做法。​

•

流程包含多个检查步骤。​

•

需要附带模板、脚本或参考文档。​

•

希望被 Automation 调用。​

临时任务不要急着写 Skill。​

Skills、Commands、Automations 的分工​

​

#URNmEPKQOTIp text { white-space: pre; }#URNmEPKQOTIp .fb0 { stroke: var(--N900-FG, 0.15); }#URNmEPKQOTIp .fb0 {stroke: rgba(31,35,41, 0.15)}#URNmEPKQOTIp .fx0 { stroke-miterlimit: 10; }#URNmEPKQOTIp .fx0 {stroke-miterlimit: 10}#URNmEPKQOTIp .fa1 { fill: rgb(187, 191, 196); }#URNmEPKQOTIp .fa1 {fill: rgb(187, 191, 196)}#URNmEPKQOTIp .fx1 { font: 400 12px MonospacedNumber, LarkHackSafariFont, LarkEmojiFont, LarkChineseQuote, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Tahoma, "PingFang SC", "Microsoft Yahei", Arial, "Hiragino Sans GB", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }#URNmEPKQOTIp .fx1 {font-style: normal}#URNmEPKQOTIp .fx2 { text-anchor: middle; }#URNmEPKQOTIp .fx2 {text-anchor: middle}#URNmEPKQOTIp .fx3 { dominant-baseline: central; }#URNmEPKQOTIp .fx3 {dominant-baseline: central}#URNmEPKQOTIp .fx4 { stroke: none; }#URNmEPKQOTIp .fx4 {stroke: none}#URNmEPKQOTIp .fc0 { fill: var(--text-caption); }#URNmEPKQOTIp .fc0 {fill: #646a73}#URNmEPKQOTIp .fa2 { fill: var(--text-link-disabled); }#URNmEPKQOTIp .fa2 {fill: rgb(187, 191, 196)}#URNmEPKQOTIp .fa3 { fill: rgb(222, 224, 227); }#URNmEPKQOTIp .fa3 {fill: rgb(222, 224, 227)}#URNmEPKQOTIp .fx5 { font: 400 13px MonospacedNumber, LarkHackSafariFont, LarkEmojiFont, LarkChineseQuote, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Tahoma, "PingFang SC", "Microsoft Yahei", Arial, "Hiragino Sans GB", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; }#URNmEPKQOTIp .fx5 {font-style: normal}#URNmEPKQOTIp .fx6 { text-anchor: start; }#URNmEPKQOTIp .fx6 {text-anchor: start}#URNmEPKQOTIp .fx7 { dominant-baseline: alphabetic; }#URNmEPKQOTIp .fx7 {dominant-baseline: alphabetic}#URNmEPKQOTIp .fc1 { fill: rgb(78, 131, 253); }#URNmEPKQOTIp .fc1 {fill: rgb(78, 131, 253)}#URNmEPKQOTIp .fc2 { fill: rgb(0, 0, 0); }#URNmEPKQOTIp .fc2 {fill: rgb(0, 0, 0)}#URNmEPKQOTIp .fb1 { fill: var(--N900-FG, 0.15); }#URNmEPKQOTIp .fb1 {fill: rgba(31,35,41, 0.15)}#URNmEPKQOTIp .fb2 { fill: rgb(209, 217, 224); }#URNmEPKQOTIp .fb2 {fill: rgb(209, 217, 224)}#URNmEPKQOTIp .fa4 { fill: var(--bg-body); }#URNmEPKQOTIp .fa4 {fill: #fff}AB123456需求首选当前线程快速动作固定 SOP / 复用流程定时或后台重复执行外部工具连接打包分发一组能力CommandSkillAutomationMCP / ConnectorPlugin

​

例子:​

•

/review 是 Command。​

•

$code-review 是 Skill。​

•

“每天早上 review 未合并 PR”是 Automation + Skill。​

带资源的 Skill​

复杂 Skill 可以带资源:​

​

代码块​

Plain Text

my-skill/​

SKILL.md​

references/​

checklist.md​

style-guide.md​

scripts/​

validate.js​

​

原则:​

•

大段参考资料放 references/。​

•

重复性强、容易写错的逻辑放 scripts/。​

•

SKILL.md 只写入口、流程、路由规则和必要摘要。​

带脚本的 Skill 要额外写清:​

•

脚本需要什么运行时。​

•

是否会写文件。​

•

是否会联网。​

•

失败时输出什么。​

•

是否能在 Windows / macOS 都跑。​

不要把一段危险脚本藏在 Skill 里让 App 自动执行。​

团队共享​

团队共享方式:​

​

​

团队 Skill 要避免写个人路径、个人 token、个人偏好。​

共享前验收:​

​

​

Skill 与插件​

Plugin 可以携带 Skills,但 Skill 不等于 Plugin。​

​

​

当你只需要一个团队审查流程,用 Skill。需要打包 GitHub 连接器、MCP、多个 Skills、配置时,才考虑 Plugin。​

常见反模式​

​

​

常见问题​

Q1:Skills 是 slash commands 吗?​

不完全是。Skill 可以被点名触发,也可能显示成命令入口,但本质是可复用工作流。​

Q2:Codex App 会自动加载所有 Skills 吗?​

取决于当前会话、项目、用户目录和插件。以 App 当前可见列表为准。​

Q3:Skill 能运行脚本吗?​

可以引用脚本资源,但是否执行取决于权限和当前环境。脚本要最小权限、可审计。​