Trupeer Blog

SOP 到 AI Agent 技能:如何将 SOP 转成 SKILL.md 文件

SOP 到 AI Agent 技能:如何将 SOP 转成 SKILL.md 文件

总结

目录

使用 AI 创建令人惊艳的产品视频和文档

免费开始使用

你的团队花了多年时间编写SOP:如何处理发票、如何为供应商入驻、如何重置用户的访问权限、如何处理退款。现在AI代理正在进入每一个运营团队,它们也需要指引。好消息是,你不必从零开始。编写良好的SOP已经包含了代理可靠完成任务所需的大部分内容:目的、步骤、规则,以及更关键的例外情况。

本指南将从SOP到AI代理技能,展示如何使用SKILL.md格式把SOP转化为技能。你将了解什么是代理技能、SOP的每个部分如何映射为技能、如何把“例外”部分转化为防护栏、一个完整示例、逐步方法,以及在允许代理执行业务流程之前你需要的治理机制。

什么是AI代理技能?

What an AI agent skill is: a folder with a SKILL.md file and progressive disclosure

AI代理技能是一套被打包的指令,当任务需要时,AI代理可以加载这些指令。在开放的Agent Skills格式中,技能是一个文件夹,包含一个SKILL.md文件,以及可选的脚本、参考文档和其他资源。SKILL.md文件以YAML前置信息(frontmatter)开头,其中只需要两个字段:name和description。其余内容是普通的Markdown指令。

技能采用渐进式披露。代理首先只看到每个技能的名称和描述;当任务匹配时,它会加载完整的SKILL.md,并且只有在需要时才打开任何被引用的文件。这样可以让大型技能库保持高效。该格式最初由Anthropic开发,并于2025年12月作为开放标准发布;如今已被许多代理平台支持。

为什么SOP能成为优秀的AI代理技能?

Why SOPs make good AI agent skills

SOP和代理技能有很多共同点。两者都在既定规则下,逐步描述如何完成某个特定任务。优秀的SOP已经提供:

  • 清晰的目的与范围,它会成为技能的描述以及触发条件。

  • 编号步骤,它会成为代理的指令。

  • 前置条件,用于告诉代理在开始之前需要什么。

  • 例外情况,它会成为防护栏:当出现问题时该做什么,或不该做什么。

  • 控制与审批,它会成为人类必须做出决定的检查点。

  • 负责人和版本,让技能像其他任何流程一样受到治理管理。

把SOP转化为AI代理技能,会复用你们组织已经批准的工作,而不是编写新的、未经测试的提示词。如果你的SOP很长,建议先把它拆成按任务划分的部分;参见如何把SOP拆分为知识文章。

SOP到AI代理技能:每个SOP部分如何映射到SKILL.md?

How each SOP section maps to a SKILL.md file

SOP部分

SKILL.md元素

要做什么

标题

name(frontmatter)

使用简短的小写、连字符命名,例如process-vendor-invoice

目的与范围

description(frontmatter)

用一到两句话说明技能做什么、何时使用

前置条件与输入

“开始前(Before you start)”部分

列出代理需要的信息、访问权限和文档

流程步骤

“步骤(Steps)”部分

把每一步改写为直接、可测试的指令

例外情况

“防护栏(Guardrails)”部分

把每个例外转化为规则:当X发生时,做Y;或停止并升级

控制与审批

“人工检查点(Human checkpoints)”部分

写出代理必须交给人的决策

参考资料

references/文件夹中的文件

把长表格、政策和代码清单从SKILL.md中移出

负责人、版本、审核日期

注释或元数据部分

确保技能与已批准的SOP版本保持关联

如何把SOP的例外情况转化为代理防护栏?

Turning SOP exceptions into agent guardrails

例外情况部分是SOP中对代理最有价值的内容。因为经验丰富的人会把“哪里会出错”以及“该怎么处理”写下来。对代理而言,这些例外会变成防护栏;每一条都应转化为三种形式之一的规则:

  • 处理它:“如果发票总额与采购订单(PO)的差异小于容差,继续并记录差异。”

  • 停止并升级:“如果供应商的银行信息与供应商主数据不同,停止。不要付款。把该案例提交给应付账款(AP)主管。”

  • 绝不做:“绝不创建或更改供应商的银行信息。”

好的防护栏应当具体、可测试且保守。SOP里如果写着“使用判断”,技能通常也应写成“停止并询问人工”,至少在代理尚未用真实案例测试之前应如此。还要把SOP里默认就考虑到的内容也加入防护栏:代理可以使用哪些系统、哪些数据必须不对外暴露,以及哪些操作无法撤销。

示例:把一份发票SOP转化为技能

Example SKILL.md file created from an invoice SOP

下面是一个基于应付账款(AP)发票SOP的简化示例。该SOP涵盖将供应商发票与采购订单匹配,并对价格差异、缺失收据以及银行信息变更设置了例外。

---
name: match-vendor-invoice
description: Matches a vendor invoice to its purchase order and goods receipt in the ERP and flags exceptions. Use when an AP invoice needs three-way matching before payment.
---
# Match a vendor invoice
Source SOP: AP-014, version 2.1. Owner: AP process owner.
## Before you start
- You need the invoice PDF, the PO number and read access to the ERP.
- Read references/tolerances.md for current price and quantity tolerances.
## Steps
1. Extract supplier, invoice number, date, amount and PO number from the invoice.
2. Check the invoice number has not already been posted for this supplier.
3. Retrieve the PO and goods receipt from the ERP.
4. Compare quantities and prices line by line against the tolerances.
5. If everything is within tolerance, mark the invoice "ready to post" and record the match.
## Guardrails
- If the invoice is a duplicate, stop and flag it. Do not post.
- If there is no goods receipt, hold the invoice and notify the buyer.
- If a variance exceeds tolerance, hold the invoice and send it to the AP clerk with the variance details.
- If supplier bank details on the invoice differ from the vendor master, stop and escalate to the AP supervisor.
- Never change vendor master data. Never release payments.
## Human checkpoints
- An AP clerk approves every held invoice before it is posted

---
name: match-vendor-invoice
description: Matches a vendor invoice to its purchase order and goods receipt in the ERP and flags exceptions. Use when an AP invoice needs three-way matching before payment.
---
# Match a vendor invoice
Source SOP: AP-014, version 2.1. Owner: AP process owner.
## Before you start
- You need the invoice PDF, the PO number and read access to the ERP.
- Read references/tolerances.md for current price and quantity tolerances.
## Steps
1. Extract supplier, invoice number, date, amount and PO number from the invoice.
2. Check the invoice number has not already been posted for this supplier.
3. Retrieve the PO and goods receipt from the ERP.
4. Compare quantities and prices line by line against the tolerances.
5. If everything is within tolerance, mark the invoice "ready to post" and record the match.
## Guardrails
- If the invoice is a duplicate, stop and flag it. Do not post.
- If there is no goods receipt, hold the invoice and notify the buyer.
- If a variance exceeds tolerance, hold the invoice and send it to the AP clerk with the variance details.
- If supplier bank details on the invoice differ from the vendor master, stop and escalate to the AP supervisor.
- Never change vendor master data. Never release payments.
## Human checkpoints
- An AP clerk approves every held invoice before it is posted

---
name: match-vendor-invoice
description: Matches a vendor invoice to its purchase order and goods receipt in the ERP and flags exceptions. Use when an AP invoice needs three-way matching before payment.
---
# Match a vendor invoice
Source SOP: AP-014, version 2.1. Owner: AP process owner.
## Before you start
- You need the invoice PDF, the PO number and read access to the ERP.
- Read references/tolerances.md for current price and quantity tolerances.
## Steps
1. Extract supplier, invoice number, date, amount and PO number from the invoice.
2. Check the invoice number has not already been posted for this supplier.
3. Retrieve the PO and goods receipt from the ERP.
4. Compare quantities and prices line by line against the tolerances.
5. If everything is within tolerance, mark the invoice "ready to post" and record the match.
## Guardrails
- If the invoice is a duplicate, stop and flag it. Do not post.
- If there is no goods receipt, hold the invoice and notify the buyer.
- If a variance exceeds tolerance, hold the invoice and send it to the AP clerk with the variance details.
- If supplier bank details on the invoice differ from the vendor master, stop and escalate to the AP supervisor.
- Never change vendor master data. Never release payments.
## Human checkpoints
- An AP clerk approves every held invoice before it is posted

该示例仅用于说明;请根据你自己的SOP、容差和检查点来调整步骤。关于该示例所基于的完整SOP,请参见AP发票处理SOP指南。

如何一步步把SOP转化为AI代理技能?

Nine steps to turn SOPs into AI agent skills

步骤1:选择合适的SOP

从一份已批准、最新且基于规则的SOP开始,适用于输入输出清晰、例外数量可控、犯错成本较低的任务。高频且理解充分的任务是很好的首选;参见如何在已记录的流程中识别自动化机会。

步骤2:确认SOP是最新的

代理会毫不犹豫地执行过时的步骤。在你转换之前,先检查SOP的版本、负责人和审核日期,并修正任何与系统不再匹配的内容;参见SOP版本控制。

步骤3:编写名称和描述

为技能提供清晰的名称和描述,说明它做什么以及何时使用。描述是代理首先看到的内容,因此它会据此判断技能是否在正确的时间被使用。

步骤4:把步骤改写为指令

把每个SOP步骤改写为代理可以遵循的直接指令,并且你也能对其进行测试。移除代理不需要的逐屏细节,只保留它需要做出的决策和规则。使用一致的SOP模板编写的SOP更容易转换,因为每个流程的各个部分在相同顺序下都保持一致。

步骤5:把例外转化为防护栏

逐行处理“例外情况”部分,把每一条都转化为“处理它”“停止并升级”或“绝不做”的规则。

步骤6:添加人工检查点

把每一次审批、不可逆操作以及需要判断的环节标记为:代理必须在此处把任务交给人工处理。

步骤7:把长参考资料移出去

让SKILL.md保持聚焦。把政策、代码清单和容差表放到单独的参考文件中,代理只在需要时才打开。

步骤8:用真实案例测试

用逼真的示例运行该技能,包括SOP中的每一条例外,并将代理的结果与经验丰富的人会做出的结果进行对比。

步骤9:版本管理、归属与保持同步

把每个技能与其来源SOP和版本建立关联;指定负责人;当SOP发生变化时更新技能。

Trupeer在其中扮演什么角色?

当SOP本身准确、最新且完整(包括例外情况)时,把SOP转化为AI代理技能的效果最好。Trupeer在两端都能提供帮助:

Recording a real procedure in Trupeer AISOP generated from a recording in Trupeer AI, ready to become an agent skill
  • 捕捉真实流程:使用Trupeer的AI屏幕录制器录下经验丰富的人执行任务的过程,并在讲解中涵盖规则与例外;随后Trupeer会把录制内容转化为逐步SOP。

  • 生成你需要的文档结构:Trupeer的技能功能会把自定义指令、格式规则和文档结构打包成可复用的资源,并应用到录制内容上。你可以先配置一个模板,用于生成符合SKILL.md结构的输出,然后将其导出为Markdown。

  • 保持最新:当流程发生变化时,更新录制内容或SOP并重新生成输出,这样代理技能与人工SOP就能保持同步。

代理技能需要哪些治理机制?

Governance checklist for AI agent skills

在让代理通过技能运行业务流程之前,请先建立基础治理机制:

  • 仅使用已批准的SOP,并为每个技能指定负责人。

  • 给予代理所需的最小访问权限,在可能的情况下使用只读访问。

  • 对付款、数据变更以及任何不可逆操作要求人工审批。

  • 记录代理所做的事情,以便对操作进行审查与审计。

  • 仅安装可信的技能,并审查其中打包的任何脚本。

  • SOP变更时要复核技能,并对不再使用的流程停用对应技能。

如需了解代理如何更广泛地访问你的知识,请参见通过MCP将视频知识库与AI代理集成。

把SOP转化为代理技能时常见的错误

  • 把过时的SOP转换过来,导致代理执行已不再适用的步骤。

  • 遗漏例外情况,让代理只剩“顺利路径”。

  • 描述不清,导致技能在错误时间被使用,或根本不被使用。

  • 把所有内容放在一个文件里,而不是让SKILL.md保持精简并把参考资料移出去。

  • 跳过人工检查点用于审批与不可逆操作。

  • 没有负责人,导致技能与SOP逐渐脱节。

SOP到AI代理技能清单

  • SOP已获批准、是最新的,并且有负责人。

  • 技能有清晰的名称和描述,说明做什么以及何时做。

  • 步骤已被改写为直接、可测试的指令。

  • 每个例外都是防护栏:处理、停止并升级,或绝不做。

  • 审批与不可逆操作是人工检查点。

  • 长参考资料放在独立文件中。

  • 该技能已在真实案例中完成测试,包括例外情况。

  • 该技能与其来源SOP版本建立了关联,并且有负责人。

常见问题

什么是SKILL.md文件?

它是AI代理技能的核心文件。它以包含至少名称和描述的YAML前置信息开始,随后是Markdown指令;当技能被触发时,代理会遵循这些指令。

如何把SOP转换为AI代理技能?

将SOP的标题映射到技能名称,将其目的映射到描述,将其步骤映射到指令,将其例外映射到防护栏,并将其审批映射到人工检查点;然后测试该技能,并确保与SOP保持同步。

为什么代理技能中的SOP例外情况很重要?

例外情况描述了会出什么问题以及如何处理。转化为防护栏后,它们会告诉代理:何时继续、何时停止并升级,以及它绝不能做什么。

应该先把哪些SOP转化为代理技能?

适用于高频任务的已批准、最新、基于规则的SOP:输入输出清晰、例外数量可控、犯错成本较低。

AI代理技能会取代SOP吗?

不会。SOP仍然是供人员和审计人员使用的已批准流程。技能是为代理编写的该流程的一个版本,两者应保持同步。

代理技能能包含脚本吗?

可以。技能可以把脚本和其他文件与SKILL.md一起打包,但请仔细审查任何被打包的代码,并只给代理它所需的访问权限。

如何让代理技能保持最新?

把每个技能与其来源SOP版本关联起来,指定负责人;当SOP或底层系统发生变化时,更新该技能。

Trupeer如何帮助从SOP创建代理技能?

Trupeer会把录制内容转化为准确的SOP,而它的技能功能允许你把可复用的指令和格式应用到录制内容上。这样你就能生成符合所需结构的输出,并将其导出为Markdown。

把你最好的SOP转化为代理可运行的技能

你的SOP已经记录了应该如何开展工作,包括当出现问题时该怎么做。把合适的SOP转化为AI代理技能:用其例外情况中的防护栏来约束,并在关键决策点引入人工;同时随着流程变化保持两者同步。立即使用Trupeer免费开始。

常见问题

什么是 SKILL.md 文件?

It's the core file of an AI agent skill. It starts with YAML frontmatter containing at least a name and a description, followed by markdown instructions the agent follows when the skill is triggered.

如何将 SOP 转化为 AI 代理技能?

Map the SOP's title to the skill name, its purpose to the description, its steps to instructions, its exceptions to guardrails and its approvals to human checkpoints, then test the skill and keep it in sync with the SOP.

为什么 SOP 例外对代理技能很重要?

Exceptions describe what goes wrong and how to handle it. Turned into guardrails, they tell the agent when to continue, when to stop and escalate, and what it must never do.

应优先将哪些 SOP 转化为代理技能?

Approved, current, rule-based SOPs for high-volume tasks with clear inputs and outputs, manageable exceptions and a low cost of mistakes.

AI 代理技能会取代 SOP 吗?

No. The SOP remains the approved procedure for people and auditors. The skill is a version of it written for an agent, and the two should be kept in sync.

代理技能能包含脚本吗?

Yes. Skills can bundle scripts and other files alongside SKILL.md, but review any bundled code carefully and give agents only the access they need.

如何让代理技能保持最新?

Link each skill to its source SOP version, assign an owner, and update the skill whenever the SOP or the underlying system changes.

Trupeer 如何帮助从 SOP 创建代理技能?

Trupeer turns recordings into accurate SOPs, and its Skills feature lets you apply reusable instructions and formatting to recordings, so you can generate output in the structure you need and export it as Markdown.

需要视频剪辑师、翻译和编剧吗?

免费试用 Trupeer

预约演示

需要视频剪辑师、翻译和编剧吗?

免费试用 Trupeer

预约演示

需要视频剪辑师、翻译和编剧吗?

免费试用 Trupeer

预约演示

了解工作如何发生。
将其带入你的下一次转型。

开始免费试用

预约演示

了解工作如何发生。
将其带入你的下一次转型。

开始免费试用

预约演示