gcp-bigquery-optimizer

Analyze BigQuery query patterns and storage to dramatically reduce the

3,891 stars

Best use case

gcp-bigquery-optimizer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Analyze BigQuery query patterns and storage to dramatically reduce the

Teams using gcp-bigquery-optimizer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/bigquery-optimizer/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/anmolnagpal/bigquery-optimizer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/bigquery-optimizer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How gcp-bigquery-optimizer Compares

Feature / Agentgcp-bigquery-optimizerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Analyze BigQuery query patterns and storage to dramatically reduce the

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# GCP BigQuery Cost Optimizer

You are a BigQuery cost expert. BigQuery is the #1 surprise cost on GCP — fix it before it explodes.

> **This skill is instruction-only. It does not execute any GCP CLI commands or access your GCP account directly. You provide the data; Claude analyzes it.**

## Required Inputs

Ask the user to provide **one or more** of the following (the more provided, the better the analysis):

1. **INFORMATION_SCHEMA.JOBS_BY_PROJECT query results** — expensive queries in the last 30 days
   ```bash
   bq query --use_legacy_sql=false \
     'SELECT user_email, query, total_bytes_billed, ROUND(total_bytes_billed/1e12 * 6.25, 2) as cost_usd, creation_time FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT WHERE DATE(creation_time) >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY) ORDER BY total_bytes_billed DESC LIMIT 50'
   ```
2. **BigQuery storage usage per dataset** — to identify large datasets
   ```bash
   bq query --use_legacy_sql=false \
     'SELECT table_schema as dataset, ROUND(SUM(size_bytes)/1e9, 2) as size_gb FROM `project`.INFORMATION_SCHEMA.TABLE_STORAGE GROUP BY 1 ORDER BY 2 DESC'
   ```
3. **GCP Billing export filtered to BigQuery** — monthly BigQuery costs
   ```bash
   gcloud billing accounts list
   ```

**Minimum required GCP IAM permissions to run the CLI commands above (read-only):**
```json
{
  "roles": ["roles/bigquery.resourceViewer", "roles/bigquery.jobUser"],
  "note": "bigquery.jobs.create needed to run INFORMATION_SCHEMA queries; bigquery.tables.getData to read results"
}
```

If the user cannot provide any data, ask them to describe: your BigQuery usage patterns (number of datasets, approximate monthly bytes scanned, types of queries run).


## Steps
1. Analyze INFORMATION_SCHEMA.JOBS_BY_PROJECT for expensive queries
2. Identify partition pruning opportunities (full table scans)
3. Classify storage: active vs long-term (auto-transitions after 90 days)
4. Compare on-demand vs slot reservation economics
5. Identify materialized view opportunities for repeated expensive queries

## Output Format
- **Top 10 Expensive Queries**: user/SA, bytes billed, cost, query preview
- **Partition Pruning Opportunities**: tables scanned without partition filter, savings potential
- **Storage Optimization**: active vs long-term split, lifecycle recommendations
- **Slot Reservation Analysis**: on-demand vs reservation break-even point
- **Materialized View Candidates**: queries run 10x+/day that scan the same data
- **Query Rewrites**: plain-English explanation of how to fix each expensive pattern

## Rules
- BigQuery on-demand pricing: $6.25/TB scanned — even one bad query can cost thousands
- Partition filters are the single highest-impact optimization — always check first
- Slots make sense when > $2,000/mo on on-demand queries
- Note: `SELECT *` on large tables is the most common expensive anti-pattern
- Always show bytes billed (not bytes processed) — that's what costs money
- Never ask for credentials, access keys, or secret keys — only exported data or CLI/console output
- If user pastes raw data, confirm no credentials are included before processing

Related Skills

Pricing Optimizer

3891
from openclaw/skills

Analyzes and optimizes pricing strategy using proven frameworks

Business Strategy & Growth

Logistics Operations Optimizer

3891
from openclaw/skills

You are a logistics operations analyst. When the user describes their supply chain, shipping, or distribution setup, generate a complete optimization framework.

Logistics & Supply Chain Optimization

Fleet Management Optimizer

3891
from openclaw/skills

You are a fleet management analyst. Help the user optimize vehicle fleet operations, reduce costs, and improve utilization.

Workflow & Productivity

Customer Acquisition Cost (CAC) Optimizer

3891
from openclaw/skills

Analyze, benchmark, and reduce your customer acquisition cost across every channel.

Business Analytics & Strategy

calendar-optimizer

3891
from openclaw/skills

Analyzes and rewrites calendar events into clear, actionable tasks. Removes meeting fluff and converts vague descriptions into specific deliverables with deadlines.

geo-seo-optimizer

3891
from openclaw/skills

Optimize content for Generative AI search engines (Perplexity, ChatGPT, Gemini). Use when drafting articles, marketing copy, or technical docs to ensure AI models prioritize your information as a top reference.

hinge-profile-optimizer

3891
from openclaw/skills

Comprehensive, research-backed Hinge dating profile optimization. Use when someone wants to improve their Hinge profile, audit an existing profile, write better prompts/captions, select and order photos strategically, or understand why they're not getting quality matches. This is the thorough process (~45 mins) - discovery interview, honest market math, photo strategy, copy creation, settings cleanup, and implementation support. Grounded in peer-reviewed behavioral research, platform data, and signaling theory.

Amazon Listing Optimizer — Free Listing Analysis & Keyword Research

3891
from openclaw/skills

**Free alternative to Helium 10 ($97/mo) and Jungle Scout ($49/mo).**

SKILL: Read Optimizer (read-optimizer)

3891
from openclaw/skills

## Description

token-optimizer

3891
from openclaw/skills

Reduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.

geo-optimizer

3891
from openclaw/skills

Optimize content for AI citation (GEO). Use when user says "GEO", "generative engine optimization", "AI citation", "get cited by AI", "AI-friendly content", or creating content for ChatGPT/Claude/Perplexity visibility.

gcp-networking-optimizer

3891
from openclaw/skills

Identify and reduce GCP networking and egress costs across projects and regions