Communitygithub.com

majiayu000/claude-skill-registry

使用 Google ADK Python (Agent Development Kit) 建立 AI 代理。適用於多代理系統、工作流程代理(順序/平行/迴圈)、Vertex AI 部署、工具整合及人機協作。

claude-skill-registry 是什麼?

此技能專為協助開發者使用 Google 的 Agent Development Kit (ADK) Python 來建構、評估及部署 AI 代理而設計。ADK 是一個開源、程式碼優先的工具包,支援多種代理類型,包括由大型語言模型驅動、具備動態路由能力的 LlmAgent,以及提供可預測執行模式的 Workflow Agents(如 SequentialAgent、ParallelAgent、LoopAgent)。開發者可以利用預建工具(如 Google 搜尋、程式碼執行)或自訂 Python 函數來擴充代理能力,並透過工具確認流程實現人機協作。此技能涵蓋從安裝、實作模式(單一代理、多代理系統、工作流程)、部署選項(Cloud Run、Vertex AI)到最佳實踐的完整指引,目標是讓代理開發如同傳統軟體工程般系統化。

相容平台✓Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/majiayu000/claude-skill-registry/tree/HEAD/skills/agent/google-adk-python-hoanghd218-landing-page-ai-kien

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Google ADK Python 技能

您是 Google Agent Development Kit (ADK) Python 的專家指南——一個開源、程式碼優先的工具包,用於建構、評估及部署 AI 代理。

使用時機

當使用者需要以下功能時,請使用此技能:

  • 建立具備工具整合與編排能力的 AI 代理
  • 建立具有層級協調功能的多代理系統
  • 實作工作流程代理(順序、平行、迴圈)以實現可預測的管線
  • 將 LLM 驅動的代理與 Google 搜尋、程式碼執行或自訂工具整合
  • 將代理部署至 Vertex AI Agent Engine、Cloud Run 或自訂基礎設施
  • 系統性地評估與測試代理效能
  • 實作工具執行的人機協作核准流程

核心概念

代理類型

LlmAgent:由 LLM 驅動的代理,具備動態路由與自適應行為

  • 使用名稱、模型、指令、描述和工具來定義
  • 支援子代理進行任務委派與協調
  • 根據上下文進行智慧決策

工作流程代理:結構化、可預測的編排模式

  • SequentialAgent:依序執行代理
  • ParallelAgent:同時執行多個代理
  • LoopAgent:使用疊代邏輯重複執行

BaseAgent:自訂代理實作的基礎

關鍵元件

工具生態系統:

  • 預建工具 (google_search、code_execution)
  • 作為工具的自訂 Python 函數
  • OpenAPI 規格整合
  • 工具確認流程以進行人工核准

多代理架構:

  • 層級代理組合
  • 針對特定領域的特化代理
  • 用於任務委派的協調器代理

安裝

# 穩定版本(建議)
pip install google-adk

# 開發版本(最新功能)
pip install git+https://github.com/google/adk-python.git@main

實作模式

單一代理搭配工具

from google.adk.agents import LlmAgent
from google.adk.tools import google_search

agent = LlmAgent(
    name="search_assistant",
    model="gemini-2.5-flash",
    instruction="您是一個樂於助人的助手,會搜尋網路以獲取資訊。",
    description="用於網路查詢的搜尋助手",
    tools=[google_search]
)

多代理系統

from google.adk.agents import LlmAgent

# 特化代理
researcher = LlmAgent(
    name="Researcher",
    model="gemini-2.5-flash",
    instruction="使用網路搜尋徹底研究主題。",
    tools=[google_search]
)

writer = LlmAgent(
    name="Writer",
    model="gemini-2.5-flash",
    instruction="根據研究結果撰寫清晰、引人入勝的內容。",
)

# 協調器代理
coordinator = LlmAgent(
    name="Coordinator",
    model="gemini-2.5-flash",
    instruction="將任務委派給研究員和寫手代理。",
    sub_agents=[researcher, writer]
)

自訂工具建立

from google.adk.tools import Tool

def calculate_sum(a: int, b: int) -> int:
    """計算兩個數字的總和。"""
    return a + b

# 將函數轉換為工具
sum_tool = Tool.from_function(calculate_sum)

agent = LlmAgent(
    name="calculator",
    model="gemini-2.5-flash",
    tools=[sum_tool]
)

順序工作流程

from google.adk.agents import SequentialAgent

workflow = SequentialAgent(
    name="research_workflow",
    agents=[researcher, summarizer, writer]
)

平行工作流程

from google.adk.agents import ParallelAgent

parallel_research = ParallelAgent(
    name="parallel_research",
    agents=[web_researcher, paper_researcher, expert_researcher]
)

人機協作

from google.adk.tools import google_search

# 需要確認的工具
agent = LlmAgent(
    name="careful_searcher",
    model="gemini-2.5-flash",
    tools=[google_search],
    tool_confirmation=True  # 執行前需要核准
)

部署選項

Cloud Run 部署

# 將代理容器化
docker build -t my-agent .

# 部署至 Cloud Run
gcloud run deploy my-agent --image my-agent

Vertex AI Agent Engine

# 部署至 Vertex AI 以實現可擴展的代理託管
# 與 Google Cloud 的受管基礎設施整合

自訂基礎設施

# 在本機或自訂伺服器上執行代理
# 完全控制部署環境

模型支援

針對 Gemini 最佳化:

  • gemini-2.5-flash
  • gemini-2.5-pro
  • gemini-1.5-flash
  • gemini-1.5-pro

與模型無關:雖然針對 Gemini 最佳化,但 ADK 透過標準 API 支援其他 LLM 提供者。

最佳實踐

  1. 程式碼優先哲學:在 Python 中定義代理,以利版本控制、測試和靈活性
  2. 模組化設計:為特定領域建立特化代理,並組合成為系統
  3. 工具整合:善用預建工具,並以自訂函數擴充
  4. 評估:針對測試案例系統性地測試代理
  5. 安全性:對敏感操作實作確認流程
  6. 層級結構:使用協調器代理處理複雜的多代理工作流程
  7. 工作流程選擇:為可預測的管線選擇工作流程代理,為動態路由選擇 LLM 代理

常見使用案例

  • 研究助手:網路搜尋 + 摘要 + 報告生成
  • 程式碼助手:程式碼執行 + 文件撰寫 + 除錯
  • 客戶支援:查詢路由 + 知識庫 + 升級處理
  • 內容創作:研究 + 寫作 + 編輯管線
  • 資料分析:資料擷取 + 處理 + 視覺化
  • 任務自動化:具有條件邏輯的多步驟工作流程

開發 UI

ADK 包含內建介面,可用於:

  • 互動式測試代理行為
  • 除錯工具呼叫與回應
  • 評估代理效能
  • 迭代代理設計

資源

實作工作流程

實作基於 ADK 的代理時:

  1. 定義需求:確定代理能力和所需的工具
  2. 選擇架構:單一代理、多代理或工作流程為基礎
  3. 選擇工具:預建、自訂函數或 OpenAPI 整合
  4. 實作代理:使用指令和工具建立代理定義
  5. 本機測試:使用開發 UI 進行迭代
  6. 新增評估:建立測試案例進行系統性驗證
  7. 部署:選擇 Cloud Run、Vertex AI 或自訂基礎設施
  8. 監控:追蹤代理效能並進行迭代

請記住:ADK 將代理開發視為傳統軟體工程——使用版本控制、撰寫測試,並遵循工程最佳實踐。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

majiayu000/claude-skill-registry

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

majiayu000/claude-skill-registry

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry

BlockRun works with Claude Code and Google Antigravity.

majiayu000/claude-skill-registry

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry

CRITICAL: Use for MolyKit AI chat toolkit. Triggers on: BotClient, OpenAI, SSE streaming, AI chat, molykit, PlatformSend, spawn(), ThreadToken, cross-platform async, Chat widget, Messages, PromptInput, Avatar, LLM

majiayu000/claude-skill-registry

AI and machine learning workflow covering LLM application development, RAG implementation, agent architecture, ML pipelines, and AI-powered features.

majiayu000/claude-skill-registry

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

相關技能