gcloud
できること
エージェントが、提案または実行する前に、各コマンドについて公式のgcloudヘルプを確認するようにします。ターミナルからGoogle Cloudを管理する開発者や管理者向けです。
使う場面
- ✓エージェントにgcloudコマンドを実行してもらい、構文を正しく得たいとき。
- ✓Google Cloudのタスクを計画していて、各手順の正確なコマンドが必要なとき。
- ✓gcloudのフラグの動作を聞き、公式のヘルプで確認した答えがほしいとき。
スキルのリンク
https://github.com/google/skills/blob/main/plugins/cloud/google-cloud-developer/skills/gcloud/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のプロジェクトに小さなCompute EngineのVMを作成してください。使ったgcloudコマンドを正確に教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
コマンドを提案または実行する前に、エージェントはそのコマンドの正確なヘルプを確認し、そこで見つかったフラグだけを使います。記憶にある構文は不確かなものとして扱われます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
gcloud CLI Skill for AI Agents
[!CAUTION]
MANDATORY PRE-CONDITION: EXPLICIT LEAF-LEVEL SYNTAX VALIDATION
All pre-existing knowledge of
gcloudcommands, 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
gcloudtask before validating leaf-level syntax viagcloud help <command>(or including leaf-level help lookup as a mandatory step in the plan).Mandatory Action Rules:
Direct Execution & Code Generation: ALWAYS invoke
gcloud help <leaf_command>(e.g.gcloud help compute instances createorgcloud help sql instances create) before proposing or executing the final command syntax.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 <leaf_command>as Step 1 of the plan before proposing flags or executing commands.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.FORBIDDEN Web Search Fallback: NEVER use
search_web, web search, or external documentation search tools for gcloud CLI syntax.gcloud help <leaf_command>is the EXCLUSIVE authorized authority for command syntax.User Flag & Project Preservation: When proposing intermediate command steps, ALWAYS preserve all user-specified flags (including
--project=<project_id>) in the proposed response text.Mandatory Plan Template: When generating a plan, the response MUST copy this exact 4-step structure:
- Step 1: Syntax Validation via
gcloud help <leaf_command>- Step 2: Parameter Verification (confirming required and optional flags, and explicitly checking if the
--dry-runor--validate-onlyflag is supported)- Step 3: Dry-Run Command Proposal (If
--dry-runor--validate-onlyis supported, there MUST be a--dry-runor--validate-onlyinvocation 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.
Usage Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution. If a more specific product or
domain skill (e.g., cloud-run-basics, bigquery-basics, gke-basics) is
also loaded or active for the current task, ALWAYS use that specific
skill's skill:<name> attribution tag instead of skill:gcloud. For commands
executed directly in the terminal when no product-specific skill applies (never
in generated scripts, Terraform, or user code), prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gcloud)"
and append agent-skills/1.0 (skill:gcloud) to User-Agent headers.
Execution Modes
AI agents can interact with Google Cloud resources in two primary ways:
- Direct CLI Execution: Executing
gcloudcommands directly in a local or automated shell environment. See CLI Usage for installation, authentication flows, and configuration management. - Model Context Protocol (MCP): Invoking structured tools via the Cloud
CLI remote MCP server (
run_gcloud_command). See MCP Usage for tool schemas, parameter rules, and server configuration.
Core Principles
1. Explicit Command Validation (Mandatory)
よくある質問
フラグを推測しますか?
いいえ。フラグを書く前に、正確なコマンドのヘルプを確認するよう作られています。
コマンドの構文をWeb検索しますか?
いいえ。スキルは、Web検索ではなくgcloudのヘルプに頼るよう指示しています。
クライアントライブラリのコードのためですか?
いいえ。Google Cloudのクライアントライブラリのコードではなく、gcloudコマンドのためのものです。
詳細
作者による元の説明
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure. Use when planning, generating, constructing, proposing, describing, or executing any gcloud CLI commands - including when answering questions about gcloud syntax, or formatting flags. Don't use when writing Google Cloud client library code or raw REST/gRPC API requests.
repo: google/skills
人気
- GitHubのスター
- 22k
- ランキング
- #10178
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
finding-google-skills
22kセットアップ作業に合うGoogleの公式ガイドを探すようエージェントを支援します。ホスティング、データベース、ストレージ、サインイン、AIモデルの提供などが対象です。
google-cloud-recipe-auth
22kエージェントが、Google Cloudのアイデンティティとアクセス(人やサービスがどうサインインし、どの権限を得るか)について、手順を案内できるよう支援します。
google-cloud-recipe-onboarding
22k新しい開発者が、プロジェクトの選択、請求の設定、最初のリソースのデプロイなど、Google Cloudの最初の手順を進められるよう案内します。
retrieving-developer-knowledge
22kエージェントが、推測ではなく、Cloud、Android、Chrome、Firebase、Flutterなどを含むGoogleの公式の開発者向けドキュメントを調べられるよう支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。