What it does. > [!CAUTION] > > ### MANDATORY PRE-CONDITION: EXPLICIT LEAF-LEVEL SYNTAX VALIDATION > > All pre-existing knowledge of
gcloud
commands, flags, flag values, and > positional argument syntax is
stale and prone to hallucination. > > NEVER propose command parameters, output flag options, execute commands, OR > outline step-by-step plans for any
gcloud
task before validating leaf-level > syntax via
gcloud help
(or including leaf-level help lookup as a > mandatory step in the plan). > >
Mandatory Action Rules: > > 1.
Direct Execution & Code Generation:
ALWAYS invoke
gcloud help >
(e.g.
gcloud help compute instances create
or
gcloud > help sql instances create
) before proposing or executing the final > command syntax. > > 2.
Planning & Strategy Queries: When asked for a plan, strategy, or next > steps to achieve a user goal (e.g.,
"What is your plan to accomplish > X..."), the response
MUST explicitly include running gcloud help >
as Step 1 of the plan before proposing flags or > executing commands. > > 3.
Non-Transitive Validation: Parent command group help (e.g.
gcloud > help compute
) is not sufficient for leaf-level syntax validation. > Validation must occur at the specific leaf subcommand level. > > 4.
FORBIDDEN Web Search Fallback: NEVER use
search_web
, web search, or > external documentation search tools for gcloud CLI syntax.
gcloud help >
is the
EXCLUSIVE authorized authority for command > syntax. > > 5.
User Flag & Project Preservation: When proposing intermediate command > steps,
ALWAYS preserve all user-specified flags (including >
--project=
) in the proposed response text. > > 6.
Mandatory Plan Template: When generating a plan, the response
MUST > copy this exact 4-step structure: > > -
Step 1: Syntax Validation via
gcloud help
> -
Step 2: Parameter Verification (confirming required and optional > flags, and explicitly checking if the
--dry-run
or
--validate-only
> flag is supported) > -
Step 3: Dry-Run Command Proposal (If
--dry-run
or >
--validate-only
is supported, there MUST be a
--dry-run
or >
--validate-only
invocation before the next step.) > -
Step 4: Command Proposal & Authorization (If the command is on the > "Prohibited Operations" denylist, state that autonomous execution is > forbidden, and the user MUST be explicitly asked for authorization to > proceed. If the command is NOT on the denylist, propose or proceed > with execution, while following
ALL "Execution Constraints" below.)
This document provides essential guidelines and best practices for AI agents interacting with the Google Cloud SDK (
gcloud
CLI). Following these rules is critical to avoid hallucinated commands, flags, flag values, and positional argument syntax, prevent destructive actions, and minimize context window usage.
Highlights
- Direct CLI Execution: Executing
gcloud
commands directly in a local or
- Model Context Protocol (MCP): Invoking structured tools via the Cloud
- Action: ALWAYS call
gcloud help <command>
for the exact command
- Verify: Ensure the command, flags, flag values, and positional argument
- Projection: Use
--format="json(key1, key2, ...)"
to select only the
When to use it. Safety-critical validation, guardrails and output reduction for gcloud commands, so an agent can drive Google Cloud without destructive surprises.
Install
npx skills add google/skills --skill gcloud
Or copy the skill folder manually:
git clone https://github.com/google/skills.git
cp -r skills/plugins/cloud/google-cloud-developer/skills/gcloud/ ~/.claude/skills/gcloud
Source: google/skills — 19,267 stars, Apache-2.0, last pushed 2026-09-02.