此注册表固定版本所收录的最新上游作者日期。

google-cloud-recipe-onboarding

已同步 v1.0.0 许可证: Apache-2.0 来源: google/skills/skills/cloud/google-cloud-recipe-onboarding 提交: 99c871e 收录的最新变更:

Guides a developer's first steps on Google Cloud, covering account creation, billing setup, project management, and deploying a first resource. Use when a new developer wants to initialize their first Google Cloud project, configure billing, and verify deployment. Don't use for enterprise organization setup (use Google Cloud Setup guided flow for that instead). Don't use for complex multi-project architectures.

摘要

用途
协助个人开发者检查 Google Cloud CLI 访问与验证状态、选择项目并确认帐务,为部署第一个工作负载做好准备。
使用时机
适用于需要创建访问权、选择或创建项目并确认帐务就绪的独立开发者;组织级基础架构或多项目设计则应使用其他流程。
输出结果
提供所选或新建项目的帐务链接状态与设置验证步骤,并指向支出控管及合适的工作负载快速入门指引。
上游变更(13 条,最新收录 2026-09-21)
becc4b8 Enforce semantic versioning (MAJOR.MINOR.PATCH) for skills. 在技能的 YAML 中继数据中添加版本 `1.0.0`。
569cb1d Update documentation links and references 修订缺少 gcloud 时的指引、更新多个文档网址,并添加 Google Cloud 高级正式环境资源链接。
c75b500 Restructure the YAML frontmatter in all SKILL.md files to nest the 'category' field under the 'metadata:' block. The 'category' field is used to organize the skills in the README.md 将 `category` 移入 `metadata` 区块,并在多个命令代码区块前加入空行。
872e31b Refactor BQ skills 重新排版项目 ID 冲突处理指引,以及帐单支出控管与工作负载部署章节。
16b3fef Link updates - Fetch Google Cloud documentation as markdown instead of HTML 将入门指引与资源清单中的多个 Google Cloud 文档网址改为 `.md.txt` 版本。
fc4af87 Optimize the Google Cloud onboarding recipe skill. 将指南改写为代理程序工作流程,加入运行前检查、单一问题与同意规则,以及以 gcloud 运行的验证、项目与帐单检查和结果确认。
626910e Update gcloud examples to use --quiet. 在部署 Cloud Run 服务的 gcloud 命令范例中加入 `--quiet`。
e629495 Updated BQ MCP tool names and fixed markdown links & formatting. 将首次部署资源的选项重新排版为易读清单,并整理 fenced 格式的 Cloud Run 命令范例。
6f0b877 Nests cloud/ skills under a top level skills/ directory 将未变更内容的技能档重命名至 `skills/cloud/google-cloud-recipe-onboarding/SKILL.md`。
9114a94 Flatten skill directories to work with multiple installation tools 在未变更文件内容的情况下,将技能档从 `cloud/recipes/google-cloud-recipe-onboarding/SKILL.md` 移至 `cloud/google-cloud-recipe-onboarding/SKILL.md`。
9fdab90 No public description 将 Cloud Run 部署范例从行内代码改排为 fenced 多行 bash 代码区块。
9b3ff7f No public description 调整项目、API 与资源部署章节中的 Markdown 间距、清单缩进和换行。
f158dab No public description 添加初版入门指南,涵盖帐户与免费额度设置、项目与帐单、CLI 与 API、资源部署及验证。
npx skills add "lettucebo/Skills#v2.2.0@google-cloud-recipe-onboarding" --full-depth

⚠ v2.2.0 发布后即可使用

Onboarding to Google Cloud

This skill provides a streamlined, non-interactive "happy path" for a singleton developer to get started with Google Cloud. It covers everything from environment verification and authentication to project selection, billing account linkage, and downstream safety chaining.

[!IMPORTANT] For autonomous agents executing this skill:

  1. Check-Before-Mutate Audits: Always perform silent pre-execution state audits prior to proposing or executing any project or billing changes.
  2. Single-Question Policy: Ask the user for exactly one operational parameter or confirmation at a time during interactive execution.
  3. Non-Interactive Output: Append non-interactive overrides (--quiet, --format="json") to all mutation commands to guarantee deterministic, machine-parseable outputs and prevent terminal hangs.
  4. First Turn Interaction Rules (Trigger Turn): When the developer first triggers this skill with a general onboarding request (e.g. says "I want to get started with Google Cloud"):
    • Preamble Guidance: Proactively include a short orienting preamble guiding the developer to create a Google Cloud account (pointing to the console at https://console.cloud.google.com/) and run gcloud auth login to authorize their workstation, even if they appear to be already logged in.
    • First Turn Single-Question: Perform pre-flight audits silently, but do not present a complete parameters summary table or ask for final consent in the first turn. Instead, ask the developer exactly one initial operational question (e.g., "Would you like to reuse an existing active project, or create a brand new one?"). Note: If the developer's initial prompt explicitly states "I approve the onboarding configuration", "Let's proceed with onboarding", or requests a dry-run plan (e.g., "Show me the exact plan or dry-run commands"), bypass the general preamble and initial question, and proceed directly to the requested step.

Overview

For an individual developer, onboarding to Google Cloud involves verifying local terminal tools, establishing an authenticated session, selecting or instantiating a workspace (Project), and linking it to an active billing account. Google Cloud offers a Free Tier and a Free Trial with $300 in credits for first-time users. Learn more here.


Prerequisites

  • A personal Google Account (e.g., @gmail.com) or Google Workspace / Cloud Identity account.
  • A valid payment method (credit card or bank account) required for identity verification and to activate the $300 Free Trial credit introduced in the Overview.

Steps

Section 1: Verify Host Tooling Setup

Before soliciting input or proposing mutations, silently audit the host system's active tooling and environment status.

  1. Check if the gcloud CLI binary is installed and accessible:

    which gcloud
    
  2. Check if there is an active authenticated identity session:

    gcloud auth list --format="json"
    
  3. If the pre-execution audit for which gcloud returns a valid path, proceed directly to Section 2: Authenticate and Route Session.

  4. If the binary is missing, halt execution and direct the agent to install gcloud using the gcloud skill. Provide the official Google Cloud CLI Installation Guide to the developer for steps to set up authentication.


Section 2: Authenticate and Route Session

Authorize the gcloud CLI to access Google Cloud using the developer's Google Account, and verify that the account is appropriate for standalone developer onboarding.

  1. Execute Credentials Authentication:

    gcloud auth login
    

    [!IMPORTANT] New User / Unauthenticated Guidance: If the pre-execution state audits or command failures confirm that the developer is unauthenticated (e.g., gcloud auth list is empty or active credentials are missing):

    1. Guide them to create a Google Cloud account by navigating to the Google Cloud Console.
    2. Instruct them to execute the gcloud auth login command to authorize their local workstation terminal session.
    3. Do not attempt project creation or resource configuration until authentication is completed successfully.
  2. Verify Active Identity:

    gcloud config get-value account --format="json"
    
  3. Programmatic Enterprise Routing Guardrail: Before proceeding, verify if the account is bound to a corporate organization, as enterprise setups must follow a different architecture:

    gcloud organizations list --format="json"
    
    • Note that new Free Trial accounts automatically receive a Self-Owned Organization (SOO). To distinguish between a personal Free Trial account and an enterprise organization, inspect the JSON output:
      • Enterprise Organization (Halt Execution): If the output list contains an organization node where owner.directoryCustomerId is present (confirming a domain-verified Google Workspace or Cloud Identity organization), or if the user's prompt explicitly mentions corporate landing zones or multi-tenant project structures:
      • Personal Account / Free Trial SOO (Proceed): If the output list is empty [], or if it contains a Self-Owned Organization (where owner.directoryCustomerId is absent and displayName is not a verified domain name), proceed to Section 3: Select or Instantiate Your Google Cloud Project.

Section 3: Select or Instantiate Your Google Cloud Project

Google Cloud resources are organized into Projects. When developers sign up for a Free Trial via the console, Google Cloud automatically creates a default project (e.g., "My First Project"). Always audit the active environment first to reuse existing projects and prevent token-burning collision errors.

  1. Silent Project Discovery: List active, accessible projects (limited to prevent context window overflow):

    gcloud projects list --filter="lifecycleState=ACTIVE" --limit=20 --format="json"
    
  2. Reuse Existing Project (Recommended): If the list returns an active project, present it to the developer and propose setting it as the default working project:

    gcloud config set project {PROJECT_ID} --quiet
    
  3. Create Custom Project: If no projects exist, or if the developer explicitly requests a brand new workspace:

    • Solicit a custom PROJECT_ID and PROJECT_NAME from the developer (Single-Question Policy).

    • Structured Confirmation & Consent Gate (Mandatory): Before running any project creation or billing linkage commands, the agent must present a structured markdown table summarizing the target parameters:

      Parameter Value
      Target Project ID {PROJECT_ID}
      Target Project Name {PROJECT_NAME}
      Active Identity Account {ACCOUNT}
      Target Billing Account ID {BILLING_ACCOUNT_ID}

      Ask the user the exact consent query: "I am ready to initialize your Google Cloud project and link billing. Do you want me to proceed?"

      CRITICAL: The agent MUST NOT execute any gcloud projects create or billing link commands during this turn. You must display this table, ask the exact consent query, and strictly stop to wait for the user's positive affirmation.

    • Project ID Collision Suffix Recovery: If the project creation command fails because the PROJECT_ID is already taken globally (returning a PROJECT_ID_COLLISION or ALREADY_EXISTS error):

      • Automatically append a random 4-digit suffix (e.g., changing my-project to my-project-8472).
      • Propose this new available project ID to the developer and re-solicit consent before retrying.
    • Execute Project Creation: Once explicit user consent is confirmed:

      gcloud projects create {PROJECT_ID} --name="{PROJECT_NAME}" --quiet --format="json"
      
    • Set the active working project:

      gcloud config set project {PROJECT_ID} --quiet
      

Section 4: Verify and Link Billing

To deploy resources on Google Cloud, your project must be linked to an active Cloud Billing account.

  1. Audit Billing Status: Check if the active project is already linked to a billing account:

    gcloud billing projects describe {PROJECT_ID} --format="json"
    
  2. If the output contains "billingEnabled": true, skip linkage and proceed immediately to Section 5: Skill Chaining (Spend Controls & Workloads).

  3. Discover Available Billing Accounts: If the project is unlinked, query the available billing account handles linked to the authenticated user identity:

    gcloud billing accounts list --format="json"
    
  4. Link Billing Account: Propose linking the project to the discovered Billing Account ID, and execute:

    gcloud billing projects link {PROJECT_ID} --billing-account={BILLING_ACCOUNT_ID} --format="json"
    

Section 5: Skill Chaining (Spend Controls & Workloads)

Onboarding setup is now complete. To safeguard your environment and deploy workloads, you can chain to downstream specialized skills:

  1. Billing Spend Controls: To avoid accidental cost overruns, consider setting up a programmatic control to automatically disable billing. When billing is disabled, all Google Cloud services and usage in the project are terminated to stop further costs:
  1. Deploy Workloads: To deploy your first resource, trigger the downstream specialized skill matching your target application (e.g., cloud-run-basics or bigquery-basics). If the specialized skill is not locally available, direct the developer to the corresponding official quickstart, such as the Cloud Run Container Deployment Quickstart. Note: Those downstream specialized skills are individually responsible for dynamically enabling their own required service APIs (e.g., run.googleapis.com) inline during execution.

Validation Logic

After completing the onboarding steps, programmatically verify the completed environment state using these diagnostic commands:

  1. Verify CLI Installation:

    which gcloud
    
  2. Verify Authenticated Identity:

    gcloud config get-value account
    
  3. Verify Project Workspace Existence:

    gcloud projects describe {PROJECT_ID} --format="json"
    
  4. Verify Billing Linkage (Ensure the JSON output contains "billingEnabled": true):

    gcloud billing projects describe {PROJECT_ID} --format="json"
    

Additional Resources

历史

v1.0.0 mapping-added 99c871e