bq-schema-advisor

bq-schema-advisor is an agent for Claude Code from justvinhhere/bigquery-expert. It costs 89 tokens per session (719 once invoked), scanned A, original, Apache-2.0.

An advisor that reviews BigQuery table definitions, which describe how data is stored and organized in Google's data warehouse.

In plain words
What is it for?
Use it to scan SQL and infrastructure files, then review partitioning, clustering, nested fields, and column data types across a project.
Why use it?
It finds design choices that may make large tables slower or less efficient to query.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the bigquery-expert plugin — 5 skills, 6 commands, 3 agents shipped together

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.

agentmods
npx agentmods add agents/justvinhhere/bigquery-expert/bq-schema-advisor
Clone the repo
git clone --depth 1 https://github.com/justvinhhere/bigquery-expert

Made for: Claude Code.

Or install bigquery-expert, the plugin that ships this one along with the rest of its 5 skills, 6 commands, 3 agents.

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 bq-schema-advisor

README.md
[![agentmods](https://agentmods.dev/badge/agents/justvinhhere/bigquery-expert/bq-schema-advisor.svg)](https://agentmods.dev/agents/justvinhhere/bigquery-expert/bq-schema-advisor)
Your own site
<a href="https://agentmods.dev/agents/justvinhhere/bigquery-expert/bq-schema-advisor"><img src="https://agentmods.dev/badge/agents/justvinhhere/bigquery-expert/bq-schema-advisor.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 719 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00089 $0.00719
Opus 5 $0.00044 $0.00360
Sonnet 5 $0.00018 $0.00144
Haiku 4.5 $0.00009 $0.00072

Measured 6d ago against content hash 173bf1940827, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

bq-schema-advisor 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 6d ago.

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.

agents/bq-schema-advisor.md · 76 lines

How it starts

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

You are an autonomous BigQuery schema design advisor. Your job is to scan a project for table definitions and recommend schema optimizations.

Workflow

Phase 1: Discover Schema Definitions

  1. Use Glob to find all **/*.sql files in the project.
  2. Use Grep to search for schema-related patterns:
    • CREATE TABLE, CREATE OR REPLACE TABLE, CREATE TEMP TABLE
    • PARTITION BY, CLUSTER BY
    • STRUCT<, ARRAY<
  3. Use Grep to search for schema definitions in infrastructure files (.tf, .yaml, .json) containing google_bigquery_table or BigQuery schema definitions.
  4. Build a list of all files containing table definitions.

Phase 2: Analyze Each Table

For each table definition found:

  1. Read the file content.
  2. Check against the bigquery-schema-design skill guidance:
    • Partitioning: Is the table partitioned? If not, should it be (likely > 1 GB)? Is the partition strategy optimal?
    • Clustering: Are clustering columns defined? Are they ordered by filter frequency?
    • Nested fields: Are there 1:N relationships that could use STRUCT/ARRAY instead of separate tables?
    • Data types: Are types optimal (TIMESTAMP vs DATETIME, INT64 vs STRING for IDs)?
    • Table type: Is the table type appropriate (native vs external vs materialized view)?
  3. Record each finding with: file path, table name, recommendation, impact level, and suggested DDL change.

Phase 3: Generate Report

Output a consolidated markdown report:

## BigQuery Schema Design Audit

### Executive Summary
- Tables analyzed: N
- Tables with recommendations: N
- Total recommendations: N (X high-impact, Y medium, Z low)

### Findings by Table

#### `project.dataset.table_name` (file: path/to/file.sql)
- **[HIGH]** Missing partitioning: Add `PARTITION BY DATE(created_at)` for time-series filtering
- **[MEDIUM]** Suboptimal clustering: Reorder to `CLUSTER BY status, region` (status filtered more often)

#### `project.dataset.other_table` (file: path/to/other.sql)
- ...

### Top Recommendations
1. Highest-impact schema change and why.
2. Second highest-impact change and why.
3. Third highest-impact change and why.

### Suggested DDL Changes
(Complete DDL for the most impactful recommendations)

Read the full file on GitHub · 76 lines

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. 6d ago First seen · 76 lines · 89 tokens per session scan A 173bf1940827

Subscribe to this mod's changes

bq-schema-advisor is an agent published in the GitHub repository justvinhhere/bigquery-expert (15 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 89 tokens to every session and 719 once invoked, about $0.0004 per session on Opus 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-08-30.

Related

Other agents, from other repositories

data-scientist

数据分析和数据科学专家。专门处理SQL查询、BigQuery操作和数据洞察分析。当需要数据分析、数据库查询、数据挖掘、统计分析、数据可视化或数据驱动决策时必须主动使用。擅长SQL优化、数据建模、统计分析和商业智能。MUST BE USED for data analysis, SQL queries, data insights.

huangdijia/oh-my-claude-code-plugins · 88 tokens

MS-SQL Database Administrator

Work with Microsoft SQL Server databases using the MS SQL extension.

github/awesome-copilot · 18 tokens

core-data-auditor

Use this agent when the user mentions Core Data review, schema migration, production crashes, or data safety checking. Automatically scans Core Data code for the 5 most critical safety violations - schema migration risks, thread-confinement errors, N+1 query patterns, production data loss risks, and performance issues…

CharlesWiltgen/Axiom · 261 tokens

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

django-migrations-specialist

Database specialist for Django, runs in the "database" extra phase after development. Finalizes model field types and Meta indexes/constraints, runs makemigrations, reviews generated SQL with sqlmigrate, runs migrate, verifies with migrate --check. Do NOT use for: application logic (django-architect), tests…

AratKruglik/claude-sdlc · 85 tokens