adk-dev-guide
Original:🇺🇸 English
Translated
ALWAYS ACTIVE — read at the start of any ADK agent development session. ADK development lifecycle and mandatory coding guidelines — spec-driven workflow, code preservation rules, model selection, and troubleshooting.
11installs
Sourcegoogle/adk-docs
Added on
NPX Install
npx skill4agent add google/adk-docs adk-dev-guideTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →ADK Development Workflow & Guidelines
Session Continuity
If this is a long session, re-read the relevant skill before each phase —
before writing code, before running evals,
before deploying, before scaffolding.
Context compaction may have dropped earlier skill content.
/adk-cheatsheet/adk-eval-guide/adk-deploy-guide/adk-scaffoldDESIGN_SPEC.md — Your Primary Reference
IMPORTANT: If exists in this project, it is your primary source of truth.
DESIGN_SPEC.mdRead it FIRST to understand:
- Functional requirements and capabilities
- Success criteria and quality thresholds
- Agent behavior constraints
- Expected tools and integrations
The spec is your contract. All implementation decisions should align with it. When in doubt, refer back to DESIGN_SPEC.md.
Phase 1: Understand the Spec
Before writing any code:
- Read thoroughly
DESIGN_SPEC.md - Identify the core capabilities required
- Note any constraints or things the agent should NOT do
- Understand success criteria for evaluation
Phase 2: Build and Implement
Implement the agent logic:
- Write/modify code in the agent directory (check the agent guidance file, e.g. GEMINI.md or CLAUDE.md, for directory name)
- Use (or
make playground) for interactive testing during developmentadk web . - Iterate on the implementation based on user feedback
For ADK API patterns and code examples, use .
/adk-cheatsheetPhase 3: Evaluate
This is the most important phase. Evaluation validates agent behavior end-to-end using evalsets and scoring metrics.
MANDATORY: Activate before running evaluation. It contains the evalset schema, config format, and critical gotchas. Do NOT skip this.
/adk-eval-guideTests () are NOT evaluation. They test code correctness but say nothing about whether the agent behaves correctly. Always run .
pytestadk eval- Start small: Begin with 1-2 sample eval cases, not a full suite
- Run evaluations: (or
adk evalif the project has a Makefile)make eval - Discuss results with the user
- Fix issues and iterate on the core cases first
- Only after core cases pass, add edge cases and new scenarios
- Repeat until quality thresholds are met
Expect 5-10+ iterations here.
Phase 4: Deploy
Once evaluation thresholds are met:
- Deploy when ready — see for deployment options
/adk-deploy-guide
IMPORTANT: Never deploy without explicit human approval.
Operational Guidelines for Coding Agents
Principle 1: Code Preservation & Isolation
When executing code modifications, your paramount objective is surgical precision. You must alter only the code segments directly targeted by the user's request, while strictly preserving all surrounding and unrelated code.
Mandatory Pre-Execution Verification:
Before finalizing any code replacement, verify:
- Target Identification: Clearly define the exact lines or expressions to be changed, based solely on the user's explicit instructions.
- Preservation Check: Ensure all code, configuration values (e.g., ,
model,version), comments, and formatting outside the identified target remain identical.api_key
Example:
- User Request: "Change the agent's instruction to be a recipe suggester."
- Incorrect (VIOLATION):
python
root_agent = Agent( name="recipe_suggester", model="gemini-1.5-flash", # UNINTENDED - model was not requested to change instruction="You are a recipe suggester." ) - Correct (COMPLIANT):
python
root_agent = Agent( name="recipe_suggester", # OK, related to new purpose model="gemini-3-flash-preview", # PRESERVED instruction="You are a recipe suggester." # OK, the direct target )
Principle 2: Execution Best Practices
-
Model Selection — CRITICAL:
- NEVER change the model unless explicitly asked. If the code uses , keep it as
gemini-3-flash-preview. Do NOT "upgrade" or "fix" model names.gemini-3-flash-preview - When creating NEW agents (not modifying existing), use Gemini 3 series: ,
gemini-3-flash-preview.gemini-3-pro-preview - Do NOT use older models (,
gemini-2.0-flash, etc.) unless the user explicitly requests them.gemini-1.5-flash
- NEVER change the model unless explicitly asked. If the code uses
-
Location Matters More Than Model:
- If a model returns a 404, it's almost always a issue (e.g., needing
GOOGLE_CLOUD_LOCATIONinstead ofglobal).us-central1 - Changing the model name to "fix" a 404 is a violation — fix the location instead.
- Some models (like ) require specific locations. Check the error message for hints.
gemini-3-flash-preview
- If a model returns a 404, it's almost always a
-
ADK Built-in Tool Imports (Precision Required):python
# CORRECT - imports the tool instance from google.adk.tools.load_web_page import load_web_page # WRONG - imports the module, not the tool from google.adk.tools import load_web_pagePass the imported tool directly to, nottools=[load_web_page].tools=[load_web_page.load_web_page] -
Running Python Commands:
- Always use to execute Python commands (e.g.,
uv)uv run python script.py - Run (or
make install) before executing scriptsuv sync - Consult and
Makefilefor available commands (if present)README.md
- Always use
-
Breaking Infinite Loops:
- Stop immediately if you see the same error 3+ times in a row
- Don't retry failed operations — fix the root cause first
- RED FLAGS: Lock IDs incrementing, names appending v5->v6->v7, "I'll try one more time" repeatedly
- State conflicts (Error 409: Resource already exists): Import existing resources with instead of retrying creation
terraform import - Tool bugs: Fix source code bugs before continuing — don't work around them
- When stuck: Run underlying commands directly (e.g., CLI) instead of calling problematic tools
terraform
-
Troubleshooting:
- Check first — it covers most common patterns
/adk-cheatsheet - Search the installed ADK package with Glob/Grep/Read (find it with — use
python -c "import google.adk; print(google.adk.__path__[0])"if using uv)uv run python - For ADK docs, see in the cheatsheet skill for WebFetch URLs
references/docs-index.md - For framework questions or GCP products, check official documentation
- When encountering persistent errors, a targeted Google Search often finds solutions faster
- Check
Scaffold as Reference
When you need specific infrastructure files but don't want to scaffold the current project directly, use the skill to create a temporary reference project in and copy over what you need.
/adk-scaffold/tmp/See for full CLI commands and options.
/adk-scaffoldDevelopment Commands
Projects created via the Agent Starter Pack CLI include a Makefile with these commands.
To create or enhance a project, see the skill for full instructions.
For non-scaffolded projects, use the ADK CLI equivalents.
/adk-scaffold| Make (scaffolded) | ADK CLI equivalent | Purpose |
|---|---|---|
| | Interactive local testing |
| | Run unit and integration tests |
| | Run evaluation against evalsets |
| | Check code quality |
| — (scaffolded only) | Set up dev infrastructure (Terraform) |
| — (scaffolded only) | Deploy to dev (requires human approval) |
Skills Version
Troubleshooting hint: If you encounter repeated errors, unexpected tool failures, or instructions in these skills that seem incomplete or reference features you can't find, the skills may be outdated. Run:npx skills check -gIf it reports outdated skills, tell the user to update:npx skills update -gDo NOT run this check on every session — only when you suspect stale skills are causing problems.