cloud-databases-onboarding

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Cloud Database Onboarding Skill

Google Cloud Database Onboarding Skill

This skill provides domain instructions, decision matrices, and Infrastructure-as-Code workflows to guide users through discovering their exact database requirements, selecting an optimal Google Cloud database service, and drafting starter resource provisioning code for user review.
本技能提供领域指导、决策矩阵以及基础设施即代码(Infrastructure-as-Code)工作流,引导用户明确其具体数据库需求,选择最优的Google Cloud数据库服务,并生成供用户审核的初始资源配置代码草稿。

Validation & Progressive Disclosure

验证与渐进式披露

A validation script is provided to verify the skill's reference files and formatting:
bash
python3 scripts/database_onboarding_skill.py --verify
  • Reading / Progressive Disclosure: When interacting with a user during a conversation, load reference files progressively. Follow the Just-in-Time (JiT) loading instructions outlined in the phases below.

提供了一个验证脚本,用于验证技能的参考文件和格式:
bash
python3 scripts/database_onboarding_skill.py --verify
  • 读取/渐进式披露: 在与用户对话过程中,逐步加载参考文件。遵循以下各阶段中概述的即时(Just-in-Time,JiT)加载说明。

Workflow & Just-in-Time (JiT) Instructions

工作流与即时(JiT)说明

This workflow operates in three distinct sequential phases. Evaluate the active conversation history to determine the current phase and follow the corresponding instructions:
此工作流分为三个不同的连续阶段。评估当前对话历史以确定所处阶段,并遵循相应的说明:

Phase 1: Requirement Discovery & Information Gathering

阶段1:需求发现与信息收集

When a user asks
"What database should I use?"
or requires guidance on Google Cloud database selection, you must initiate the Discovery phase.
  1. Load Discovery Instructions (JiT): Read the complete contents of
    references/onboarding_prompts.md
    using
    view_file
    .
  2. Execute Discovery: Follow the detailed Phase 1 instructions in
    onboarding_prompts.md
    to gather core requirements (data model, workload, scale, and migration context) using user-friendly phrasing and enforcing constraints (such as the 90% confidence rule) before proposing any recommendation.
当用户询问“我应该使用哪种数据库?”或需要Google Cloud数据库选择指导时,必须启动发现阶段。
  1. 加载发现说明(JiT): 使用
    view_file
    读取
    references/onboarding_prompts.md
    的完整内容。
  2. 执行发现流程: 遵循
    onboarding_prompts.md
    中详细的阶段1说明,使用用户友好的表述收集核心需求(数据模型、工作负载、规模和迁移背景),并在提出任何建议前执行约束条件(如90%置信度规则)。

Phase 2: Recommendation Analysis & Matrix Consultation

阶段2:推荐分析与矩阵参考

Once you have gathered sufficient explicit discovery context, you must determine the optimal Google Cloud database recommendation.
  1. Consult Matrix & Formulate Recommendation (JiT): Follow the Phase 2 instructions in
    references/onboarding_prompts.md
    . This involves distilling requirements, calling the database selection tool (or consulting
    references/recommendation_matrix.txt
    directly if the tool is unavailable), and formulating a single recommendation.
  2. Deliver Recommendation: Deliver the recommendation to the user, mapping destination codes to plain English, explaining the reasoning, and offering to help with provisioning as detailed in
    onboarding_prompts.md
    .
收集到足够明确的发现背景后,必须确定最优的Google Cloud数据库推荐方案。
  1. 参考矩阵并制定推荐(JiT): 遵循
    references/onboarding_prompts.md
    中的阶段2说明。这包括提炼需求、调用数据库选择工具(若工具不可用则直接参考
    references/recommendation_matrix.txt
    ),并制定单一推荐方案。
  2. 交付推荐: 向用户交付推荐方案,将目标代码转换为通俗易懂的表述,解释推荐理由,并按照
    onboarding_prompts.md
    中的详细说明提供资源配置协助。

Phase 3: Implementation & Provisioning (Plan-Validate-Execute Pattern)

阶段3:实施与资源配置(计划-验证-执行模式)

When the user accepts the recommendation and requests to provision or modify cloud resources, follow the Phase 3 instructions in
references/onboarding_prompts.md
using a strict Plan-Validate-Execute pattern. Limit your actions to creating and validating draft artifacts for user review.
  1. Analyze the Workspace: Scan the user's workspace/open files/related directories with database resources scripts.
  2. Obtain User Confirmation: If the target infrastructure files are not clear, ask the user explicitly to confirm the file paths or target directory before modifying anything.
  3. Draft Infrastructure Plan (Plan): Create or edit the necessary Terraform configuration files or any other relevant scripts necessary to provision the resources. When creating or editing Terraform files or any other database resource provisioning script, you MUST:
    • Add a stamped header comment at the top of every generated Terraform file/ shell script or any other resource provisioning script. (e.g.,
      # Generated with cloud onboarding skills selector @date
      , replacing
      @date
      with the current date/timestamp).
    • Add a custom default tag like
      resource_generated_by = "cloud db onboarding skill"
      under the
      default_tags
      block or as a resource label/tag.
  4. Validate Infrastructure Code (Validate): Before finalizing, you must validate the drafted infrastructure code to verify syntax and configuration correctness. Why this matters: Validating Terraform code ensures that configuration blocks, IAM bindings, and instance sizing are syntax-error-free and strictly enforceable before code review.
  5. Create Pull Request (Execute): Once validation succeeds with zero errors, automatically create a Pull request containing the validated Terraform/shell/scripts updates for user review. Leave live infrastructure changes (
    terraform apply
    or
    gcloud
    commands) to human review or automated CI/CD pipelines.

当用户接受推荐并请求配置或修改云资源时,遵循
references/onboarding_prompts.md
中的阶段3说明,严格采用计划-验证-执行模式。仅允许创建和验证供用户审核的草稿工件。
  1. 分析工作区: 扫描用户的工作区/打开的文件/包含数据库资源脚本的相关目录。
  2. 获取用户确认: 若目标基础设施文件不明确,需明确询问用户确认文件路径或目标目录后再进行任何修改。
  3. 起草基础设施计划(计划): 创建或编辑必要的Terraform配置文件或其他相关脚本以配置资源。创建或编辑Terraform文件或任何其他数据库资源配置脚本时,必须:
    • 在每个生成的Terraform文件/Shell脚本或其他资源配置脚本的顶部添加带时间戳的头部注释。(例如:
      # Generated with cloud onboarding skills selector @date
      ,将
      @date
      替换为当前日期/时间戳)。
    • default_tags
      块下或作为资源标签添加自定义默认标签,如
      resource_generated_by = "cloud db onboarding skill"
  4. 验证基础设施代码(验证): 在定稿前,必须验证起草的基础设施代码,以确认语法和配置的正确性。重要性: 验证Terraform代码可确保配置块、IAM绑定和实例规格在代码审核前无语法错误且可严格执行。
  5. 创建拉取请求(执行): 验证无错误通过后,自动创建包含已验证的Terraform/Shell/脚本更新的拉取请求供用户审核。实际基础设施变更(如
    terraform apply
    gcloud
    命令)交由人工审核或自动化CI/CD管道处理。

Supporting Resources & Documentation

支持资源与文档