A comprehensive BigQuery plugin for Claude Code. Five integrated skill areas that activate automatically -- writing queries, designing schemas, optimizing costs, detecting anti-patterns, and navigating BigQuery-specific features.
FAQ
bigquery-expert is a Claude Code plugin with 5 hand-picked skills for data work, indexed on Flowy. Install it with the command on its page. It includes bigquery-cost-optimization, bigquery-features, bigquery-optimization. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
> /plugin marketplace add justvinhhere/bigquery-expert> /plugin install bigquery-expert@justvinhhere-bigquery-expert
Repo: justvinhhere/bigquery-expert
A comprehensive BigQuery plugin for Claude Code. Five integrated skill areas that activate automatically -- writing queries, designing schemas, optimizing costs, detecting anti-patterns, and navigating BigQuery-specific features.
| Skill | Coverage |
|---|---|
| Query Generation | Generate optimized SQL from natural language. Convert queries from PostgreSQL, MySQL, Snowflake, Redshift, and SQL Server. |
| Query Optimization | Detect and fix 11 SQL anti-patterns with before/after rewrites. Project-wide scanning across .sql and code files. |
| Schema Design | Partitioning (time-unit, integer-range, ingestion-time), clustering, nested/repeated fields (STRUCT/ARRAY), denormalization, table types, and data type selection. |
| Cost Optimization | On-demand vs editions pricing, bytes-billed reduction, slot optimization, materialized views, query caching, storage management, and dry-run estimation. |
| BigQuery Features | STRUCT/ARRAY/UNNEST, MERGE DML, scripting, JSON functions, approximate aggregation, geography, BigQuery ML, search indexes, and vector search. |
Skills activate based on context. Ask Claude to write a query and the generation skill engages. Discuss partitioning and the schema design skill kicks in. Multiple skills can activate simultaneously when a request spans areas.
/plugin marketplace add justvinhhere/bigquery-expert
/plugin install bigquery-expert@justvinhhere-bigquery-expert
Or open /plugin, go to the Discover tab, and select bigquery-expert.
/reload-plugins
| Command | What It Does |
|---|---|
/bigquery-expert:bq-generate | Generate optimized SQL from a natural language description |
/bigquery-expert:bq-review | Review SQL for performance anti-patterns |
/bigquery-expert:bq-optimize | Rewrite SQL with all detected anti-patterns fixed |
/bigquery-expert:bq-design-table | Design a table schema with partitioning, clustering, and data types |
/bigquery-expert:bq-estimate-cost | Estimate the cost of a query or table |
/bigquery-expert:bq-explain | Explain a BigQuery feature with working examples |
All commands accept a file path, inline SQL, or a description as an argument. Without arguments, they use the most recent SQL in the conversation.
Examples:
/bigquery-expert:bq-generate "daily active users grouped by country for the last 30 days"
/bigquery-expert:bq-review path/to/query.sql
/bigquery-expert:bq-optimize "SELECT * FROM `project.dataset.events`"
/bigquery-expert:bq-design-table "user click events with timestamp, page URL, and session ID"
/bigquery-expert:bq-estimate-cost path/to/expensive_query.sql
/bigquery-expert:bq-explain "MERGE for upserts"
Agents run autonomously across your project when you ask naturally:
| Agent | Use When You Say... |
|---|---|
| bq-reviewer | "Review all SQL files in this project for anti-patterns" |
| bq-schema-advisor | "Audit my table schemas and recommend partitioning strategies" |
| bq-cost-analyzer | "Which queries in this project are the most expensive?" |
The query optimization skill detects 11 BigQuery SQL anti-patterns:
| # | Pattern | Fix | Severity |
|---|---|---|---|
| 1 | SELECT * on single-table query | Specify only needed columns | High |
| 2 | IN/NOT IN without DISTINCT | Add DISTINCT to subquery | Medium |
| 3 | CTE referenced multiple times | Convert to CREATE TEMP TABLE | High |
| 4 | ORDER BY without LIMIT | Add LIMIT clause | Medium |
| 5 | REGEXP_CONTAINS for simple patterns | Use LIKE instead | Low |
| 6 | ROW_NUMBER() + WHERE rn = 1 | Use ARRAY_AGG(... LIMIT 1) | High |
| 7 | Subquery inside WHERE | Extract to DECLARE variable or CTE | Medium |
| 8 | WHERE predicates not ordered by selectivity | Reorder by operator cost (advisory) | Low |
| 9 | Smaller table first in JOIN | Place largest table first (advisory) | Low |
| 10 | CREATE TEMP TABLE without DROP | Add DROP TABLE at end of script | Low |
| 11 | CREATE TABLE + DROP TABLE in same script | Use CREATE TEMP TABLE instead | Low |
Based on BigQuery Anti-Pattern Recognition by Google Cloud Platform (Apache 2.0).
Before -- ROW_NUMBER() for latest record per group (High severity):
SELECT taxi_id, trip_seconds, fare
FROM (
SELECT taxi_id, trip_seconds, fare,
ROW_NUMBER() OVER (PARTITION BY taxi_id ORDER BY fare DESC) rn
FROM `bigquery-public-data.chicago_taxi_trips.taxi_trips`
)
WHERE rn = 1
After -- ARRAY_AGG (optimized):
SELECT event.*
FROM (
SELECT ARRAY_AGG(
t ORDER BY t.fare DESC LIMIT 1
)[OFFSET(0)] event
FROM `bigquery-public-data.chicago_taxi_trips.taxi_trips` t
GROUP BY t.taxi_id
)
skills/
bigquery-optimization/ 11 anti-pattern references
bigquery-query-generation/ Schema-aware generation, common patterns, dialect conversion
bigquery-schema-design/ Partitioning, clustering, nested fields, denormalization, types
bigquery-cost-optimization/ Pricing, bytes-billed, slots, materialized views, storage
bigquery-features/ STRUCT/ARRAY, MERGE, scripting, JSON, geo, BQML, vector search
commands/
bq-generate, bq-review, bq-optimize, bq-design-table, bq-estimate-cost, bq-explain
agents/
bq-reviewer, bq-schema-advisor, bq-cost-analyzer
/plugin uninstall bigquery-expert@justvinhhere-bigquery-expert
/plugin marketplace remove justvinhhere-bigquery-expert
Contributions welcome. Fork the repository, create a feature branch, and submit a pull request.
For bugs and feature requests, open an issue.
Apache License 2.0 -- see LICENSE for details.
.claude-plugin/
marketplace.json
plugin.json
.gitignore
agents/
bq-cost-analyzer.md
bq-reviewer.md
bq-schema-advisor.md
commands/
bq-design-table.md
bq-estimate-cost.md
bq-explain.md
bq-generate.md
bq-optimize.md
bq-review.md
LICENSE
README.md
skills/
bigquery-cost-optimization/
references/
01-pricing-models.md
02-bytes-billed-reduction.md
03-slot-optimization.md
04-materialized-views-caching.md
05-storage-optimization.md
SKILL.md
bigquery-features/
references/
01-struct-array-unnest.md
02-merge-dml.md
03-scripting.md
04-json-functions.md
05-approximate-aggregation.md
06-geography-functions.md
07-bqml.md
08-search-vector.md
SKILL.md
bigquery-optimization/
references/
01-simple-select-star.md
02-semi-join-without-agg.md
03-ctes-eval-multiple-times.md
04-order-by-without-limit.md
05-string-comparison.md
06-latest-record-with-analytic-fun.md
07-dynamic-predicate.md
08-where-order.md
09-join-order.md
10-missing-drop-statement.md
11-convert-table-to-temp.md
SKILL.md
bigquery-query-generation/
references/
01-schema-aware-generation.md
02-common-query-patterns.md
03-dialect-conversion.md
SKILL.md
bigquery-schema-design/
references/
01-partitioning-strategies.md
02-clustering.md
03-nested-repeated-fields.md
04-denormalization-patterns.md
05-table-types.md
06-data-type-best-practices.md
SKILL.md© 2026 Flowy · Free and open source
Built for Claude Code · Not affiliated with Anthropic