Auto-sync: 2026-04-27 08:02

This commit is contained in:
2026-04-27 08:02:55 +08:00
parent 1c7c7d673e
commit fbd6107be4
58 changed files with 2532 additions and 964 deletions

View File

@@ -1,39 +1,42 @@
---
title: "Generator"
type: concept
tags: [Agent, Skill, Design Pattern, ADK]
sources: [google-5个agent-skill设计模式-2026-03-19]
last_updated: 2026-03-19
---
## Overview
Generator 是 Google ADK 发布的 5 种 Agent Skill 设计模式之一,通过"填空"流程从模板生成结构化输出,强制一致的输出格式。
## Mechanism
- 利用两个可选目录:
- `assets/`:存放输出模板
- `references/`:存放样式指南
- SKILL.md 扮演项目经理角色
- 流程:加载模板 → 读取样式指南 → 向用户询问缺失变量 → 填充文档
## Use Cases
- 生成统一的 API 文档
- 标准化 commit 信息
- 脚手架项目结构生成
## Implementation
```
SKILL.md: 项目经理角色
assets/template.md: 输出模板
references/style-guide.md: 样式规范
→ 用户填空 → 生成结构化输出
```
## Related Concepts
- [[ToolWrapper]]:应用知识的模式
- [[Reviewer]]:检查生成的输出
- [[Inversion]]:可在 Generator 开头依赖 Inversion 收集必要变量
## Connections
- [[Google5个AgentSkill设计模式]] ← part_of ← [[Generator]]
- [[ADK]] ← published_by ← [[Generator]]
---
title: "Generator 模式"
type: concept
tags: [Agent, Skill, Design Pattern, ADK]
sources: [google-5个agent-skill设计模式-2026-03-19]
last_updated: 2026-05-15
---
## Overview
Generator 是 Google ADK 发布的 5 种 Agent Skill 设计模式之一,通过"填空"流程从模板生成结构化输出,强制保证输出格式的一致性
## Mechanism
- 利用两个可选目录:`assets/` 存放输出模板,`references/` 存放样式指南
- SKILL.md 扮演项目经理的角色
- 指示 Agent 加载模板、读取样式指南、向用户询问缺失的变量、然后填充文档
## Use Cases
- 生成统一的 API 文档
- 标准化 commit 信息
- 脚手架项目结构生成
- 任何需要保持格式一致的结构化输出
## Implementation
```
assets/output-template.md: 输出模板
references/style-guide.md: 样式指南
SKILL.md: 项目经理角色,引导 Agent 填充模板
→ 向用户询问缺失变量 → 填充文档 → 输出
```
## Key Insight
> 如果 Tool Wrapper 是应用知识Generator 则是强制一致的输出格式。很多 agent 每次运行生成的文档结构都不一样Generator 完美解决这个问题。
## Related Concepts
- [[ToolWrapper]]应用知识Generator 生成结构,两者互补
- [[Inversion]]:可以在开头依赖 Inversion 来收集必要的变量
- [[Reviewer]]:可以审查 Generator 生成的输出
- [[渐进式披露]]:类似的按需加载思想
## Connections
- [[Google5个AgentSkill设计模式]] ← part_of ← [[Generator]]
- [[ADK]] ← published_by ← [[Generator]]