Files
nexus/wiki/concepts/Generator.md
2026-04-22 16:03:25 +08:00

1.1 KiB

title, type, tags, sources, last_updated
title type tags sources last_updated
Generator concept
Agent
Skill
Design Pattern
ADK
google-5个agent-skill设计模式-2026-03-19
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: 样式规范
→ 用户填空 → 生成结构化输出
  • ToolWrapper:应用知识的模式
  • Reviewer:检查生成的输出
  • Inversion:可在 Generator 开头依赖 Inversion 收集必要变量

Connections