/sql-query-optimizer:bigquery-query-optimizationfrom sql-query-optimizer
Diagnoses and rewrites slow BigQuery SQL using query plans, focusing on partition/cluster pruning, JOIN ordering, broadcast vs shuffle joins, and function choices. Use when queries are slow, expensive, or hitting Resources Exceeded.
Ships in sql-query-optimizer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
Resources Exceeded..sql, .py, .js, .ts, .java, .go) for BigQuery SQL anti-patterns.sql-query-optimization.gcp-data-engineering.cdc-scd-patterns.python3 ./skills/bigquery-query-optimization/scripts/lint_sql_query.py [optional_path] across target directories.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.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.SELECT * with explicit columns; filter on partition columns and align WHERE/JOIN predicates with clustered keys.FROM followed by decreasing sizes; push filters into CTEs/subqueries before joining; model 1:N structures with ARRAY<STRUCT> where appropriate.ORDER BY with LIMIT; use APPROX_COUNT_DISTINCT when ~1% tolerance fits; replace JS UDFs with native SQL UDFs.PLAN.md (<= 50 lines); skip docs/<feature-name>/execution-plan.md (<= 50 lines) for inline single-query rewrites; cap docs/<feature-name>/optimization-report.md at <= 55 lines (Zero-Fluff before/after metrics table + Original / Optimized / Engine-Grounded Reasoning).AGENTS.md (<= 90 lines) and persist partition/cluster baselines in context/memory/MEMORY.md.# Scan repository or SQL directory for BigQuery anti-patterns
python3 ./skills/bigquery-query-optimization/scripts/lint_sql_query.py .
python3 ./skills/bigquery-query-optimization/scripts/lint_sql_query.py queries/
# Verify byte scan reduction via BigQuery dry-run
bq query --use_legacy_sql=false --dry_run < optimized_query.sql
lint_sql_query.py and bq --dry_run via shell (Bash in Claude Code; Bash in Antigravity), reporting STATIC_ANALYSIS_ONLY / BLOCKED if GCP ADC is unavailable.bq query --dry_run scanned bytes or slot metrics when GCP credentials fail instead of reporting STATIC_ANALYSIS_ONLY / BLOCKED: Live plan not executed — <exact error>.FROM JOINs, running unbounded ORDER BY without LIMIT, omitting partition filters, or using REGEXP_CONTAINS where LIKE suffices.python3 ./skills/bigquery-query-optimization/scripts/lint_sql_query.py .bq query --dry_run confirms byte scan reduction, OR report explicitly states STATIC_ANALYSIS_ONLY / BLOCKED: Live plan not executed — <exact error>.JOINs, partition filters applied, and no unbounded ORDER BY remains.optimization-report.md (<= 55 lines) presents before/after metrics + Original / Optimized / Engine-Grounded Reasoning.What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/context-captureUse when finishing a task at State 5 (Ship & Finish) or when the user explicitly asks to "save context", "guarda contexto", "record decisions", or "hand off" — writes ultra-compact persistent memory to context/memory/ and ensures target-project root AGENTS.md (<= 90 lines) stays wired to DESIGN.md and MEMORY.md across Claude Code and Google Antigravity./context-restoreUse at session start (State 0) or when asked to "load context", "catch up", or "what was done before" — prioritizes LLM Wiki Progressive Disclosure (context/memory/MEMORY.md) across Claude Code and Google Antigravity while supporting user-confirmed restore for scripted sessions (context/sessions/)./sql-query-optimizationDiagnoses and rewrites slow SQL on traditional engines (Postgres, MySQL, SQL Server, etc.) using EXPLAIN/EXPLAIN ANALYZE — indexing strategy, WHERE clause selectivity, avoiding functions on indexed columns, JOIN vs. subquery vs. CTE tradeoffs, and pagination. Use for any query slowness outside BigQuery, or when a query needs an index.npx claudepluginhub jggomez/expert-ai-developer-skills --plugin sql-query-optimizerOther plugins' skills for the same job