bygoogle· 116 skills
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).
$npx -y skills add google/agents-cli --skill google-agents-cli-adk-codeInstalls into the current project.
Run `npx skills use "https://github.com/google/agents-cli" --skill "google/agents-cli/google-agents-cli-adk-code"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/google/agents-cli" that are relevant to the current task. Run `npx skills add "https://github.com/google/agents-cli"` and select the relevant skills, then follow their instructions.
| 1 | # ADK Code Reference |
| 2 | |
| 3 | > **Before using this skill**, activate `/google-agents-cli-workflow` first — it contains the required development phases and scaffolding steps. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | 1. Run `agents-cli info` — if it shows project config, skip to the reference below |
| 8 | 2. If no project exists: run `agents-cli scaffold create <name>` |
| 9 | 3. If user has existing code: run `agents-cli scaffold enhance .` |
| 10 | |
| 11 | Do NOT write agent code until a project is scaffolded. |
| 12 | |
| 13 | > **Python only for now.** This reference currently covers the Python ADK SDK. |
| 14 | > Support for other languages is coming soon. |
| 15 | |
| 16 | ## Quick Reference — Most Common Patterns |
| 17 | |
| 18 | ```python |
| 19 | from google.adk.agents import Agent |
| 20 | |
| 21 | def get_weather(city: str) -> dict: |
| 22 | """Get current weather for a city.""" |
| 23 | return {"city": city, "temp": "22°C", "condition": "sunny"} |
| 24 | |
| 25 | root_agent = Agent( |
| 26 | name="my_agent", |
| 27 | model="gemini-3.6-flash", |
| 28 | instruction="You are a helpful assistant that ...", |
| 29 | tools=[get_weather], |
| 30 | ) |
| 31 | ``` |
| 32 | |
| 33 | --- |
| 34 | |
| 35 | ## References |
| 36 | |
| 37 | The first two are cheatsheets for common patterns; for broad or deep knowledge, go to the source (docs index or installed package). |
| 38 | |
| 39 | | Reference | When to read | |
| 40 | |------|-------------| |
| 41 | | `references/adk-python.md` | Core ADK API: `Agent`, tools, callbacks, plugins, state, artifacts, multi-agent systems, `SequentialAgent` / `ParallelAgent` / `LoopAgent`, custom `BaseAgent`, `ManagedAgent` (server-hosted first-party agents), A2A protocol, A2UI. Default for most agents. | |
| 42 | | `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. | |
| 43 | | `curl https://adk.dev/llms.txt` | Docs index (every page title + URL). Fetch it, then `WebFetch` the specific page for anything beyond the cheatsheets. | |
| 44 | | Installed ADK package | Exact signatures and symbols — inspect the source (see "Inspecting ADK Source Code" in `references/adk-python.md`). | |
| 45 | |
| 46 | ## Related Skills |
| 47 | |
| 48 | - `/google-agents-cli-workflow` — Development workflow, coding guidelines, and operational rules |
| 49 | - `/google-agents-cli-scaffold` — Project creation and enhancement with `agents-cli scaffold create` / `scaffold enhance` |
| 50 | - `/google-agents-cli-eval` — Evaluation methodology, dataset schema, and the eval-fix loop |
| 51 | - `/google-agents-cli-deploy` — Deployment targets, CI/CD pipelines, and production workflows |