Analyze Usage
openshift-eng/ai-helpers
A skill your agent uses when analyzing BigQuery usage patterns, costs, and query performance for a GCP project
Analyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans.
$ npx skills add google/skills --skill bigquery-slot-cost-optimizer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install google/skills bigquery-slot-cost-optimizer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/google/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cloud/bigquery-slot-cost-optimizer .claude/skills/bigquery-slot-cost-optimizer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "bigquery-slot-cost-optimizer" agent skill from https://github.com/google/skills/tree/main/skills/cloud/bigquery-slot-cost-optimizer into .claude/skills/bigquery-slot-cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bigquery-slot-cost-optimizer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/google/skills/tree/main/skills/cloud/bigquery-slot-cost-optimizerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add google/skills --skill bigquery-slot-cost-optimizer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install google/skills bigquery-slot-cost-optimizer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/cloud/bigquery-slot-cost-optimizer .agents/skills/bigquery-slot-cost-optimizer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "bigquery-slot-cost-optimizer" agent skill from https://github.com/google/skills/tree/main/skills/cloud/bigquery-slot-cost-optimizer into .agents/skills/bigquery-slot-cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bigquery-slot-cost-optimizer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add google/skills --skill bigquery-slot-cost-optimizer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install google/skills bigquery-slot-cost-optimizer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/cloud/bigquery-slot-cost-optimizer .cursor/skills/bigquery-slot-cost-optimizer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "bigquery-slot-cost-optimizer" agent skill from https://github.com/google/skills/tree/main/skills/cloud/bigquery-slot-cost-optimizer into .cursor/skills/bigquery-slot-cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bigquery-slot-cost-optimizer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/google/skills.git --path skills/cloud/bigquery-slot-cost-optimizer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add google/skills --skill bigquery-slot-cost-optimizer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install google/skills bigquery-slot-cost-optimizer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/cloud/bigquery-slot-cost-optimizer .gemini/skills/bigquery-slot-cost-optimizer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "bigquery-slot-cost-optimizer" agent skill from https://github.com/google/skills/tree/main/skills/cloud/bigquery-slot-cost-optimizer into .gemini/skills/bigquery-slot-cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bigquery-slot-cost-optimizer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install google/skills bigquery-slot-cost-optimizerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add google/skills --skill bigquery-slot-cost-optimizer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/google/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/cloud/bigquery-slot-cost-optimizer .github/skills/bigquery-slot-cost-optimizer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "bigquery-slot-cost-optimizer" agent skill from https://github.com/google/skills/tree/main/skills/cloud/bigquery-slot-cost-optimizer into .github/skills/bigquery-slot-cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bigquery-slot-cost-optimizer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add google/skills --skill bigquery-slot-cost-optimizer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install google/skills bigquery-slot-cost-optimizer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/cloud/bigquery-slot-cost-optimizer .opencode/skills/bigquery-slot-cost-optimizer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "bigquery-slot-cost-optimizer" agent skill from https://github.com/google/skills/tree/main/skills/cloud/bigquery-slot-cost-optimizer into .opencode/skills/bigquery-slot-cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bigquery-slot-cost-optimizer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
bigquery-slot-cost-optimizerAnalyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans.
The skill gives an agent a procedure for working out where BigQuery resources go: calculating slot hours, spotting slot contention and queueing, catching Cartesian joins and row-count explosions, and finding scans of unpartitioned tables or missing partition filters. A `scripts/slot_analyzer.py` script does the analysis, with rules and remediation playbooks in two reference files.
Setup matters here. You need the Google Cloud CLI, the `google-cloud-bigquery` Python package, a project with an active billing account and the BigQuery API enabled, Application Default Credentials and the required IAM roles. INFORMATION_SCHEMA views are scoped to a region, so querying the wrong one returns empty job data; pass the matching `--region` and the script normalizes names like `us-central1`. For general BigQuery administration, BigQuery ML or DataFrame work, the skill points to sibling skills.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 5120a76. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
python3From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
docs.cloud.google.comcloud.google.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
BigQuery Slot and Cost Optimizer loads about 2.3k tokens when it runs, and up to ~8.2k if it reads all its reference files. Until then it costs about 110 tokens; SKILL.md has 633 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from google/skills at commit 5120a76, republished under its Apache-2.0 licence (© google). 633 words, ~2,264 tokens.
.claude/skills/bigquery-slot-cost-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.This skill equips AI agents and cloud engineers with procedural heuristics to analyze BigQuery resource consumption, calculate slot hours, identify slot contention and queueing, mitigate Cartesian joins, and optimize unpartitioned table scans.
Activate this skill whenever the user asks to:
Before executing this skill, ensure the environment is configured with the necessary SDKs, permissions, and billing:
Cloud SDK and client library installation:
Install the Google Cloud CLI: Google Cloud SDK installation guide
Install the BigQuery Python client:
pip install google-cloud-bigqueryProject, billing, and regional selection:
Set the active project:
gcloud config set project <PROJECT_ID>Important: the target Google Cloud project must have an active Cloud Billing account attached.
Regional selection: specify the target BigQuery dataset location or execution region, as BigQuery INFORMATION_SCHEMA views are strictly region-scoped (for example, multi-regions like region-us or region-eu, or single regions like region-us-central1). Querying the wrong region returns empty job telemetry. Pass the matching region via --region (the script automatically normalizes location names like us-central1 to region-us-central1). For valid location identifiers, see BigQuery locations.
API enablement:
Enable the BigQuery API on the project:
gcloud services enable bigquery.googleapis.comAuthentication setup:
Authenticate the local gcloud environment and configure Application Default Credentials (ADC):
gcloud auth login
gcloud auth application-default loginIAM roles and permissions:
roles/bigquery.jobUser: grants permission to run queries and analyze telemetry.roles/bigquery.resourceViewer: grants read-only access to query metadata in INFORMATION_SCHEMA.JOBS_BY_PROJECT and capacity reservations.Pricing reference:
scripts/slot_analyzer.py, retrieve live BigQuery billing rates at runtime from official Google Cloud BigQuery Pricing (and consult BigQuery editions introduction for edition capabilities) after considering user-specific parameters such as target region, chosen edition (Standard, Enterprise, Enterprise Plus), and commitment tier (Pay-as-you-go, 1-year, 3-year). Pass these runtime-fetched rates explicitly via --ondemand-rate <USD_PER_TIB> and --slot-hour-rate <USD_PER_SLOT_HOUR>.Run scripts/slot_analyzer.py to pull and analyze historical query telemetry from INFORMATION_SCHEMA.JOBS_BY_PROJECT, passing the runtime-retrieved pricing rates for your specific region, edition, and commitment tier:
# General analysis passing live regional pricing rates fetched from BigQuery pricing
python3 scripts/slot_analyzer.py --project-id <PROJECT_ID> --days 7 \
--ondemand-rate <USD_PER_TIB> --slot-hour-rate <USD_PER_SLOT_HOUR> --format table
# Output structured JSON for programmatically parsing recommendations
python3 scripts/slot_analyzer.py --project-id <PROJECT_ID> --days 7 \
--ondemand-rate <USD_PER_TIB> --slot-hour-rate <USD_PER_SLOT_HOUR> --format json
# Offline verification mode using synthetic or extracted telemetry
python3 scripts/slot_analyzer.py --mock-data-file path/to/extracted_telemetry.json \
--ondemand-rate <USD_PER_TIB> --slot-hour-rate <USD_PER_SLOT_HOUR> --format table
# Dry-run mode to inspect regional SQL query
python3 scripts/slot_analyzer.py --project-id <PROJECT_ID> --region region-us --dry-runRun python3 scripts/slot_analyzer.py --help to inspect all supported CLI flags, focus modes (--mode), and required pricing rate arguments (--ondemand-rate per TiB and --slot-hour-rate per slot-hour).
Evaluate the telemetry output using the following decision rules. CRITICAL MANDATE: After classifying the query issue using the decision tree below, you MUST immediately call view_file on references/remediation_playbooks.md to read and execute the corresponding remediation playbook (Rule SLOT-001, Rule JOIN-001, or Rule PART-001) and include all mandatory diagnostic SQL queries and 4-step checklists in your response.
[Query Telemetry Analyzed]
|
+---> If wait_ratio_avg > 0.40 OR slot_contention == TRUE
| --> Classify as slot contention and queueing (Rule SLOT-001)
| --> MANDATORY: Read Rule SLOT-001 in references/remediation_playbooks.md
|
+---> If shuffle_output_bytes_spilled > 0 OR records_written > 10 * records_read
| --> Classify as Cartesian join (Rule JOIN-001)
| --> MANDATORY: Read Rule JOIN-001 in references/remediation_playbooks.md
|
+---> If total_bytes_billed > 10 GB AND no date/partition filters
| --> Classify as unpartitioned scan (Rule PART-001)
| --> MANDATORY: Read Rule PART-001 in references/remediation_playbooks.md
|
+---> Otherwise
--> Check BI Engine, search indexes, or materialized view opportunities
--> MANDATORY: Read references/optimization_rules.mdTo minimize token consumption in SKILL.md, concrete remediation playbooks (Rule SLOT-001, Rule JOIN-001, Rule PART-001), diagnostic SQL queries, and DDL rewrite patterns are housed in references/:
Before finalizing query rewrites:
Validate query syntax and calculate estimated bytes scanned without incurring cost:
from google.cloud import bigquery
client = bigquery.Client()
job_config = bigquery.QueryJobConfig(dry_run=True, use_query_cache=False)
query_job = client.query(optimized_sql, job_config=job_config)
print(f"Scanned bytes: {query_job.total_bytes_processed / (1024**3):.2f} GB")Offline mock telemetry verification: validate heuristic classification, slot contention detection, Cartesian join identification, and cost estimation offline using synthetic or extracted JSON telemetry payloads (--mock-data-file):
python3 scripts/slot_analyzer.py --mock-data-file path/to/extracted_telemetry.json \
--ondemand-rate <USD_PER_TIB> --slot-hour-rate <USD_PER_SLOT_HOUR> --format tableCLI dry-run inspection: verify regional SQL query formation and script execution without contacting BigQuery or incurring costs:
python3 scripts/slot_analyzer.py --project-id <PROJECT_ID> --region region-us --dry-run© google, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (scripts, references) in skills/cloud/bigquery-slot-cost-optimizer of google/skills.
Open the folder on GitHubat commit 5120a76
BigQuery Slot and Cost Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| BigQuery Slot and Cost Optimizer this skillgoogle/skills | 21k | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Analyze Usageopenshift-eng/ai-helpers | 120 | — | ~2.7k | Automated safety check: Pass | Apache-2.0 | |
| Io ConnectorsKilo-Org/kilo-marketplace | 190 | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Altimate Data Warehouse DelegateAltimateAI/data-engineering-skills | 128 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Expensive Snowflake Query FinderAltimateAI/data-engineering-skills | 128 | — | ~662 | Automated safety check: Pass | MIT | |
| Deploying On GCPancoleman/ai-design-components | 526 | — | ~3.9k | Automated safety check: Pass | MIT |
openshift-eng/ai-helpers
A skill your agent uses when analyzing BigQuery usage patterns, costs, and query performance for a GCP project
Kilo-Org/kilo-marketplace
Guides development and usage of I/O connectors in Apache Beam.
AltimateAI/data-engineering-skills
Delegates dbt and warehouse tasks such as lineage, migrations and cost attribution to the altimate-code CLI agent and relays its answer back.
AltimateAI/data-engineering-skills
Ranks the costliest, slowest or heaviest-scanning Snowflake queries from query history and suggests how to optimize them.
ancoleman/ai-design-components
Implement applications using Google Cloud Platform (GCP) services.
warpdotdev/oz-skills
Generate reproducible analysis artifacts — SQL queries, Python visualizations, and summary tables — as you work through a BigQuery data analysis.
google/skills
Query Cloud Trace spans, filter by latency thresholds or error status, correlate distributed traces with Cloud Logging, and diagnose latency bottlenecks across Google Cloud services.
google/skills
Manages Google Cloud Privileged Access Manager entitlements and grants: create and edit entitlements, request temporary access, and approve or deny pending grants.
google/skills
Writes Terraform alerting policies for AI agents that emit OpenTelemetry metrics, covering reliability, cost, safety, security and quality signals on Google Cloud.
google/skills
Deploys open models or custom weights from Model Garden to Agent Platform endpoints, checks deployment status and cleans up endpoints, confirming before any change.
google/skills
Searches, manages and scaffolds skills in the Gemini Enterprise Agent Platform Skill Registry using bundled Python scripts and Google Cloud credentials.
google/skills
Designs GCP infrastructure as local Terraform, validates and scans it against best practices, then imports it to Application Design Center for deployment and troubleshooting.
Works with
Categories
Analyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans. The skill gives an agent a procedure for working out where BigQuery resources go: calculating slot hours, spotting slot contention and queueing, catching Cartesian joins and row-count explosions, and finding scans of unpartitioned tables or missing partition filters.py` script does the analysis, with rules and remediation playbooks in two reference files.
BigQuery Slot and Cost Optimizer fits situations like: diagnosing slow BigQuery queries or slot starvation; finding the most expensive queries behind high on-demand costs; detecting unpartitioned table scans or join explosions.
Run `npx skills add google/skills --skill bigquery-slot-cost-optimizer -a claude-code`. Or copy the skill folder (skills/cloud/bigquery-slot-cost-optimizer in google/skills) into .claude/skills/bigquery-slot-cost-optimizer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add google/skills --skill bigquery-slot-cost-optimizer -a codex`. Or copy the skill folder (skills/cloud/bigquery-slot-cost-optimizer in google/skills) into .agents/skills/bigquery-slot-cost-optimizer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google/skills --skill bigquery-slot-cost-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bigquery-slot-cost-optimizer, .gemini/skills/bigquery-slot-cost-optimizer, .github/skills/bigquery-slot-cost-optimizer and .opencode/skills/bigquery-slot-cost-optimizer in your project.
Going by SKILL.md and its folder, BigQuery Slot and Cost Optimizer needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Google Cloud CLI with Application Default Credentials; Python with the google-cloud-bigquery package; A project with billing and the BigQuery API enabled.
SKILL.md names 2 domains. As links in the text: docs.cloud.google.com and cloud.google.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
BigQuery Slot and Cost Optimizer is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.9k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with BigQuery Slot and Cost Optimizer: Analyze Usage (openshift-eng/ai-helpers, 120 stars), Io Connectors (Kilo-Org/kilo-marketplace, 190 stars), Altimate Data Warehouse Delegate (AltimateAI/data-engineering-skills, 128 stars) and Expensive Snowflake Query Finder (AltimateAI/data-engineering-skills, 128 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
google (a GitHub organization, an official publisher) maintains it in google/skills, which has 21,069 GitHub stars. The repository holds 147 skills in this directory. The repository was last updated on October 9, 2026.
Source: google/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.