Anthropic 出了 Agent Skills 的开放规范,这篇论文教你用软件工程方法写技能,有 Claude Code 的实操细节,还有和其他机制的选择规则,搞 agent 开发的值得看。
Anthropic 发布了 Agent Skills 的开放规范,支持在多种代理工具中按需加载可复用的过程性知识。该论文主张技能应视为软件工件,遵循单一职责、接口与实现分离、低耦合、共享 token 预算等软件工程原则,并用行为评估取代确定性测试。论文以 Claude Code 为参考实现,详细说明了技能的结构、分阶段加载机制以及影响选择的描述编写方法。作者对比了技能与项目记忆文件、斜杠命令、子代理、外部工具连接和钩子等机制,给出了基于“谁决定执行”和“提供什么保证”的选择规则。论文还提出了评估驱动的编写流程、常见模式和故障,并探讨了第三方技能的可信问题。
Authoring Agent Skills: A Software-Engineering Approach
Agent Skills are an emerging way to extend large language model agents with reusable procedural knowledge that the agent loads on demand. Anthropic introduced Agent Skills and published the format as an open specification supported across several agent tools. This note argues that a skill is a software artefact and that its construction should follow software-engineering principles, with qualifications: single responsibility, separation of interface from implementation, low coupling, and economy in a shared token budget, together with behavioural evaluation in place of deterministic testing. Using Claude Code as the reference implementation, it describes how a skill is structured, how its contents are loaded in stages, and how to write the description on which selection depends. It places skills against the other mechanisms a developer can use to shape agent behaviour, like project memory files, slash commands, subagents, external tool connections, and hooks, and gives a rule for choosing between them based on who decides that a mechanism runs and what guarantee it provides. It then sets out an evaluation-driven authoring process, a set of patterns and faults commonly encountered in authoring, and the trust question raised by using skills from third parties. We illustrate the comparison drawn in UML class style, the loading model, the anatomy of a skill, the relative position of each mechanism, and the points at which skills and hooks act during a session.