bigquery-query-optimization

bigquery-query-optimization is a skill for Claude Code, Codex from jggomez/expert-ai-developer-skills. It costs 88 tokens per session (1,212 once invoked), scanned A, original, Apache-2.0.

Diagnoses and rewrites slow BigQuery SQL using the query plan (stages, shuffle, workers) — partitioning/clustering pruning, JOIN ordering and broadcast vs. shuffle joins, skewed JOINs, WHERE clause selectivity, and approximate/SQL-vs-JS function choices. Use when a BigQuery query is slow, expensive, or hitting…

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions AGENTS.md.

Install with agentmods
npx agentmods add skills/jggomez/expert-ai-developer-skills/bigquery-query-optimization
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jggomez/expert-ai-developer-skills --skill bigquery-query-optimization
Clone the repo
git clone --depth 1 https://github.com/jggomez/expert-ai-developer-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bigquery-query-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/jggomez/expert-ai-developer-skills/bigquery-query-optimization/github.svg)](https://agentmods.dev/skills/jggomez/expert-ai-developer-skills/bigquery-query-optimization)
Your own site
<a href="https://agentmods.dev/skills/jggomez/expert-ai-developer-skills/bigquery-query-optimization"><img src="https://agentmods.dev/badge/skills/jggomez/expert-ai-developer-skills/bigquery-query-optimization/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bigquery-query-optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/jggomez/expert-ai-developer-skills/bigquery-query-optimization"><img src="https://agentmods.dev/badge/skills/jggomez/expert-ai-developer-skills/bigquery-query-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,212 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.01212
Opus 5.5 $0.00035 $0.00485
Sonnet 5.5 $0.00018 $0.00242
Haiku 4.5 $0.00009 $0.00121

Measured today against content hash 3b3573565ba3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bigquery-query-optimization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/lint_sql_query.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/antigravity/sql-query-optimizer/skills/bigquery-query-optimization/SKILL.md · 60 lines

How it starts

The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.

BigQuery Query Optimization Skill

Overview

Diagnoses and optimizes slow, expensive, or slot-constrained Google Cloud BigQuery SQL under the principle: less work → faster query. Reduces scanned bytes, stage shuffle, and slot CPU via partition/cluster pruning, broadcast JOIN ordering, and native SQL functions while enforcing concise artifact caps and fail-honest --dry_run reporting.

When to Use

Trigger Scenarios

  • BigQuery queries hitting high byte scans, excessive slot time, shuffle bottlenecks, worker skew, or Resources Exceeded.
  • Optimizing partition pruning, cluster filter alignment, and multi-table JOIN/window patterns.
  • Scanning repositories (.sql, .py, .js, .ts, .java, .go) for BigQuery SQL anti-patterns.

When NOT to Use

  • Traditional OLTP databases (PostgreSQL, MySQL, SQL Server): Route to sql-query-optimization.
  • Lakehouse architecture & service selection: Route to gcp-data-engineering.
  • Datastream CDC & SCD Type 2 merges: Route to cdc-scd-patterns.

Process

Phase 1: Static Linting & Fail-Honest Plan Diagnostics

  1. Static Scan: Run python3 ./skills/bigquery-query-optimization/scripts/lint_sql_query.py [optional_path] across target directories.
  2. Stage & Dry-Run Inspection: Check bq query --use_legacy_sql=false --dry_run and INFORMATION_SCHEMA.JOBS for max-vs-avg worker skew (APPROX_TOP_COUNT), intermediate shuffle volume, and CPU-heavy UDFs/distincts.
  3. Fail-Honest Fallback (STATIC_ANALYSIS_ONLY / BLOCKED): If bq query --dry_run fails due to missing GCP ADC credentials or permissions, explicitly mark the report STATIC_ANALYSIS_ONLY / BLOCKED: Live plan not executed — <exact error> and NEVER invent byte-scan numbers or slot times.

Phase 2: BigQuery Optimization Rules

  1. Column, Partition & Cluster Pruning: Replace SELECT * with explicit columns; filter on partition columns and align WHERE/JOIN predicates with clustered keys.
  2. Broadcast JOIN Ordering & Early Filtering: Place the largest table first in FROM followed by decreasing sizes; push filters into CTEs/subqueries before joining; model 1:N structures with ARRAY<STRUCT> where appropriate.
  3. Bounded Sorts, Approx Aggs & SQL UDFs: Always pair ORDER BY with LIMIT; use APPROX_COUNT_DISTINCT when ~1% tolerance fits; replace JS UDFs with native SQL UDFs.

Read the full file on GitHub · 60 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 60 lines · 88 tokens per session scan A 3b3573565ba3

Subscribe to this mod's changes

bigquery-query-optimization is a skill published in the GitHub repository jggomez/expert-ai-developer-skills (30 stars, last pushed yesterday), licensed Apache-2.0. It adds 88 tokens to every session and 1,212 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-06.

Related

bigquery-query-optimization compared with skills from other repositories

bigquery-query-optimization next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
bigquery-query-optimizationjggomez/expert-ai-developer-skillsSkill30yesterdayApache-2.0A88Claude Code, Codex
reproduce-buggoogleapis/mcp-toolboxSkill17kyesterdayApache-2.0A130Claude Code, Codex
triage-issuesgoogleapis/mcp-toolboxSkill17kyesterdayApache-2.0A164Claude Code, Codex
postgresql-indexingprowler-cloud/prowlerSkill15kyesterdayApache-2.0A108Claude Code
graphjin-evaldosco/graphjinSkill3.2k5d agoApache-2.0A27Claude Code, Codex
axiom-audit-grdb-performanceCharlesWiltgen/AxiomSkill1.3kyesterdayMITA43Codex
django-perf-reviewgetsentry/skillsSkill1.1kyesterdayApache-2.0A55Claude Code