Files
nexus/wiki/concepts/AgentSkill设计模式.md

49 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: agent-skill-design-pattern
title: "AgentSkill设计模式"
type: concept
tags: [Agent, Skill, 设计模式]
sources: [Google-5个Agent-Skill设计模式.md]
last_updated: 2026-03-19
---
# AgentSkill设计模式
将领域知识或工作流有效封装进Skill的五种设计模式Google与Anthropic经验总结。
## 五种模式
| 模式 | 核心机制 | 适用场景 |
|------|----------|----------|
| [[ToolWrapper]] | 按需动态加载知识文档 | 编码规范、框架最佳实践 |
| [[Generator]] | 模板+变量填充生成一致输出 | API文档、报告生成 |
| [[Reviewer]] | 检查标准与执行逻辑分离 | 代码审查、安全审计 |
| [[Inversion]] | 先问再做,延迟执行 | 需求分析、项目规划 |
| [[Pipeline]] | 硬性检查点强制顺序执行 | 复杂流水线、质量控制 |
## 核心问题
SKILL.md格式标准化后已被30+主流工具支持同等格式的skill执行效果天差地别。差距在于**内容设计**,而非格式。
## 模式组合
五种模式并非互斥,可以组合使用:
- Pipeline末尾可加Reviewer进行double-check
- Generator开始可用Inversion收集必要变量
- Reviewer可嵌入Pipeline作为质量关卡
## 理论基础
- [[Anthropic]]经验最好的Skill是「工具箱」不是大prompt三条铁律只写Agent不知道的、重点写踩坑清单、给工具不给指令
- [[Google]]ADKSkillToolset和渐进式披露机制agent只在运行时需要时才消耗上下文token加载特定模式
## 与AgenticAI关系
[[AgenticAI]]的发展使得Skill设计从"写好提示词"转向"设计好工作流结构"。五种模式将[[AgenticAI]]的能力通过结构化Skill封装为可复用模块。
## 相关概念
- [[AgentSkill]]Skill的实例化
- [[AgenticAI]]Agent具备自主行动能力
- [[工作流自动化]]Pipeline模式的技术基础