将智能体技能视为可复用的软件构件,遵循工程化方法构建与评估。
Authoring Agent Skills: A Software-Engineering Approach
- 把技能当作独立软件模块,分离接口与实现,降低耦合度。
- 通过行为评估替代传统测试,确保技能在真实场景中可靠运行。
- 适合开发者构建可维护、可共享的智能体功能,尤其关注第三方技能信任问题。
Agent Skills 是一种新兴的可复用过程知识形式,允许大语言模型智能体按需加载。本文认为技能应被视为软件制品,其开发应遵循软件工程原则:单一职责、接口与实现分离、低耦合、共享令牌预算下的经济性,并以行为评估取代确定性测试。以 Claude Code 为参考实现,本文描述了技能的结构、分阶段加载机制及选择依赖的描述编写方式。对比了项目记忆文件、斜杠命令、子智能体、外部工具连接和钩子等机制,提出基于执行决策方与保障程度的选择规则。还提出了评估驱动的创作流程、常见模式与陷阱,并讨论了使用第三方技能带来的信任问题。文中以 UML 类图风格展示了技能结构、加载模型、各机制相对位置及技能与钩子在会话中的作用点。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。