
Adk Cheatsheet
Look up Python Google ADK APIs for agents, tools, sessions, and orchestration while editing an existing agent codebase—not for bootstrapping new projects.
Overview
ADK Cheatsheet is an agent skill for the Build phase that supplies a Python Google ADK API quick reference before you write or modify agent, tool, or orchestration code in existing projects.
Install
npx skills add https://github.com/google/adk-docs --skill adk-cheatsheetWhat is this skill?
- Python ADK quick reference: Agent types, Tool variants, Session, State, and orchestration patterns
- Covers callbacks, plugins, artifacts, context caching/compaction, and session rewind
- Points to references/python.md and adk.dev llms.txt index for full doc fetches
- Explicit handoff: new projects use adk-scaffold instead of this skill
- Apache-2.0 Google-maintained reference skill with scoped triggers
- Python-only cheatsheet coverage with references/python.md and adk.dev llms.txt index
Adoption & trust: 2.7k installs on skills.sh; 1.4k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are editing ADK Python code but keep guessing agent types, tool wrappers, session state, and callback APIs from fragmented docs.
Who is it for?
Solo builders maintaining or extending an existing Python ADK agent repo who want a single pre-flight reference before implementation.
Skip if: Greenfield ADK project creation (use adk-scaffold) or teams needing non-Python ADK languages until those cheatsheets ship.
When should I use this skill?
MUST READ before writing or modifying ADK agent code in an existing Python project; do NOT use for creating new projects.
What do I get? / Deliverables
Your agent applies ADK-correct patterns from the cheatsheet and references/python.md, and you reach for adk-scaffold only when creating a new project.
- ADK-aligned code changes guided by API quick reference
- Correct use of agents, tools, sessions, and orchestration primitives
Recommended Skills
Journey fit
Canonical shelf is Build because the skill gates hands-on ADK implementation work after a project already exists. Agent-tooling fits a procedural API cheatsheet for LLM agents, tools, callbacks, and state primitives in the ADK SDK.
How it compares
Use as a read-first API crib sheet for existing repos, not as a scaffold generator or generic LLM prompt.
Common Questions / FAQ
Who is adk-cheatsheet for?
Indie and solo developers using Claude Code, Cursor, or Codex on Python Google ADK codebases who need authoritative API reminders before changing agents or tools.
When should I use adk-cheatsheet?
Invoke before any ADK code change in Build—agent-tooling tasks such as adding FunctionTool handlers, wiring LlmAgent orchestration, or fixing session state—and skip when you only need a brand-new project layout (use adk-scaffold).
Is adk-cheatsheet safe to install?
Review the Security Audits panel on this Prism page for license, provenance, and any reported risks before trusting it in production agent workflows.
Workflow Chain
Then invoke: adk scaffold
SKILL.md
READMESKILL.md - Adk Cheatsheet
# ADK Cheatsheet > **Python only for now.** This cheatsheet currently covers the Python ADK SDK. > Support for other languages is coming soon. ## Reference Files | File | Contents | |------|----------| | `references/python.md` | Python ADK API quick reference — agents, tools, auth, orchestration, callbacks, plugins, state, artifacts, context caching/compaction, session rewind | Read `references/python.md` for the full API quick reference. For the ADK docs index (titles and URLs for fetching documentation pages), use `curl https://adk.dev/llms.txt`. > **Creating a new agent project?** Use `/adk-scaffold` instead — this skill is for writing code in existing projects. # ADK Python Cheatsheet ## 1. Core Concepts & Project Structure ### Essential Primitives * **`Agent`**: The core intelligent unit. Can be `LlmAgent` (LLM-driven) or `BaseAgent` (custom/workflow). * **`Tool`**: Callable function providing external capabilities (`FunctionTool`, `AgentTool`, etc.). * **`Session`**: A stateful conversation thread with history (`events`) and short-term memory (`state`). * **`State`**: Key-value dictionary within a `Session` for transient conversation data. * **`Runner`**: The execution engine; orchestrates agent activity and event flow. * **`Event`**: Atomic unit of communication; carries content and side-effect `actions`. ### Standard Project Layout ``` your_project_root/ ├── <agent_name>/ or app/ # Agent code directory │ ├── __init__.py │ ├── agent.py # Contains root_agent definition │ ├── tools.py # Custom tool functions │ └── .env # Environment variables ├── tests/ │ ├── eval/ │ │ ├── eval_config.json # Eval criteria and thresholds │ │ └── evalsets/ # Eval datasets (JSON) │ ├── integration/ │ └── unit/ └── pyproject.toml or requirements.txt ``` --- ## 2. Agent Definitions (`LlmAgent`) ### Basic Setup ```python from google.adk.agents import Agent def get_weather(city: str) -> dict: """Returns weather for a city.""" return {"status": "success", "weather": "sunny", "temp": 72} my_agent = Agent( name="weather_agent", model="gemini-3-flash-preview", instruction="You help users check the weather. Use the get_weather tool.", description="Provides weather information.", # Important for multi-agent delegation tools=[get_weather] ) ``` ### Key Configuration Options ```python from google.genai import types as genai_types from google.adk.agents import Agent agent = Agent( name="my_agent", model="gemini-3-flash-preview", instruction="Your instructions here. Use {state_key} for dynamic injection.", description="Description for delegation.", # LLM generation parameters generate_content_config=genai_types.GenerateContentConfig( temperature=0.2, max_output_tokens=1024, ), # Save final output to state output_key="agent_response", # Control history sent to LLM include_contents='default', # 'default' or 'none' # Delegation control disallow_transfer_to_parent=False, disallow_transfer_to_peers=False, # Sub-agents for delegation sub_agents=[specialist_agent], # Tools tools=[my_tool], # Callbacks before_agent_callback=my_callback, after_agent_callback=my_callback, before_model_callback=my_callback, after_model_callback=my_callback, before_tool_callback=my_callback, after_tool_callback=my_callback, ) ``` ### Structured Output with Pydantic > **Warning**: Using `output_schema` disables tool calling and delegation. ```