google-agents-cli-adk-code
google/agents-cli
Quick reference for ADK Python API patterns, tools, callbacks, and agent code examples.
What is google-agents-cli-adk-code?
Use this skill when writing agent code, defining tools, managing state, or building multi-agent systems with the Google Agent Development Kit (ADK). It provides cheatsheets for common patterns and links to detailed references. Do not use for project creation (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
- Reference core ADK API: Agent, tools, callbacks, plugins, and state management
- Define tool functions and integrate them into agents
- Build multi-agent systems with SequentialAgent, ParallelAgent, and LoopAgent
- Access graph-based Workflow API (ADK 2.0) for explicit topology control
- Inspect installed ADK package source code for exact signatures and symbols
- Link to comprehensive docs index and detailed references
How to install google-agents-cli-adk-code
npx skills add https://github.com/google/agents-cli --skill google-agents-cli-adk-code- agents-cli installed via uv tool install google-agents-cli
- Project scaffolded with agents-cli scaffold create or agents-cli scaffold enhance
- agents-cli info showing valid project config
How to use google-agents-cli-adk-code
- 1.Verify project is scaffolded by running agents-cli info
- 2.Consult references/adk-python.md for core Agent, tools, callbacks, and state patterns
- 3.Consult references/adk-workflows.md if you need graph-based topology
- 4.Use the quick reference code examples as templates for your agent definition
- 5.For detailed API signatures, inspect the installed ADK package source code
- 6.Fetch https://adk.dev/llms.txt for the docs index and link to specific pages as needed
Use cases
- Writing a basic agent with tools and custom instructions
- Adding new tool functions to an existing agent
- Implementing callbacks for agent lifecycle events
- Building multi-agent orchestration patterns
- Managing agent state and artifacts across interactions
- Python developers building agents with ADK
- Backend engineers implementing multi-agent systems
- AI engineers designing agent orchestration patterns
- Developers extending agents with custom tools and callbacks
google-agents-cli-adk-code FAQ
Use this skill to write and modify agent code after a project is scaffolded. Use google-agents-cli-scaffold to create new projects or enhance existing ones.
Python is currently supported. Support for other languages is coming soon.
Define a Python function with a docstring, then pass it in the tools list when creating an Agent: Agent(name='my_agent', tools=[my_function]).
ADK Python API is the default for most agents and covers Agent, tools, callbacks, and state. Workflow API (ADK 2.0) is graph-based and better for explicit topology, fan-out/fan-in, and parallel processing.
Inspect the installed ADK package source code directly, or fetch https://adk.dev/llms.txt for the docs index and WebFetch specific pages.
Full instructions (SKILL.md)
Source of truth, from google/agents-cli.
name: google-agents-cli-adk-code description: > 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). metadata: author: Google license: Apache-2.0 version: 0.6.1 requires: bins: - agents-cli install: "uv tool install google-agents-cli"
ADK Code Reference
Before using this skill, activate
/google-agents-cli-workflowfirst — 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, A2A protocol, A2UI. 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 withagents-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
Related skills
More from google/agents-cli and the wider catalog.
google-agents-cli-workflow
CLI toolkit for building, evaluating, and deploying agents on Google Cloud using the Agent Development Kit (ADK).
google-agents-cli-eval
Evaluate and optimize ADK agents with built-in metrics, LLM-as-judge scoring, and failure analysis.
google-agents-cli-scaffold
Scaffold new ADK agent projects and add deployment, CI/CD, and infrastructure.
google-agents-cli-observability
Set up tracing, logging, and monitoring for ADK agents with Cloud Trace, BigQuery, and third-party platforms.
google-agents-cli-deploy
Deploy ADK agents to Agent Runtime, Cloud Run, or GKE with managed infrastructure and CI/CD.
google-agents-cli-publish
Publish and register agents with Gemini Enterprise via ADK or A2A modes.