# ADK Agent Code Guide

Gives patterns for ADK agents, tools, callbacks, state and workflow orchestration.

- Repository: https://github.com/google/agents-cli (6276 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-10-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add google/agents-cli --skill google-agents-cli-adk-code -g -a claude-code -y`
Codex: `npx skills add google/agents-cli --skill google-agents-cli-adk-code -g -a codex -y`
Cursor: `npx skills add google/agents-cli --skill google-agents-cli-adk-code -g -a cursor -y`
Gemini CLI: `npx skills add google/agents-cli --skill google-agents-cli-adk-code -g -a gemini-cli -y`

## 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", in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# ADK Code Reference

Activate `/google-agents-cli-workflow` first for required development phases and scaffolding steps.

## 1. Study Recipes (No Project Needed)

**Python, read the topic index in `references/recipes.md` before answering "how do I build X".**
Worked implementations exist for: sandboxed/per-user code execution, agent-loadable `SKILL.md`
skills, cross-session memory, approval gates before risky actions, tool guardrails, per-user
credentials, and scheduled/event-driven runs.

**Go, read the upstream [`examples/`](https://github.com/google/adk-go/tree/main/examples).**
clone the repo and read the one matching the capability you need before implementing it.

## 2. Prerequisites for Writing Code

Do NOT write agent code until a project is scaffolded.

1. Verify project: run `agents-cli info` (proceed if config exists).
2. New project: run `agents-cli scaffold create <name> --agent adk_python --deployment-target <target>`, use `--agent adk_go` for Go.
3. Existing code: run `agents-cli scaffold enhance .`.

## Quick Reference, Most Common Patterns

See `references/adk-python.md` and `references/adk-go.md` for Python and Go code examples, respectively.

---

## References

Use the cheatsheets for common patterns. For deep knowledge, fetch the docs index or inspect the
installed package.

The rest: https://github.com/google/agents-cli/blob/HEAD/skills/google-agents-cli-adk-code/SKILL.md
