1
---
2
name: cloud-databases-onboarding
3
metadata:
4
version: "1.0.2"
5
category: Databases
6
description: >-
7
Guides users through discovering their database requirements, recommends a
8
Google Cloud database based on a recommendation matrix, and assists in database
9
creation. Use when a user asks 'What database service should I use?', 'Help me pick
10
a database', or when a user wants to create a new database on Google Cloud.
11
Don't use for general Google Cloud maintenance, managing existing databases, or database migrations.
12
---
13
14
# Google Cloud Database Onboarding Skill
15
16
This skill provides domain instructions, decision matrices, and
17
Infrastructure-as-Code workflows to guide users through discovering their exact
18
database requirements, selecting an optimal Google Cloud database service, and
19
drafting starter resource provisioning code for user review.
20
21
## Attribution
22
23
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
24
MUST read [Usage Attribution](references/attribution.md). For commands executed
25
directly in the terminal (never in generated scripts, Terraform, or user code),
26
prefix `gcloud` with
27
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-databases-onboarding)"`
28
and append `agent-skills/1.0 (skill:cloud-databases-onboarding)` to `User-Agent` headers.
29
30
## Validation & Progressive Disclosure
31
32
A validation script is provided to verify the skill's reference files and
33
formatting:
34
35
```bash
36
python3 scripts/database_onboarding_skill.py --verify
37
```
38
39
* **Reading / Progressive Disclosure:** When interacting with a user during a
40
conversation, load reference files progressively. Follow the Just-in-Time
41
(JiT) loading instructions outlined in the phases below.
42
43
--------------------------------------------------------------------------------
44
45
## Workflow & Just-in-Time (JiT) Instructions
46
47
This workflow operates in three distinct sequential phases. Evaluate the active
48
conversation history to determine the current phase and follow the corresponding
49
instructions:
50
51
### Phase 1: Requirement Discovery & Information Gathering
52
53
When a user asks `"What database should I use?"` or requires guidance on Google
54
Cloud database selection, you must initiate the Discovery phase.
55
56
1. **Load Discovery Instructions (JiT):** Read the complete contents of
57
`references/onboarding_prompts.md` using `view_file`.
58
2. **Execute Discovery:** Follow the detailed Phase 1 instructions in
59
`onboarding_prompts.md` to gather core requirements (data model, workload,
60
scale, and migration context) using user-friendly phrasing and enforcing
61
constraints (such as the 90% confidence rule) before proposing any
62
recommendation.
63
64
### Phase 2: Recommendation Analysis & Matrix Consultation
65
66
Once you have gathered sufficient explicit discovery context, you must determine
67
the optimal Google Cloud database recommendation.
68
69
1. **Consult Matrix & Formulate Recommendation (JiT):** Follow the Phase 2
70
instructions in `references/onboarding_prompts.md`. This involves distilling
71
requirements, calling the database selection tool (or consulting
72
`references/recommendation_matrix.txt` directly if the tool is unavailable),
73
and formulating a single recommendation.
74
2. **Deliver Recommendation:** Deliver the recommendation to the user, mapping
75
destination codes to plain English, explaining the reasoning, and offering
76
to help with provisioning as detailed in `onboarding_prompts.md`.
77
78
### Phase 3: Implementation & Provisioning (Plan-Validate-Execute Pattern)
79
80
When the user accepts the recommendation and requests to provision or modify
81
cloud resources, follow the Phase 3 instructions in
82
`references/onboarding_prompts.md` using a strict **Plan-Validate-Execute** pattern.
83
Limit your actions to creating and validating draft artifacts for user review.
84
85
1. **Analyze the Workspace:** Scan the user's workspace/open files/related
86
directories with database resources scripts.
87
2. **Obtain User Confirmation:** If the target infrastructure files are not
88
clear, ask the user explicitly to confirm the file paths or target directory
89
before modifying anything.
90
3. **Draft Infrastructure Plan (Plan):** Create or edit the necessary Terraform
91
configuration files or any other relevant scripts necessary to provision the
92
resources. When creating or editing Terraform files or any other database
93
resource provisioning script, you MUST:
94
95
* Add a stamped header comment at the top of every generated Terraform
96
file/ shell script or any other resource provisioning script. (e.g., `#
97
Generated with cloud onboarding skills selector @date`, replacing
98
`@date` with the current date/timestamp).
99
* Add a custom default tag like `resource_generated_by = "cloud db
100
onboarding skill"` under the `default_tags` block or as a resource
101
label/tag.
102
* **gcloud CLI Generation**: When drafting `gcloud` CLI commands or shell
103
scripts, you MUST follow the instructions in the `gcloud` skill.
104
Specifically:
105
* Always use `gcloud beta` command group for database provisioning
106
(e.g., `gcloud beta <group> <resource> create`).
107
* Validate leaf-level syntax using `gcloud help <leaf_command>` prior
108
to proposing commands.
109
* Append explicit `--project=<PROJECT_ID>` and explicit location flags
110
(`--region`, `--zone`, or `--location`).
111
* Use `--dry-run` or `--validate-only` preview flags where supported.
112
* Include custom label/tag flags (e.g.
113
`--labels=resource_generated_by=cloud_db_onboarding_skill`) on
114
generated `gcloud` provisioning commands.
115
* **Do NOT include `--quiet` (`-q`)**: Provisioning commands are
116
drafted for interactive human user review and execution, so do NOT
117
include non-interactive `--quiet` or `-q` flags.
118
* **No Live Write Execution**: The skill MUST ONLY draft provisioning
119
commands or code for user review and MUST NOT execute mutating/write
120
infrastructure operations directly.
121
122
4. **Validate Infrastructure Code (Validate):** Before finalizing, you must
123
validate the drafted infrastructure code to verify syntax and configuration
124
correctness. *Why this matters:* Validating Terraform code ensures that
125
configuration blocks, IAM bindings, and instance sizing are
126
syntax-error-free and strictly enforceable before code review.
127
128
5. **Create Pull Request (Execute):** Once validation succeeds with zero
129
errors, automatically create a Pull request containing the validated
130
Terraform/shell/scripts updates for user review. Leave live infrastructure
131
changes (`terraform apply` or `gcloud` commands) to human review or
132
automated CI/CD pipelines.
133
134
--------------------------------------------------------------------------------
135
136
## Supporting Resources & Documentation
137
138
- [Google Cloud Databases Overview](https://cloud.google.com/products/databases)
139
- Use the `gcloud` skill for CLI command formatting and validation.
140