adk

zchee 的头像作者 zchee

使用 Google 的代理开发工具包 (ADK) — 特别是 Go SDK (google/adk-go) 构建、调试和发布代理。当用户要求创建/修改 ADK 代理、工具、工作流程、启动器配置、测试、评估或连接 ADK 和外部工具的 MCP 工具集时触发。

📖 中文导读:使用 Google 的代理开发工具包 (ADK) — 特别是 Go SDK (google/adk-go) 构建、调试和发布代理。当用户要求创建/修改 ADK 代理、工具、工作流程、启动器配置、测试、评估或连接 ADK 和外部工具的 MCP 工具集时触发。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: adk description: Build, debug, and ship agents with Google’s Agent Development Kit (ADK) — especially the Go SDK (google/adk-go). Trigger when users ask to create/modify ADK agents, tools, workflows, launcher configs, tests, evaluations, or MCP toolsets bridging ADK and external tools.

How to use this skill

  • Use for: standing up or editing ADK agents (Go focus), wiring tools (gemini, MCP), running launcher/web UI, testing/evaluation, debugging orchestration.
  • Load external refs only as needed to save context.

Quick references (load on demand)

Prereqs

  • Go ≥ 1.24.4, ADK Go ≥ v0.2.0.
  • API key (e.g., GOOGLE_API_KEY for Gemini) in env/.env.
  • go get google.golang.org/adk@latest to pull SDK; run go mod tidy.

Core workflows

  • New agent: create module; implement llmagent.New or workflow agents; prefer toolsets over ad hoc HTTP calls.
  • Tools: start with built-ins (geminitool.GoogleSearch, etc.); add custom tools via functiontool.New or MCP bridge (mcptoolset.New with mcp.NewInMemoryTransports during tests).
  • Launcher: use cmd/launcher/full for web UI + CLI; set AgentLoader to your agent(s).
  • Sessions & memory: use session.InMemoryService() for local dev; avoid globals.
  • Instruction templates: keep placeholders {var}; resolve via instructionutil.InjectSessionState.
  • Testing: table-driven tests := map[string]struct{...}; use t.Context(); cover tool packing and event stream diffs with go-cmp; include httprr traces for LLM/http.
  • Evaluation: mirror ADK eval guides—assert both final response and step events; prefer deterministic prompts.

Troubleshooting

  • Version drift: pin ADK and genai versions together; update go.sum if proto mismatch.
  • Tool errors: check CallToolResult.IsError and message content; surface actionable details.
  • API key missing: ensure env before launcher/web UI.
  • MCP bridging: if no structuredContent, pack text response under output.

Suggested prompts to trigger this skill

  • “Design a Go ADK agent that does ___; include tools and launcher setup.”
  • “Add an MCP toolset to my ADK agent for ___ API; show code + config.”
  • “Write tests for an ADK tool using httprr and go-cmp.”
  • “Debug why my ADK agent’s GoogleSearch tool isn’t returning results.”