A

adk-scaffold

by @googlev
4.4(21)

在创建或增强任何ADK代理项目前必须阅读的脚手架指南。提供项目结构、初始化和开发流程的最佳实践,确保项目规范高效。

adkcode-generationproject-templatesscaffoldingcli-toolsGitHub
安装方式
npx skills add https://github.com/google/adk-docs --skill adk-scaffold
compare_arrows

Before / After 效果对比

1 组
使用前

每次启动新的ADK智能体项目,都需要手动配置大量文件和目录结构。这不仅耗时,还容易出错,导致项目初期就面临混乱和不一致。

使用后

使用ADK脚手架后,项目初始化变得快速而标准化。它自动生成了最佳实践结构,确保了团队成员间开发环境的一致性,显著提升了效率。

SKILL.md

ADK Project Scaffolding Guide

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.


Step 1: Gather Requirements

Start with the use case, then ask follow-ups based on answers.

Always ask:

  1. What problem will the agent solve? — Core purpose and capabilities
  2. External APIs or data sources needed? — Tools, integrations, auth requirements
  3. Safety constraints? — What the agent must NOT do, guardrails
  4. Deployment preference? — Prototype first (recommended) or full deployment? If deploying: Agent Engine or Cloud Run?

Ask based on context:

  • If retrieval or search over data mentioned (RAG, semantic search, vector search, embeddings, similarity search, data ingestion) → Datastore? Use --agent agentic_rag --datastore <choice>:
    • vertex_ai_vector_search — for embeddings, similarity search, vector search
    • vertex_ai_search — for document search, search engine
  • If agent should be available to other agents → A2A protocol? Use --agent adk_a2a to expose the agent as an A2A-compatible service.
  • If full deployment chosen → CI/CD runner? GitHub Actions (default) or Google Cloud Build?
  • If Cloud Run chosen → Session storage? In-memory (default), Cloud SQL (persistent), or Agent Engine (managed).
  • If deployment with CI/CD chosen → Git repository? Does one already exist, or should one be created? If creating, public or private?

Step 2: Write DESIGN_SPEC.md

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.


Step 3: Create or Enhance the Project

Create a New Project

uvx agent-starter-pack create <project-name> \
  --agent <template> \
  --deployment-target <target> \
  --region <region> \
  --prototype \
  -y

Constraints:

  • Project name must be 26 characters or less, lowercase letters, numbers, and hyphens only.
  • Do NOT mkdir the project directory before running create — the CLI creates it automatically. If you mkdir first, create will fail or behave unexpectedly.
  • Auto-detect the guidance filename based on the IDE you are running in and pass --agent-guidance-filename accordingly.
  • When enhancing an existing project, check where the agent code lives. If it's not in app/, pass --agent-directory <dir> (e.g. --agent-directory agent). Getting this wrong causes enhance to miss or misplace files.

Create Flags

FlagShortDefaultDescription
--agent-aadkAgent template (see template table below)
--deployment-target-dagent_engineDeployment target (agent_engine, cloud_run, none)
--regionus-central1GCP region
--prototype-poffSkip CI/CD and Terraform (recommended for first pass)
--cicd-runnerskipgithub_actions or google_cloud_build
--datastore-ds—Datastore for data ingestion (vertex_ai_search, vertex_ai_vector_search)
--session-typein_memorySession storage (in_memory, cloud_sql, agent_engine)
--auto-approve-yoffSkip confirmation prompts
--skip-checks-soffSkip GCP/Vertex AI verification checks
--agent-directory-dirappAgent code directory name
--agent-guidance-filenameGEMINI.mdGuidance file name (CLAUDE.md, AGENTS.md)
--debugoffEnable debug logging for troubleshooting

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.

Enhance an Existing Project

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.

Enhance Flags

All create flags are supported, plus:

FlagShortDefaultDescription
--name-ndirectory nameProject name for templating
--base-template-bt—Override base template (e.g. agentic_rag to add RAG)
--dry-runoffPreview changes without applying
--forceoffForce overwrite all files (skip smart-merge)

Common Workflows

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 Options

TemplateDeploymentDescription
adkAgent Engine, Cloud RunStandard ADK agent (default)
adk_a2aAgent Engine, Cloud RunAgent-to-agent coordination (A2A protocol)
agentic_ragAgent Engine, Cloud RunRAG with data ingestion pipeline

Deployment Options

TargetDescription
agent_engineManaged by Google (Vertex AI Agent Engine). Sessions handled automatically.
cloud_runContainer-based deployment. More control, requires Dockerfile.
noneNo deployment scaffolding. Code only.

"Prototype First" Pattern (Recommended)

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

Agent Engine and session_type

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.


Step 4: Save DESIGN_SPEC.md and Load Dev Workflow

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.


Scaffold as Reference

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:

  • Non-standard project structures that enhance can't handle
  • Cherry-picking specific infrastructure files
  • Understanding what ASP generates before committing to it

Critical Rules

  • NEVER change the model in existing code unless explicitly asked
  • NEVER mkdir before create — the CLI creates the directory; pre-creating it causes enhance mode instead of create mode
  • NEVER create a Git repo or push to remote without asking — confirm repo name, public vs private, and whether the user wants it created at all
  • Always ask before choosing CI/CD runner — present GitHub Actions and Cloud Build as options, don't default silently
  • Agent Engine clears session_type — if deploying to agent_engine, remove any session_type setting from your code
  • Start with --prototype for quick iteration — add deployment later with enhance
  • Project names must be ≤26 characters, lowercase, letters/numbers/hyphens only

Examples

Using scaffold as reference: User says: "I need a Dockerfile for my non-standard project" Actions:

  1. Create temp project: uvx agent-starter-pack create /tmp/ref --agent adk --deployment-target cloud_run -y
  2. Copy relevant files (Dockerfile, etc.) from /tmp/ref
  3. Delete temp project Result: Infrastructure files adapted to the actual project

Troubleshooting

uvx command not found

Install 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.

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量2.6K
评分4.4 / 5.0
版本
更新日期2026年10月7日
对比案例1 组

用户评分

4.4(21)
5
24%
4
52%
3
24%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

时间线

创建2026年3月16日
最后更新2026年10月7日
🎁 Agent 知识卡片
调研问卷