adk-scaffold by google/adk-docs
npx skills add https://github.com/google/adk-docs --skill adk-scaffold使用 agent-starter-pack CLI(通过 uvx)创建新的 ADK 智能体项目,或为现有项目添加部署、CI/CD 和基础设施脚手架。
从用例开始,然后根据回答进行后续提问。
始终询问:
根据上下文询问:
--agent agentic_rag --datastore <choice>:
vertex_ai_vector_search — 用于嵌入、相似性搜索、向量搜索vertex_ai_search — 用于文档搜索、搜索引擎广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
--agent adk_a2a 将智能体暴露为 A2A 兼容的服务。撰写一份详细的规范,包含以下部分。在搭建脚手架之前,请将完整的规范呈现给用户批准。
# DESIGN_SPEC.md
## 概述
用 2-3 段描述智能体的目的和工作方式。
## 示例用例
3-5 个具体的示例,包含预期的输入和输出。
## 所需工具
列出每个工具及其用途、API 详情和认证需求。
## 约束与安全规则
具体的规则 — 不仅仅是通用声明。
## 成功标准
用于评估的可衡量结果。
## 需要处理的边缘情况
至少 3-5 个智能体必须妥善处理的场景。
该规范应足够详尽,以便其他开发人员无需额外上下文即可实现该智能体。
uvx agent-starter-pack create <project-name> \
--agent <template> \
--deployment-target <target> \
--region <region> \
--prototype \
-y
约束:
create 之前不要 mkdir 项目目录 — CLI 会自动创建它。如果先 mkdir,create 会失败或行为异常。--agent-guidance-filename。app/ 中,请传递 --agent-directory <dir>(例如 --agent-directory agent)。如果弄错,会导致增强操作遗漏或放错文件。| 标志 | 简写 | 默认值 | 描述 |
|---|---|---|---|
--agent | -a | adk | 智能体模板(见下方模板表) |
--deployment-target | -d | agent_engine | 部署目标(agent_engine、cloud_run、gke、none) |
--region | us-central1 | GCP 区域 | |
--prototype | -p | off | 跳过 CI/CD 和 Terraform(推荐用于首次尝试) |
--cicd-runner | skip | github_actions 或 google_cloud_build | |
--datastore | -ds | — | 用于数据摄取的数据存储(vertex_ai_search、vertex_ai_vector_search) |
--session-type | in_memory | 会话存储(in_memory、cloud_sql、agent_engine) | |
--auto-approve | -y | off | 跳过确认提示 |
--skip-checks | -s | off | 跳过 GCP/Vertex AI 验证检查 |
--agent-directory | -dir | app | 智能体代码目录名称 |
--agent-guidance-filename | GEMINI.md | 指导文件名称(CLAUDE.md、AGENTS.md) | |
--debug | off | 启用调试日志以进行故障排除 |
默认情况下,脚手架项目使用 Google Cloud 凭据(Vertex AI)。有关 API 密钥设置和模型配置,请参阅 配置 Gemini 模型 和 支持的模型。
uvx agent-starter-pack enhance . \
--deployment-target <target> \
-y
在项目目录内运行此命令(或传递路径代替 .)。请记住,增强操作会创建需要提交的新文件(.github/、deployment/、tests/load_test/ 等)。
支持所有创建标志,外加:
| 标志 | 简写 | 默认值 | 描述 |
|---|---|---|---|
--name | -n | 目录名称 | 用于模板化的项目名称 |
--base-template | -bt | — | 覆盖基础模板(例如 agentic_rag 以添加 RAG) |
--dry-run | off | 预览更改而不应用 | |
--force | off | 强制覆盖所有文件(跳过智能合并) |
运行这些命令前务必询问用户。 呈现选项(CI/CD 运行器、部署目标等)并在执行前确认。
# 为现有原型添加部署
uvx agent-starter-pack enhance . --deployment-target agent_engine -y
# 添加 CI/CD 流水线(询问:GitHub Actions 还是 Cloud Build?)
uvx agent-starter-pack enhance . --cicd-runner github_actions -y
# 添加带数据摄取的 RAG
uvx agent-starter-pack enhance . --base-template agentic_rag --datastore vertex_ai_search -y
# 预览将发生的更改(试运行)
uvx agent-starter-pack enhance . --deployment-target cloud_run --dry-run -y
| 模板 | 部署目标 | 描述 |
|---|---|---|
adk | Agent Engine, Cloud Run, GKE | 标准 ADK 智能体(默认) |
adk_a2a | Agent Engine, Cloud Run, GKE | 智能体间协调(A2A 协议) |
agentic_rag | Agent Engine, Cloud Run, GKE | 带数据摄取流水线的 RAG |
| 目标 | 描述 |
|---|---|
agent_engine | 由 Google 托管(Vertex AI Agent Engine)。会话自动处理。 |
cloud_run | 基于容器的部署。控制权更大,需要 Dockerfile。 |
gke | 基于 GKE Autopilot 的容器。完全的 Kubernetes 控制权。 |
none | 无部署脚手架。仅代码。 |
开始时使用 --prototype 以跳过 CI/CD 和 Terraform。首先专注于让智能体工作,然后稍后使用 enhance 添加部署:
# 步骤 1:创建原型
uvx agent-starter-pack create my-agent --agent adk --prototype -y
# 步骤 2:迭代智能体代码...
# 步骤 3:准备就绪后添加部署
uvx agent-starter-pack enhance . --deployment-target agent_engine -y
当使用 agent_engine 作为部署目标时,Agent Engine 在内部管理会话。如果你的代码设置了 session_type,请清除它 — Agent Engine 会覆盖它。
搭建脚手架后,将步骤 2 中批准的规范保存到项目根目录下的 DESIGN_SPEC.md。
然后立即加载 /adk-dev-guide — 它包含开发工作流、编码指南和你在实现智能体时必须遵循的操作规则。
当你需要特定文件(Terraform、CI/CD 工作流、Dockerfile)但不想直接为当前项目搭建脚手架时,请在 /tmp/ 中创建一个临时的参考项目:
uvx agent-starter-pack create /tmp/ref-project \
--agent adk \
--deployment-target cloud_run \
--cicd-runner github_actions \
-y
检查生成的文件,根据需要调整,然后复制到实际项目中。完成后删除参考项目。
这在以下情况下很有用:
enhance 无法处理的非标准项目结构create 之前切勿 mkdir — CLI 会创建目录;预先创建会导致进入增强模式而非创建模式agent_engine,请从代码中移除任何 session_type 设置--prototype 开始 — 稍后使用 enhance 添加部署AgentCard 模式、to_a2a() 签名)非常复杂且会跨版本变化。始终使用 --agent adk_a2a 来搭建 A2A 项目脚手架。使用脚手架作为参考:用户说:"我需要为我的非标准项目准备一个 Dockerfile" 操作:
uvx agent-starter-pack create /tmp/ref --agent adk --deployment-target cloud_run -yA2A 项目:用户说:"为我构建一个暴露 A2A 并部署到 Cloud Run 的 Python 智能体" 操作:
uvx agent-starter-pack create my-a2a-agent --agent adk_a2a --deployment-target cloud_run --prototype -y 结果:有效的 A2A 导入和 Dockerfile — 无需手动编写 A2A 代码。uvx 命令未找到按照 官方安装指南 安装 uv。
如果 uv 不可用,请改用 pip:
# macOS/Linux
python -m venv .venv && source .venv/bin/activate
# Windows
python -m venv .venv && .venv\Scripts\activate
pip install agent-starter-pack
agent-starter-pack create <project-name> ...
要查看所有可用选项,请运行 uvx agent-starter-pack create --help。
每周安装量
1.1K
仓库
GitHub Stars
1.3K
首次出现
Mar 9, 2026
安全审计
安装于
gemini-cli1.1K
codex1.1K
opencode1.1K
cursor1.1K
github-copilot1.1K
amp1.1K
Use the agent-starter-pack CLI (via uvx) to create new ADK agent projects or enhance existing ones with deployment, CI/CD, and infrastructure scaffolding.
Start with the use case, then ask follow-ups based on answers.
Always ask:
Ask based on context:
--agent agentic_rag --datastore <choice>:
vertex_ai_vector_search — for embeddings, similarity search, vector searchvertex_ai_search — for document search, search engine--agent adk_a2a to expose the agent as an A2A-compatible service.Compose a detailed spec with these sections. Present the full spec for user approval before scaffolding.
# DESIGN_SPEC.md
## Overview
2-3 paragraphs describing the agent's purpose and how it works.
## Example Use Cases
3-5 concrete examples with expected inputs and outputs.
## Tools Required
Each tool with its purpose, API details, and authentication needs.
## Constraints & Safety Rules
Specific rules — not just generic statements.
## Success Criteria
Measurable outcomes for evaluation.
## Edge Cases to Handle
At least 3-5 scenarios the agent must handle gracefully.
The spec should be thorough enough for another developer to implement the agent without additional context.
uvx agent-starter-pack create <project-name> \
--agent <template> \
--deployment-target <target> \
--region <region> \
--prototype \
-y
Constraints:
mkdir the project directory before running create — the CLI creates it automatically. If you mkdir first, create will fail or behave unexpectedly.--agent-guidance-filename accordingly.app/, pass --agent-directory <dir> (e.g. --agent-directory agent). Getting this wrong causes enhance to miss or misplace files.| Flag | Short | Default | Description |
|---|---|---|---|
--agent | -a | adk | Agent template (see template table below) |
--deployment-target | -d | agent_engine | Deployment target (agent_engine, , , ) |
By default, the scaffolded project uses Google Cloud credentials (Vertex AI). For API key setup and model configuration, see Configuring Gemini models and Supported models.
uvx agent-starter-pack enhance . \
--deployment-target <target> \
-y
Run this from inside the project directory (or pass the path instead of .). Remember that enhance creates new files (.github/, deployment/, tests/load_test/, etc.) that need to be committed.
All create flags are supported, plus:
| Flag | Short | Default | Description |
|---|---|---|---|
--name | -n | directory name | Project name for templating |
--base-template | -bt | — | Override base template (e.g. agentic_rag to add RAG) |
--dry-run | off |
Always ask the user before running these commands. Present the options (CI/CD runner, deployment target, etc.) and confirm before executing.
# Add deployment to an existing prototype
uvx agent-starter-pack enhance . --deployment-target agent_engine -y
# Add CI/CD pipeline (ask: GitHub Actions or Cloud Build?)
uvx agent-starter-pack enhance . --cicd-runner github_actions -y
# Add RAG with data ingestion
uvx agent-starter-pack enhance . --base-template agentic_rag --datastore vertex_ai_search -y
# Preview what would change (dry run)
uvx agent-starter-pack enhance . --deployment-target cloud_run --dry-run -y
| Template | Deployment | Description |
|---|---|---|
adk | Agent Engine, Cloud Run, GKE | Standard ADK agent (default) |
adk_a2a | Agent Engine, Cloud Run, GKE | Agent-to-agent coordination (A2A protocol) |
agentic_rag | Agent Engine, Cloud Run, GKE | RAG with data ingestion pipeline |
| Target | Description |
|---|---|
agent_engine | Managed by Google (Vertex AI Agent Engine). Sessions handled automatically. |
cloud_run | Container-based deployment. More control, requires Dockerfile. |
gke | Container-based on GKE Autopilot. Full Kubernetes control. |
none | No deployment scaffolding. Code only. |
Start with --prototype to skip CI/CD and Terraform. Focus on getting the agent working first, then add deployment later with enhance:
# Step 1: Create a prototype
uvx agent-starter-pack create my-agent --agent adk --prototype -y
# Step 2: Iterate on the agent code...
# Step 3: Add deployment when ready
uvx agent-starter-pack enhance . --deployment-target agent_engine -y
When using agent_engine as the deployment target, Agent Engine manages sessions internally. If your code sets a session_type, clear it — Agent Engine overrides it.
After scaffolding, save the approved spec from Step 2 to the project root as DESIGN_SPEC.md.
Then immediately load/adk-dev-guide — it contains the development workflow, coding guidelines, and operational rules you must follow when implementing the agent.
When you need specific files (Terraform, CI/CD workflows, Dockerfile) but don't want to scaffold the current project directly, create a temporary reference project in /tmp/:
uvx agent-starter-pack create /tmp/ref-project \
--agent adk \
--deployment-target cloud_run \
--cicd-runner github_actions \
-y
Inspect the generated files, adapt what you need, and copy into the actual project. Delete the reference project when done.
This is useful for:
enhance can't handlemkdir before create — the CLI creates the directory; pre-creating it causes enhance mode instead of create modeagent_engine, remove any session_type setting from your code--prototype for quick iteration — add deployment later with enhanceUsing scaffold as reference: User says: "I need a Dockerfile for my non-standard project" Actions:
uvx agent-starter-pack create /tmp/ref --agent adk --deployment-target cloud_run -yA2A project: User says: "Build me a Python agent that exposes A2A and deploys to Cloud Run" Actions:
uvx agent-starter-pack create my-a2a-agent --agent adk_a2a --deployment-target cloud_run --prototype -y Result: Valid A2A imports and Dockerfile — no manual A2A code written.uvx command not foundInstall uv following the official installation guide.
If uv is not an option, use pip instead:
# macOS/Linux
python -m venv .venv && source .venv/bin/activate
# Windows
python -m venv .venv && .venv\Scripts\activate
pip install agent-starter-pack
agent-starter-pack create <project-name> ...
For all available options, run uvx agent-starter-pack create --help.
Weekly Installs
1.1K
Repository
GitHub Stars
1.3K
First Seen
Mar 9, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli1.1K
codex1.1K
opencode1.1K
cursor1.1K
github-copilot1.1K
amp1.1K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
103,800 周安装
cloud_rungkenone--region | us-central1 | GCP region |
--prototype | -p | off | Skip CI/CD and Terraform (recommended for first pass) |
--cicd-runner | skip | github_actions or google_cloud_build |
--datastore | -ds | — | Datastore for data ingestion (vertex_ai_search, vertex_ai_vector_search) |
--session-type | in_memory | Session storage (in_memory, cloud_sql, agent_engine) |
--auto-approve | -y | off | Skip confirmation prompts |
--skip-checks | -s | off | Skip GCP/Vertex AI verification checks |
--agent-directory | -dir | app | Agent code directory name |
--agent-guidance-filename | GEMINI.md | Guidance file name (CLAUDE.md, AGENTS.md) |
--debug | off | Enable debug logging for troubleshooting |
| Preview changes without applying |
--force | off | Force overwrite all files (skip smart-merge) |
AgentCardto_a2a()--agent adk_a2a