google-agents-cli-adk-code

bởi google

Kỹ năng này nên được sử dụng khi người dùng muốn "viết mã tác tử", "xây dựng tác tử với ADK", "thêm công cụ", "tạo callback", "định nghĩa tác tử", "sử dụng quản lý trạng thái", hoặc cần các mẫu mã và ví dụ về API Python của ADK (Bộ công cụ phát triển tác tử). Là một phần của bộ kỹ năng Google ADK. Cung cấp tài liệu tham khảo nhanh về các loại tác tử, định nghĩa công cụ, mẫu điều phối, callback và quản lý trạng thái. KHÔNG sử dụng để tạo dự án mới (sử dụng google-agents-cli-scaffold) hoặc triển khai...

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

ADK Code Reference

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

1. Study Recipes (No Project Needed)

Read the topic index in references/samples.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.

The index only gives you a name; the recipe is the code. Clone it and read its AGENTS.md before you implement anything it covers. Hand-writing a Docker or E2B sandbox wrapper, a skill loader, a moderation callback or a memory store — for a capability the index lists — means you stopped at the name.

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>.
  3. Existing code: run agents-cli scaffold enhance ..

Language Support: This reference covers the Python ADK SDK. Support for other languages 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-3.7-flash",
    instruction="You are a helpful assistant that ...",
    tools=[get_weather],
)

References

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

ReferenceWhen to read
references/samples.mdTopic-indexed catalog of ADK reference recipes. Read in workflow Phase 1 — before scaffolding and before writing code — maps a capability to the recipe that implements it.
references/adk-python.mdCore ADK API: Agent, tools, callbacks, plugins, state, artifacts, multi-agent systems, SequentialAgent / ParallelAgent / LoopAgent, custom BaseAgent, ManagedAgent (server-hosted first-party agents), A2A protocol, A2UI. 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

Thêm skills từ google

google-agents-cli-eval
google
Kỹ năng này nên được sử dụng khi người dùng muốn "chạy đánh giá", "đánh giá ADK agent của tôi", "viết tập dữ liệu đánh giá", "phân tích lỗi đánh giá", "so sánh kết quả đánh giá", "tối ưu hóa agent", hoặc cần hướng dẫn về phương pháp đánh giá của Agent Platform và Quality Flywheel. Bao gồm các chỉ số đánh giá, lược đồ tập dữ liệu, chấm điểm LLM-as-judge và các nguyên nhân lỗi phổ biến. KHÔNG sử dụng cho các mẫu mã API (sử dụng google-agents-cli-adk-code), triển khai (sử dụng google-agents-cli-deploy) hoặc tạo khung dự án (sử dụng...
developmenttestingdata-analysis
google-agents-cli-workflow
google
Kỹ năng này nên được sử dụng khi người dùng muốn "phát triển một tác nhân", "xây dựng tác nhân bằng ADK", "chạy tác nhân cục bộ", "gỡ lỗi mã tác nhân", "kiểm thử tác nhân", "triển khai tác nhân", "xuất bản tác nhân", "giám sát tác nhân", hoặc cần vòng đời phát triển ADK (Bộ công cụ phát triển tác nhân) và hướng dẫn viết mã. Điểm vào để xây dựng tác nhân ADK. Luôn hoạt động — cung cấp quy trình làm việc đầy đủ (tạo khung, xây dựng, đánh giá, triển khai, xuất bản, quan sát
developmentdevopstesting
google-agents-cli-deploy
google
Kỹ năng này nên được sử dụng khi người dùng muốn "triển khai một tác nhân", "triển khai tác nhân ADK của tôi", "thiết lập CI/CD", "cấu hình bí mật", "khắc phục sự cố triển khai", hoặc cần hướng dẫn về Agent Runtime, Cloud Run, hoặc các mục tiêu triển khai GKE. Bao gồm các quy trình triển khai, tài khoản dịch vụ, rollback và cơ sở hạ tầng sản xuất. Là một phần của bộ kỹ năng Google ADK (Agent Development Kit). KHÔNG sử dụng cho các mẫu mã API (sử dụng google-agents-cli-adk-code), đánh giá (sử dụng google-agents-cli-eval), hoặc...
developmentdevops
google-agents-cli-scaffold
google
Kỹ năng này nên được sử dụng khi người dùng muốn "tạo một dự án agent", "bắt đầu một dự án ADK mới", "xây dựng cho tôi một agent mới", "thêm CI/CD vào dự án của tôi", "thêm triển khai", "nâng cấp dự án của tôi" hoặc "cải tiến dự án của tôi". Một phần của
developmentdevops
google-agents-cli-observability
google
Kỹ năng này nên được sử dụng khi người dùng muốn "thiết lập theo dõi", "giám sát tác nhân ADK của tôi", "cấu hình ghi nhật ký", "thêm khả năng quan sát", "gỡ lỗi lưu lượng sản xuất", hoặc cần hướng dẫn về giám sát các tác nhân ADK (Agent Development Kit) đã triển khai. Bao gồm Cloud Trace, ghi nhật ký phản hồi-prompt, BigQuery Agent Analytics, tích hợp bên thứ ba (AgentOps, Phoenix, MLflow, v.v.) và khắc phục sự cố. Là một phần của bộ kỹ năng Google ADK (Agent Development Kit). KHÔNG sử dụng cho thiết lập triển khai (sử dụng...
developmentdevopsapi
google-agents-cli-publish
google
Kỹ năng này nên được sử dụng khi người dùng muốn "xuất bản một agent", "xuất bản agent ADK của tôi", "đăng ký agent với Gemini Enterprise", "xuất bản lên Gemini Enterprise", hoặc cần hướng dẫn về lệnh agents-cli publish gemini-enterprise. Bao gồm các chế độ đăng ký ADK và A2A, cách sử dụng theo chương trình và tương tác, tham chiếu cờ, tự động phát hiện từ siêu dữ liệu triển khai, và khắc phục sự cố. Là một phần của bộ kỹ năng Google ADK (Bộ công cụ phát triển Agent). KHÔNG sử dụng cho việc triển khai (sử dụng...
developmentdevopsapi