Agent skill · software engineering · google
spanner-basics
Assists in provisioning instances and databases, designing performant schemas, and querying data in Cloud Spanner on Google Cloud. Use when designing primary keys, writing SQL queries or client library code, or diagnosing performance issues.
Why this skill is useful
Adds specific DDL commands and performance optimization strategies for Google Cloud Spanner that the AI wouldn't reliably generate on its own.
What it needs
Requires gcloud installed locally. Requires google-cloud account access. About 2k tokens when loaded. Last updated 2026-08-06. 15,831 stars on the source repository.
What this skill does
Spanner Basics This skill provides core workflows and guidance for administering and developing with Cloud Spanner on Google Cloud, a fully managed, mission-critical database service offering global transactional consistency and automatic, synchronous replication for high availability. Attribution MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDKMETRICSREQUESTATTRIBUTION="agent-skills/1.0 (skill:spanner-basics)" and append agent-skills/1.0 (skill:spanner-basics) to User-Agent headers. Core Principles Performance First: Spanner scales horizontally. Efficiency is tied to Primary Key design. Always warn against using monotonically increasing/decreasing values (like sequential timestamps) as the first part of a primary key to avoid hotspots. Schema Design: Prefer interleaved tables for strongly related parent-child data that is frequently accessed together. Safety [!CAUTION] CRITICAL INSTRUCTION: You MUST obtain explicit user confirmation before making any non-emulator database changes (DML or DDL) or destructive operations (such as dropping tables, indexes, or any other Spanner resources). Do not execute them automatically; instead, output the command (e.g., gcloud spanner databases ddl update) and ask for explicit user approval. When database access is unavailable or authentication fails, do not block on trying to verify the existence of the instance, database, or table. Assume the provided resources exist and directly generate the DDL commands. Common Workflows Schema Evolution & DDL 1. Use gcloud spanner databases ddl update to apply schema updates (such as CREATE, ALTER, or DROP tables and indexes). 2. Reference schema-design.md for guidelines on primary key selection and interleaved tables. Diagnosing Performance Issues 1. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills google/spanner-basics