google-agents-cli-adk-code

作者: google

當使用者想要「撰寫代理程式碼」、「使用 ADK 建置代理程式」、「新增工具」、「建立回呼」、「定義代理程式」、「使用狀態管理」,或需要 ADK(代理程式開發套件)Python API 模式與程式碼範例時,應使用此技能。屬於 Google ADK 技能套件的一部分。提供代理程式類型、工具定義、編排模式、回呼與狀態管理的快速參考。請勿用於建立新專案(請使用 google-agents-cli-scaffold)或部署...

npx skills add https://github.com/google/agents-cli --skill google-agents-cli-adk-code

ADK Code Reference

Before using this skill, activate /google-agents-cli-workflow first — it contains the required development phases and scaffolding steps.

Prerequisites

  1. Run agents-cli info — if it shows project config, skip to the reference below
  2. If no project exists: run agents-cli scaffold create <name>
  3. 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).

ReferenceWhen to read
references/adk-python.mdCore ADK API: Agent, tools, callbacks, plugins, state, artifacts, multi-agent systems, SequentialAgent / ParallelAgent / LoopAgent, custom BaseAgent. Default for most agents.
references/adk-workflows.mdGraph-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.txtDocs index (every page title + URL). Fetch it, then WebFetch the specific page for anything beyond the cheatsheets.
Installed ADK packageExact 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 with agents-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

來自 google 的更多技能

google-agents-cli-eval
google
當使用者想要「執行評估」、「評估我的 ADK 代理」、「撰寫評估資料集」、「分析評估失敗原因」、「比較評估結果」、「優化代理」,或需要 Agent Platform 評估方法論與品質飛輪的指引時,應使用此技能。涵蓋評估指標、資料集結構、LLM 作為評審的評分方式,以及常見的失敗原因。請勿用於 API 程式碼模式(請使用 google-agents-cli-adk-code)、部署(請使用 google-agents-cli-deploy)或專案架構生成(請使用...
developmenttestingdata-analysis
google-agents-cli-workflow
google
此技能應在使用者想要「開發代理」、「使用 ADK 建置代理」、「在本機執行代理」、「除錯代理程式碼」、「測試代理」、「部署代理」、「發布代理」、「監控代理」,或需要 ADK(代理開發套件)開發生命週期與編碼指南時使用。為建置 ADK 代理的進入點。始終啟用 — 提供完整工作流程(建立框架、建置、評估、部署、發布、監控)、程式碼保留規則、模型選擇指引,以及...
developmentdevopstesting
google-agents-cli-deploy
google
當使用者想要「部署代理程式」、「部署我的ADK代理程式」、「設定CI/CD」、「設定機密」、「疑難排解部署」,或需要關於Agent Runtime、Cloud Run或GKE部署目標的指引時,應使用此技能。涵蓋部署工作流程、服務帳戶、回滾及生產基礎架構。屬於Google ADK(代理程式開發套件)技能套件的一部分。請勿用於API程式碼模式(請使用google-agents-cli-adk-code)、評估(請使用google-agents-cli-eval)或...
developmentdevops
google-agents-cli-scaffold
google
This skill should be used when the user wants to "create an agent project", "start a new ADK project", "build me a new agent", "add CI/CD to my project", "add deployment", "enhance my project", or "upgrade my project". Part of the Google ADK (Agent Development Kit) skills suite. Covers `agents-cli scaffold create`, `scaffold enhance`, and `scaffold upgrade` commands, template options, deployment targets, and the prototype-first workflow. Do NOT use for writing agent code (use...
developmentdevops
google-agents-cli-observability
google
此技能應在使用者想要「設定追蹤」、「監控我的 ADK 代理程式」、「設定記錄」、「加入可觀測性」、「偵錯正式環境流量」,或需要關於監控已部署 ADK(代理程式開發套件)代理程式的指引時使用。涵蓋 Cloud Trace、提示-回應記錄、BigQuery 代理程式分析、第三方整合(AgentOps、Phoenix、MLflow 等)以及疑難排解。屬於 Google ADK(代理程式開發套件)技能套件的一部分。請勿用於部署設定(請使用...
developmentdevopsapi
google-agents-cli-publish
google
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini Enterprise", "publish to Gemini Enterprise", or needs guidance on the agents-cli publish gemini-enterprise command. Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, and troubleshooting. Part of the Google ADK (Agent Development Kit) skills suite. Do NOT use for deployment (use...
developmentdevopsapi