写出实用Agent技能的8个技巧,海外百万粉AI大佬全公开!

2026-06-25 11:16:41 0点赞 0收藏 0评论
写出实用Agent技能的8个技巧,海外百万粉AI大佬全公开!

Paolo Perrone(@paoloap),是一位长期在技术论坛上分享生产级实践、读者规模超百万的AI工程师。这是他6月24日在个人博客上分享的8个写出实用Agent技能的心得体会:

  1. 先搞清技能的类型(Know what a skill is)

能力型技能:让 Agent 做到基础模型做不到的事。

偏好型技能:把你自己的工作流固化进去。

动手前,先想清楚你做的是哪一种。

Capability skills help the agent do something the base model can't. Preference skills encode your workflow. Know which you're building.

  1. 写好描述,精准触发(Nail the description)

描述就是触发器。写得模糊,基本不会触发。范围太宽,动不动就误触发。要明确说明「在什么时候、做什么」。

The description is the trigger. Vague = never fires. Too broad = fires on everything. Be specific about what AND when.

  1. 下指令,别写小作文(Write instructions, not essays)

Agent 很聪明。用命令式的句子:「始终使用 interactions.create()」就比「Interactions API 是推荐做法」管用得多。多上示例,一个 5 行的代码片段,效果远好过 5 段文字说明。

Agents are smart. Use directives: "Always use interactions.create()" beats "The Interactions API is the recommended approach." Lead with examples. A 5-line snippet beats a 5-paragraph explanation.

  1. 保持精简(Keep it lean)

别把所有东西都塞进一个文件。文件头信息(frontmatter)会始终加载;正文在触发时才加载;引用内容按需加载。单个 skill.md 尽量控制在 500 行以内。

Don't dump everything into one file. Frontmatter always loads. Body loads when triggered. References load on demand. Keep skill.md under 500 lines.

  1. 正确设置自由度(Set the right level of freedom)

说清结果,别死扣步骤。「更新数据库端口」这种说法,就比「第 1 步:读配置;第 2 步:找 URL;第 3 步:改端口」更好。如果每一步都必须严格按顺序来,那不如直接写成脚本。

Describe outcomes, not procedures. "Update the database port" beats "Step 1: Read config. Step 2: Find URL. Step 3: Update port." If exact steps matter, write a script.

  1. 别忘了定义“不做什么”(Don't skip negative cases)

明确技能在哪些情况下不应触发。既要测试「该触发」的场景,也要测试「不该触发」的场景。

Define when the skill should NOT fire. Test both "should trigger" and "shouldn't trigger" cases.

  1. 上线前先测试透(Test before you ship)

准备 10~20 条测试提示,每条多跑几遍。Agent 的输出不是每次都一样。评判的时候看结果好不好,别纠结执行路径是不是和你预想的一模一样。

Run 10-20 test prompts. Multiple trials per prompt. Agent output is nondeterministic. Grade outcomes, not paths.

  1. 该退役时就退役(Know when to retire)

在不用这个技能的情况下跑一轮评估。如果评估照样通过,说明模型已经把技能学进去了,那就果断让它退役,别留着吃灰。

Run evals without the skill. If they pass, the model absorbed the skill's value. Retire it.

作者声明本文无利益相关,欢迎值友理性交流,和谐讨论~

展开 收起
0评论

当前文章无评论,是时候发表评论了
提示信息

取消
确认
评论举报

相关文章推荐

更多精彩文章
更多精彩文章
最新文章 热门文章
0
扫一下,分享更方便,购买更轻松