ADK Code Reference
Before using this skill, activate /google-agents-cli-workflow first — it contains the required development phases and scaffolding steps.
Prerequisites
- Run
agents-cli info — if it shows project config, skip to the reference below
- If no project exists: run
agents-cli scaffold create <name>
- If user has existing code: run
agents-cli scaffold enhance .
Do NOT write agent code until a project is scaffolded.
Python only for now. This reference currently covers the Python ADK SDK.
Support for other languages is coming soon.
Quick Reference — Most Common Patterns
from google.adk.agents import Agent
def get_weather(city: str) -> dict:
"""Get current weather for a city."""
return {"city": city, "temp": "22°C", "condition": "sunny"}
root_agent = Agent(
name="my_agent",
model="gemini-flash-latest",
instruction="You are a helpful assistant that ...",
tools=[get_weather],
)
References
The first two are cheatsheets for common patterns; for broad or deep knowledge, go to the source (docs index or installed package).
| Reference |
When to read |
references/adk-python.md |
Core ADK API: Agent, tools, callbacks, plugins, state, artifacts, multi-agent systems, SequentialAgent / ParallelAgent / LoopAgent, custom BaseAgent. Default for most agents. |
references/adk-workflows.md |
Graph-based Workflow API (ADK 2.0): nodes, edges, fan-out/fan-in, HITL, parallel processing. Use when you need explicit graph topology. |
curl https://adk.dev/llms.txt |
Docs index (every page title + URL). Fetch it, then WebFetch the specific page for anything beyond the cheatsheets. |
| Installed ADK package |
Exact signatures and symbols — inspect the source (see "Inspecting ADK Source Code" in references/adk-python.md). |
Related Skills
/google-agents-cli-workflow — Development workflow, coding guidelines, and operational rules
/google-agents-cli-scaffold — Project creation and enhancement with agents-cli scaffold create / scaffold enhance
/google-agents-cli-eval — Evaluation methodology, dataset schema, and the eval-fix loop
/google-agents-cli-deploy — Deployment targets, CI/CD pipelines, and production workflows
1---2name: google-agents-cli-adk-code3description: This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management", or needs ADK (Agent Development Kit) Python API patterns and code examples. Part of the Google ADK skills suite. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, and state management. Do NOT use for creating new projects (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).4---5
6# ADK Code Reference
7
8> **Before using this skill**, activate `/google-agents-cli-workflow` first — it contains the required development phases and scaffolding steps.
9
10## Prerequisites
11
121. Run `agents-cli info` — if it shows project config, skip to the reference below
132. If no project exists: run `agents-cli scaffold create <name>`
143. If user has existing code: run `agents-cli scaffold enhance .`
15
16Do NOT write agent code until a project is scaffolded.
17
18> **Python only for now.** This reference currently covers the Python ADK SDK.
19> Support for other languages is coming soon.
20
21## Quick Reference — Most Common Patterns
22
23```python
24from google.adk.agents import Agent
25
26def get_weather(city: str) -> dict:
27 """Get current weather for a city."""
28 return {"city": city, "temp": "22°C", "condition": "sunny"}
29
30root_agent = Agent(
31 name="my_agent",
32 model="gemini-flash-latest",
33 instruction="You are a helpful assistant that ...",
34 tools=[get_weather],
35)
36```
37
38---
39
40## References
41
42The first two are cheatsheets for common patterns; for broad or deep knowledge, go to the source (docs index or installed package).
43
44| Reference | When to read |
45|------|-------------|
46| `references/adk-python.md` | Core ADK API: `Agent`, tools, callbacks, plugins, state, artifacts, multi-agent systems, `SequentialAgent` / `ParallelAgent` / `LoopAgent`, custom `BaseAgent`. Default for most agents. |
47| `references/adk-workflows.md` | Graph-based Workflow API (ADK 2.0): nodes, edges, fan-out/fan-in, HITL, parallel processing. Use when you need explicit graph topology. |
48| `curl https://adk.dev/llms.txt` | Docs index (every page title + URL). Fetch it, then `WebFetch` the specific page for anything beyond the cheatsheets. |
49| Installed ADK package | Exact signatures and symbols — inspect the source (see "Inspecting ADK Source Code" in `references/adk-python.md`). |
50
51## Related Skills
52
53- `/google-agents-cli-workflow` — Development workflow, coding guidelines, and operational rules
54- `/google-agents-cli-scaffold` — Project creation and enhancement with `agents-cli scaffold create` / `scaffold enhance`
55- `/google-agents-cli-eval` — Evaluation methodology, dataset schema, and the eval-fix loop
56- `/google-agents-cli-deploy` — Deployment targets, CI/CD pipelines, and production workflows