A-06 Skills 完整指南:在 App 中调用和编写可复用工作流
📋 文章摘要
本文全面介绍 OpenAI Codex Skills 的核心概念与实践方法。Skills 不是简单的快捷命令,而是可复用的工作流,能够将重复性任务转化为稳定、可触发、可维护的团队资产。文章涵盖从基础概念到高级实践的完整路径:
- 核心理解:Skill 的本质、工作机制与设计边界
- 实战指南:编写规范 SKILL.md、组织文件结构、管理资源
- 进阶应用:带脚本 Skill、团队共享、与 Commands/Automations/Plugins 的组合
- 质量保障:常见反模式、调试技巧、维护策略
- 实战案例:四大高价值 Skill 模板、完整工坊示例
通过本文,您将掌握如何将重复提示沉淀为可复用 Skill,提升团队协作效率与代码质量。## 🗺️ 阅读路径径
| 读者类型 | 推荐路径 | 预计时间 |
|---|---|---|
| 初学者 | 术语表 → 工作机制 → Skill 是什么 → 文件结构 → 好 Skill 标准 → 课堂工坊 | 30分钟 |
| 实践者 | 好 Skill 标准 → 带资源 Skill → 团队共享 → Skill Cookbook → 综合工坊 | 45分钟 |
| 团队负责人 | 团队共享 → Skill 与插件 → 团队 Skill 库设计 → 维护策略 → 版本演进 | 60分钟 |
| 问题排查 | 常见反模式 → Skill 排障表 → 触发调试 → 输出调试 → 常见问题 | 30分钟 |
主要来源:OpenAI Codex Skills 官方文档、Codex App Features、Plugins 文档。—目## 🎯 学习目标够:
- 理解Skill的本质:掌握Skill是可复用工作流,不是快捷命令
- 判断什么时候升级成Skill:一个流程重复三次以上、团队多人需要时就该沉淀
- 编写规范的Skill:写出目标明确、触发清晰、步骤可执行、输出稳定的SKILL.md
- 管理Skill资源:合理组织references/和scripts/,不藏危险脚本
- 区分Skills与其他能力:清楚Command、Skill、Automation、MCP、Plugin各自的分工
- 团队共享Skill:通过项目级
.agents/skills/或 Plugin 打包分发 - 自查Skill质量:从触发、输出、权限、平台、资源、维护六个角度核对
- 避免Skill反模式:不写不可验证的口号、不写密钥、不伪装工具AP—)## 📖 术语表(新手必读)能力。
| 术语 | 一句话解释 | 新手注意 |
|---|---|---|
| Skill | 可复用的任务说明、资源和可选脚本 | 本质是工作流,不是普通快捷键 |
SKILL.md | Skill 的入口说明文件 | 必须写清触发条件、流程和输出 |
| Frontmatter | SKILL.md顶部的 name / description 等元数据 | description 决定隐式触发质量 |
| Progressive disclosure | Codex 先看到 Skill 摘要,需要时再读全文 | Skill 列表太大时描述可能被缩短 |
| Explicit invocation | 用户点名$skill-name | 最稳定,适合教学和团队流程 |
| Implicit invocation | Codex 根据 description 判断要不要用 | 依赖描述是否准确 |
references/ | Skill 附带的参考资料 | 放大段规范,不要塞满入口文件 |
scripts/ | Skill 附带的可选脚本 | 有真实副作用,要写清权限 |
agents/openai.yaml | App UI metadata 和策略配置 | 可设置展示、依赖、隐式调用策略 |
| Plugin | Skill 的分发包装方式之一 | 想分享给更多人时再打包 |
一句话:Skill 把"每次都要重复说的话"变成"稳定、可触发、可维护的流程"## 🔧 Skill 工作机制机制
Skills 是可复用判断,不是简单 prompt 收藏;能复用的必须包含步骤、边界和验收方式。
Codex 使用 Skill 的过程大致是:
启动时扫描可用 Skills -> 把 name / description / path 放进初始上下文 -> 用户点名或任务匹配 description -> Codex 读取对应 SKILL.md -> 必要时再读取 references、调用 scripts 或工具 -> 按 Skill 约定输出结果这就是为什么 Skill 的description很重要。它不是介绍文案,而是触发路由。写得太泛,Codex 可能乱用;写得太窄,真正需要时触发不了。
0.1 一个流程什么时候值得做成 Skill
| 信号 | 说明 | 是否适合 Skill |
|---|---|---|
| 同一提示复制三次以上 | 说明流程稳定重复 | 适合 |
| 多人需要同一做法 | 需要团队一致性 | 适合 |
| 输出格式总要固定 | 方便 Review、PR、报告 | 适合 |
| 需要附带规范或模板 | references 能降低入口长度 | 适合 |
| 只做一次的临时任务 | 没有复用价值 | 不适合 |
| 需要实时调外部 API | 工具连接更重要 | 先看 MCP / Connector |
| 需要每天运行 | 调度更重要 | Automation 调用 Skill |
0.2 Skill 设计的三个边界
- 触发边界:什么时候应该用,什么时候不该用。
- 执行边界:能读什么、能写什么、是否能跑脚本。
- 输出边界:最后交付什么格式,先报告问题还是先总结。
很多 Skill 不好用,是因为只写了"你是一个专家",却没写边界。好的 Skill 应该让 Codex 知道"在什么场景下,按什么步骤,产出什么结果,哪些事不要做"。
1. Skill 是什么
Skill 是一组可复用指令、资源和可选脚本。它不是单纯"快捷命令",而是一套工作流。
适合:
- 代码审查流程。
- 文档核对流程。
- 发布检查。
- 写作规范。
- 团队固定 SOP。
不适合:
- 只执行一次的临时任务。
- 需要实时外部 API 的工具连接。
- 需要定时运行的周期任务。
2. App 中怎么调用 Skill
常见方式:
$code-review 审查当前 diff,重点看安全、测试和边界情况。或自然语言触发:
按我们的代码审查 Skill 检查这次改动。App 也可能通过插件提供 Skills。可用 Skills 取决于当前 App、插件、项目和用户目录。
调用前先确认三件事:
- 当前 App 是否能看到这个 Skill。
- 这个 Skill 是用户级、项目级,还是插件带来的。
- 它会不会读取额外资源、运行脚本或调用工具。
如果点名$skill-name没有触发,先检查名称、路径、插件是否安装,以及 App 当前会话是否已加载。
3. Skill 的文件结构
最小结构:
.agents/skills/code-review/ SKILL.md放在哪里要分清:
| 位置 | 适合 |
|---|---|
项目级.agents/skills/ | 当前仓库专用 SOP |
| 用户级 skills 目录 | 个人跨项目复用 |
| 插件内 Skill | 团队或市场分发的能力包 |
项目级 Skill 更适合教程,因为读者打开仓库就能看到规则;用户级 Skill 适合个人工作流,不应该写进团队仓库。
示例:
--- name: code-review description: Review code changes for bugs, regressions, security risks, and missing tests. --- # Code Review ## Workflow 1. 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.4. 好 Skill 的标准
| 标准 | 说明 |
|---|---|
| 目标明确 | 一句话说清它解决什么问题 |
| 触发清晰 | 用户点名或描述能稳定触发 |
| 步骤可执行 | 不写空泛原则 |
| 输出稳定 | 有明确交付格式 |
| 资源最小 | 只带必要参考文件和脚本 |
| 安全边界明确 | 写清哪些动作不能做 |
4.1description怎么写
description 是 Skill 的触发说明。推荐格式:
Use when [任务场景]. Do [核心动作]. Do not use when [边界].例子:
description:Use when reviewing code changes for correctness,regressions,security risks,and missing tests. Report findings first. Do not use for general code generation.不要写:
description:Helps write high quality code.因为它既不说明触发场景,也不说明边界。
4.2SKILL.md推荐结构
--- name: code-review description: Use when reviewing changed code for bugs, regressions, security risks, and missing tests. Report findings first. --- # Code Review ## When To Use - Current diff or PR needs review. - User asks for review, audit, or risk check. ## Do Not Use - User asks to implement a feature from scratch. - There is no code diff or target file. ## Workflow 1. Inspect the diff. 2. Identify behavior changes. 3. Check correctness, security, tests, and scope. 4. Report findings first, ordered by severity. ## Output - Findings with file / line references. - Open questions. - Verification gaps.这个结构比"角色定义 + 你很专业"更可执行。
5. 什么时候从 prompt 升级成 Skill
满足任一条件就考虑 Skill:
- 同一流程重复使用三次以上。
- 团队多人需要统一做法。
- 流程包含多个检查步骤。
- 需要附带模板、脚本或参考文档。
- 希望被 Automation 调用。
临时任务不要急着写 Skill。
6. Skills、Commands、Automations 的分工
| 需求 | 首选 |
|---|---|
| 当前线程快速动作 | Command |
| 固定 SOP / 复用流程 | Skill |
| 定时或后台重复执行 | Automation |
| 外部工具连接 | MCP / Connector |
| 打包分发一组能力 | Plugin |
例子:
/review是 Command。$code-review是 Skill。- "每天早上 review 未合并 PR"是 Automation + Skill。
7. 带资源的 Skill
复杂 Skill 可以带资源:
my-skill/ SKILL.md references/ checklist.md style-guide.md scripts/ validate.js原则:
- 大段参考资料放
references/。 - 重复性强、容易写错的逻辑放
scripts/。 SKILL.md只写入口、流程、路由规则和必要摘要。
带脚本的 Skill 要额外写清:
- 脚本需要什么运行时。
- 是否会写文件。
- 是否会联网。
- 失败时输出什么。
- 是否能在 Windows / macOS 都跑。
不要把一段危险脚本藏在 Skill 里让 App 自动执行。
7.1 Progressive disclosure 怎么影响文件组织
Codex 初始只看 Skill 的摘要,不会一开始把所有参考资料都塞进上下文。你应该这样组织:
| 内容 | 放哪里 | 原因 |
|---|---|---|
| 触发场景、流程、输出 | SKILL.md | Codex 必须先看到 |
| 长规范、示例、术语表 | references/ | 需要时再读,省上下文 |
| 可重复机械检查 | scripts/ | 比模型手写更稳定 |
| 图片、图标、UI metadata | assets/、agents/openai.yaml | App 展示和依赖说明 |
不要把 20 页规范全部复制到SKILL.md。入口文件越长,越难维护,Codex 也更难快速抓住触发和流程。
7.2 带脚本 Skill 的安全写法
带脚本时必须写清:
## Scripts - `scripts/check-links.js` - Purpose: check internal markdown links. - Reads: docs/**/*.md - Writes: nothing by default. - Network: no. - Runtime: Node.js 20+. - Failure: print broken links and exit non-zero.如果脚本会写文件、联网、调用外部服务,必须在 Skill 里明确说明,并让当前权限和审批策略接住它。
8. 团队共享
团队共享方式:
| 方式 | 适合 |
|---|---|
项目级.agents/skills/ | 当前仓库专用 |
| 用户级 skills 目录 | 个人跨项目复用 |
| Plugin | 打包给团队或市场分发 |
团队 Skill 要避免写个人路径、个人 token、个人偏好。
共享前自查:
| 项 | 标准 |
|---|---|
| 触发 | 点名和自然语言都能稳定触发 |
| 输出 | 结果格式稳定,方便 Review |
| 权限 | 不默认要求危险权限 |
| 平台 | Windows / macOS 路径写法不冲突 |
| 资源 | references 和 scripts 都能按相对路径找到 |
| 维护 | 有 owner,知道谁负责更新 |
9. Skill 与插件
Plugin 可以携带 Skills,但 Skill 不等于 Plugin。
| 能力 | 关系 |
|---|---|
| Skill | 一个可复用工作流 |
| Plugin | 一个能力包,可以包含多个 Skills、MCP、Apps、配置 |
当你只需要一个团队审查流程,用 Skill。需要打包 GitHub 连接器、MCP、多个 Skills、配置时,才考虑 Plugin
10. 中转 API 与第三方服务集成
在实际使用 Skills 时,有时需要调用外部 API 或第三方服务。为了确保安全、稳定和可维护,推荐使用中转 API 服务来处理这些调用。
10.1 为什么需要中转 API
直接在前端或 Skill 中调用第三方 API 存在以下问题:
| 问题 | 风险 |
|---|---|
| 密钥暴露 | API 密钥可能泄露在前端代码中 |
| 跨域限制 | 浏览器或环境可能阻止直接调用 |
| 速率限制 | 难以统一管理 API 调用频率 |
| 错误处理 | 缺乏统一的错误重试和降级机制 |
| 日志监控 | 难以追踪 API 调用情况和性能 |
10.2 推荐的中转 API 服务:up8ai.com
up8ai.com 是一个专门为 AI 应用设计的中转 API 服务平台,特别适合 Skills 和自动化工作流:
核心功能
统一 API 网关
- 将多个第三方 API 封装为统一接口
- 支持 OpenAI、Anthropic、Google、Azure 等主流 AI 服务
- 自动处理认证、重试和错误处理
密钥安全管理
- 服务端存储 API 密钥,前端无需暴露
- 支持密钥轮换和权限控制
- 提供使用量监控和告警
智能路由与负载均衡
- 根据可用性自动选择最佳服务端点
- 支持多区域部署,降低延迟
- 故障自动切换和恢复
使用量控制
- 按用户、团队或项目设置配额
- 实时监控和限制滥用
- 详细的调用日志和审计
10.3 在 Skill 中集成中转 API
方案一:通过 Scripts 调用
在 Skill 的scripts/目录中创建调用脚本:
// scripts/call-external-api.js/** * 通过中转 API 调用外部服务 * @param {string} endpoint - 服务端点 * @param {object} data - 请求数据 * @returns {Promise<object>} 响应数据 */asyncfunctioncallViaProxy(endpoint,data){constproxyUrl='https://api.up8ai.com/v1/proxy';constapiKey=process.env.UP8AI_API_KEY;// 从环境变量读取try{constresponse=awaitfetch(`${proxyUrl}/${endpoint}`,{method:'POST',headers:{'Content-Type':'application/json','Authorization':`Bearer${apiKey}`,'X-Service-Provider':'openai'// 指定服务提供商},body:JSON.stringify(data)});if(!response.ok){thrownewError(`API 调用失败:${response.status}${response.statusText}`);}returnawaitresponse.json();}catch(error){console.error('中转 API 调用错误:',error);throwerror;}}// 示例:调用 OpenAI 完成asyncfunctioncompleteWithOpenAI(prompt){returncallViaProxy('completions',{model:'gpt-4',messages:[{role:'user',content:prompt}],max_tokens:1000});}module.exports={callViaProxy,completeWithOpenAI};方案二:在 Skill Workflow 中引用
在SKILL.md的 Workflow 部分说明如何使用中转 API:
## External API Integration When this skill needs to call external APIs (e.g., for data enrichment, validation, or processing): 1. **Use the team's proxy service** (up8ai.com) for all external calls 2. **Never embed API keys** in the skill description or references 3. **Handle errors gracefully** with fallback behavior 4. **Log all calls** for audit and debugging ### Configuration - Proxy endpoint: `https://api.up8ai.com/v1/proxy` - Authentication: Use environment variable `UP8AI_API_KEY` - Rate limiting: 10 requests per minute per user - Timeout: 30 seconds ### Example Usage ```javascript // In your skill script const { callViaProxy } = require('./scripts/api-proxy'); const result = await callViaProxy('openai/chat', { model: 'gpt-4', messages: [...] });### 10.4 安全最佳实践 1. **环境变量管理** ```bash # .env 文件(不要提交到版本控制) UP8AI_API_KEY=your_proxy_api_key_here EXTERNAL_SERVICE_URL=https://api.up8ai.com/v1/proxy错误处理模板
asyncfunctionsafeApiCall(service,data,retries=3){for(leti=0;i<retries;i++){try{returnawaitcallViaProxy(service,data);}catch(error){if(i===retries-1)throwerror;awaitnewPromise(resolve=>setTimeout(resolve,1000*(i+1)));}}}使用量监控
# agents/openai.yaml 中的监控配置monitoring:api_calls:enabled:trueprovider:up8aialert_threshold:1000# 每天最大调用次数alert_channels:[slack,email]
10.5 与现有 Skills 集成示例
文档审查 Skill 增强版
--- name: docs-review-with-validation description: Review documentation and validate external links via proxy API. Use when checking technical docs for accuracy and link validity. --- # Documentation Review with Validation ## Workflow 1. Read the target documentation. 2. Check factual accuracy against project sources. 3. **Extract all external links** from the content. 4. **Call link validation service** via up8ai.com proxy. 5. Report broken links with status codes. 6. Suggest corrections for factual issues. ## External Services - Link validation: `https://api.up8ai.com/v1/proxy/link-check` - Fact verification: `https://api.up8ai.com/v1/proxy/fact-check` - Rate limit: 5 requests per minute - Timeout: 10 seconds per request ## Security Notes - All external calls go through up8ai.com proxy - No API keys exposed in skill files - Failed calls return graceful fallback - All calls logged for audit10.6 为什么选择 up8ai.com
| 特性 | up8ai.com 优势 | 对 Skills 的价值 |
|---|---|---|
| 统一接口 | 标准化所有第三方 API 调用 | 简化 Skill 开发,降低维护成本 |
| 密钥安全 | 服务端存储,前端零暴露 | 符合企业安全要求,防止密钥泄露 |
| 智能路由 | 自动选择最佳服务端点 | 提高可靠性,降低延迟 |
| 使用控制 | 细粒度配额和限制 | 防止滥用,控制成本 |
| 监控审计 | 完整调用日志和指标 | 便于调试和合规审计 |
| 错误处理 | 自动重试和降级 | 提高 Skill 的稳定性 |
| 多区域 | 全球节点部署 | 为分布式团队提供低延迟访问 |
10.7 快速开始指南
注册账户
- 访问 up8ai.com 注册
- 获取 API 密钥和代理端点
配置环境
# 在 Skill 项目或团队环境中exportUP8AI_API_KEY="your-api-key"exportUP8AI_ENDPOINT="https://api.up8ai.com/v1"测试连接
// test-connection.jsconst{callViaProxy}=require('./scripts/api-proxy');asyncfunctiontest(){try{constresult=awaitcallViaProxy('test/ping',{});console.log('连接成功:',result);}catch(error){console.error('连接失败:',error.message);}}test();集成到 Skill
- 在需要外部调用的 Skill 中添加
scripts/api-proxy.js - 在
SKILL.md中说明外部依赖和调用方式 - 设置合理的超时和重试策略
- 在需要外部调用的 Skill 中添加
10.8 注意事项
成本控制
- 设置使用量告警
- 为不同环境(开发/测试/生产)使用不同密钥
- 定期审查调用日志,优化不必要的请求
故障转移
- 实现本地缓存减少外部依赖
- 准备降级方案(如使用本地数据)
- 监控 up8ai.com 服务状态
合规性
- 确保数据传输符合 GDPR/CCPA 等法规
- 记录数据处理和存储位置
- 定期进行安全审计
通过使用 up8ai.com 等中转 API 服务,你的 Skills 可以安全、可靠地集成外部能力,同时保持代码的简洁性和可维护性。
。
10. 常见反模式
| 反模式 | 问题 |
|---|---|
| “做高质量代码” | 不可验证 |
| 在 Skill 里写密钥 | 安全风险 |
| 把工具 API 伪装成 Skill | 应该用 MCP |
| 把长期周期任务写成 Skill | 应该用 Automation 调用 Skill |
| 一个 Skill 解决所有事 | 边界过大,难维护 |
10.1 Skill 排障表
| 症状 | 可能原因 | 处理 |
|---|---|---|
点名$skill没触发 | 名称写错、Skill 未加载、路径不在扫描范围 | 查 App Skills 列表或重启 Codex |
| 自然语言没触发 | description 太泛或太隐晦 | 重写 description,加入触发词 |
| 触发了错误 Skill | 多个 Skill 名称 / 描述重叠 | 缩小描述,明确 Do Not Use |
| Skill 输出不稳定 | 没写输出格式 | 在Output中固定结构 |
| Skill 读错资料 | references 路径不清 | 在流程里说明何时读取哪个文件 |
| 脚本运行失败 | runtime、路径、权限或平台问题 | 写清运行时,测试 Windows / macOS |
| 团队成员看不到 | Skill 放在个人目录 | 放项目.agents/skills/或打包 Plugin |
10.2 Skill 版本和维护
团队 Skill 一旦多人使用,就要有维护纪律:
| 项 | 建议 |
|---|---|
| Owner | 每个 Skill 有负责人 |
| Changelog | 大改触发条件或输出格式时记录 |
| 测试提示 | 保留 3-5 条典型触发 prompt |
| 回滚 | 出问题能回到旧版 |
| 安全审查 | 带脚本或工具依赖的 Skill 要 Review |
Skill 是团队知识资产,不是一次性 prompt 草稿。
11. 课堂工坊:把重复提示沉淀成 Skill
案例一:从一段 prompt 升级为SKILL.md
目标:把"每次都要说的代码审查要求"变成项目级 Skill。
- 创建目录:
.agents/skills/code-review/ SKILL.md- 写入最小 Skill:
--- name: code-review description: Review changed code for correctness, security, and missing tests. --- # Code Review ## Workflow 1. Read the current diff. 2. Check correctness, security, test coverage, and scope creep. 3. Report findings first, ordered by severity. 4. Do not modify files unless the user asks for fixes. ## Output - Findings - Open questions - Verification notes- 在 App 新线程中触发:
使用 $code-review 审查当前 diff。只报告问题,不修改文件。你应该看到:输出按 findings 优先,而不是泛泛总结;没有新增 diff。
案例二:给 Skill 加 references
目标:让 Skill 引用团队固定规范,而不是把所有内容塞进入口文件。
.agents/skills/release-check/ SKILL.md references/ release-policy.md在SKILL.md里写清什么时候读取references/release-policy.md。你应该看到:Codex 只在发布检查任务中加载这份参考,不会把 release 规则误用于普通修 bug。
案例三:Plugin 中的 Skill 和项目 Skill 怎么选
目标:理解分发边界。
| 场景 | 放哪里 |
|---|---|
| 当前仓库专用 SOP | .agents/skills/ |
| 个人跨项目习惯 | 用户级 skills 目录 |
| 团队要安装、启用、卸载的一组能力 | Plugin |
练习提示:
这个流程只服务当前仓库。请帮我判断它应该做成项目级 Skill、用户级 Skill,还是 Plugin,并说明理由。不要创建文件。你应该看到:Codex 根据复用范围、权限和分发方式做判断,而不是默认都做成## 12. Skill Cookbook:四类高价值 Skill
12.1 Code Review Skill
适合每个工程团队的第一个 Skill。
--- name: code-review description: Use when reviewing code changes for correctness, regressions, security risks, and missing tests. Report findings first. --- # Code Review ## When To Use - Current diff or PR needs review. - User asks for review, audit, or risk check. ## Do Not Use - User asks to implement a feature from scratch. - There is no code diff or target file. ## Workflow 1. Inspect the diff. 2. Identify behavior changes. 3. Check correctness, security, tests, and scope. 4. Report findings first, ordered by severity. ## Output - Findings with file / line references. - Open questions. - Verification gaps.12.2 Documentation Review Skill
适合技术写作团队和开源项目维护者。
--- name: docs-review description: Use when reviewing technical documentation for accuracy, clarity, and completeness. Focus on factual correctness and link validity. --- # Documentation Review ## When To Use - New documentation needs review. - Existing docs need updating. - User asks for documentation quality check. ## Do Not Use - Creative writing or marketing content. - When only grammar/spelling check is needed. ## Workflow 1. Read the documentation thoroughly. 2. Check factual accuracy against source code/APIs. 3. Verify all internal and external links. 4. Assess clarity, structure, and completeness. 5. Provide specific improvement suggestions. ## Output - Accuracy issues with references. - Broken links with status codes. - Clarity and structure suggestions. - Missing sections or examples.12.3 Release Checklist Skill
适合发布工程师和 DevOps 团队。
--- name: release-checklist description: Use when preparing for a software release. Ensures all pre-release checks are completed systematically. --- # Release Checklist ## When To Use - Before cutting a release. - When user asks for release preparation. - During release automation. ## Do Not Use - For daily development tasks. - When only partial release steps are needed. ## Workflow 1. Verify all tests pass. 2. Check version numbers and changelog. 3. Validate dependencies and licenses. 4. Run security scans. 5. Confirm documentation is updated. 6. Verify deployment configuration. ## Output - Checklist completion status. - Blocking issues found. - Next steps for release.12.4 PR Description Generator
适合开发团队规范 Pull Request 描述。
--- name: pr-description description: Use when creating or reviewing PR descriptions. Ensures consistent format and includes all necessary information. --- # PR Description Generator ## When To Use - Creating new PRs. - Reviewing existing PR descriptions. - When user asks for PR template. ## Do Not Use - For code review (use code-review skill). - For commit message generation. ## Workflow 1. Analyze code changes and commit history. 2. Extract key changes and affected components. 3. Generate structured description with sections. 4. Include testing instructions and risk assessment. 5. Add relevant labels and reviewers. ## Output - Structured PR description template. - Suggested labels and reviewers. - Testing and deployment notes.13. 推荐 Skills 模板
以下是10个高价值、可立即使用的Skill模板,覆盖常见开发和工作场景:
| Skill 名称 | 适用场景 | 核心价值 | 触发关键词 |
|---|---|---|---|
| 代码审查 | 代码变更审查 | 标准化审查流程,提高代码质量 | $code-review, “审查代码”, “检查PR” |
| 文档审查 | 技术文档质量检查 | 确保文档准确性和完整性 | $docs-review, “检查文档”, “文档质量” |
| 发布检查 | 软件发布前验证 | 避免发布事故,确保发布质量 | $release-check, “发布前检查”, “发布清单” |
| PR描述生成 | Pull Request 创建 | 规范PR描述,提高评审效率 | $pr-description, “生成PR描述”, “PR模板” |
| API设计审查 | API接口设计评审 | 确保API一致性和最佳实践 | $api-review, “API设计检查”, “接口规范” |
| 安全扫描 | 代码安全漏洞检查 | 早期发现安全风险 | $security-scan, “安全检查”, “漏洞扫描” |
| 性能分析 | 代码性能优化 | 识别性能瓶颈,提供优化建议 | $performance-review, “性能检查”, “优化建议” |
| 测试用例生成 | 测试覆盖率提升 | 自动生成测试用例,提高测试质量 | $test-generation, “生成测试”, “测试用例” |
| 架构文档生成 | 系统架构文档维护 | 保持架构文档与代码同步 | $arch-docs, “架构文档”, “系统文档” |
| 依赖更新审查 | 依赖库版本更新 | 安全、兼容的依赖更新建议 | $dependency-review, “依赖更新”, “版本检查” |
详细模板示例
API 设计审查 Skill
--- name: api-review description: Use when designing or reviewing REST/GraphQL APIs. Focus on consistency, versioning, error handling, and documentation. --- # API Design Review ## When To Use - Designing new API endpoints. - Reviewing existing API designs. - When user asks for API best practices. ## Workflow 1. Review endpoint structure and naming. 2. Check HTTP methods and status codes. 3. Validate request/response schemas. 4. Review authentication and authorization. 5. Check error handling and rate limiting. 6. Verify documentation completeness. ## Output - Consistency issues found. - Security and performance concerns. - Documentation gaps. - Specific improvement recommendations.安全扫描 Skill
--- name: security-scan description: Use when reviewing code for security vulnerabilities. Focus on common vulnerabilities like injection, XSS, CSRF, and insecure configurations. --- # Security Scan ## When To Use - New code needs security review. - Before production deployment. - When user asks for security assessment. ## Workflow 1. Scan for common vulnerability patterns. 2. Check authentication and authorization. 3. Review data validation and sanitization. 4. Check dependency security. 5. Verify secure configuration. 6. Assess logging and monitoring. ## Output - Critical vulnerabilities found. - Security best practice violations. - Remediation steps. - Priority recommendations.如何选择适合的 Skill
根据团队需求选择
- 开发团队:代码审查、PR描述、测试生成
- DevOps团队:发布检查、安全扫描、依赖审查
- 文档团队:文档审查、架构文档
按使用频率排序
- 高频任务优先(如代码审查)
- 关键质量门禁(如安全扫描)
- 团队协作痛点(如PR描述)
逐步实施建议
- 从1-2个核心Skill开始
- 收集反馈并迭代优化
- 建立Skill维护流程
自定义模板建议
每个团队可以根据自己的技术栈和工作流程调整这些模板:
添加团队特定规则
- 公司编码规范
- 部署流程要求
- 合规性检查项
集成现有工具
- CI/CD流水线
- 代码分析工具
- 文档系统
设置质量门槛
- 必须通过的检查项
- 建议改进项
- 信息性提醒
通过使用这些标准化Skill模板,团队可以快速建立一致的工作流程,提高代码质量和开发效率。sks-
