BigQuery Slot and Cost Optimizer
google/skills
Analyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans.
A skill your agent uses when analyzing BigQuery usage patterns, costs, and query performance for a GCP project
$ npx skills add openshift-eng/ai-helpers --skill analyze-usage -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install openshift-eng/ai-helpers analyze-usage --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/openshift-eng/ai-helpers.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/bigquery-cost-analysis/skills/analyze-usage .claude/skills/analyze-usage && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "analyze-usage" agent skill from https://github.com/openshift-eng/ai-helpers/tree/main/plugins/bigquery-cost-analysis/skills/analyze-usage into .claude/skills/analyze-usage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyze-usage", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/openshift-eng/ai-helpers/tree/main/plugins/bigquery-cost-analysis/skills/analyze-usageType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add openshift-eng/ai-helpers --skill analyze-usage -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install openshift-eng/ai-helpers analyze-usage --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openshift-eng/ai-helpers.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/bigquery-cost-analysis/skills/analyze-usage .agents/skills/analyze-usage && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "analyze-usage" agent skill from https://github.com/openshift-eng/ai-helpers/tree/main/plugins/bigquery-cost-analysis/skills/analyze-usage into .agents/skills/analyze-usage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyze-usage", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add openshift-eng/ai-helpers --skill analyze-usage -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install openshift-eng/ai-helpers analyze-usage --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openshift-eng/ai-helpers.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/bigquery-cost-analysis/skills/analyze-usage .cursor/skills/analyze-usage && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "analyze-usage" agent skill from https://github.com/openshift-eng/ai-helpers/tree/main/plugins/bigquery-cost-analysis/skills/analyze-usage into .cursor/skills/analyze-usage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyze-usage", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/openshift-eng/ai-helpers.git --path plugins/bigquery-cost-analysis/skills/analyze-usage--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add openshift-eng/ai-helpers --skill analyze-usage -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install openshift-eng/ai-helpers analyze-usage --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openshift-eng/ai-helpers.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/bigquery-cost-analysis/skills/analyze-usage .gemini/skills/analyze-usage && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "analyze-usage" agent skill from https://github.com/openshift-eng/ai-helpers/tree/main/plugins/bigquery-cost-analysis/skills/analyze-usage into .gemini/skills/analyze-usage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyze-usage", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install openshift-eng/ai-helpers analyze-usageInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add openshift-eng/ai-helpers --skill analyze-usage -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/openshift-eng/ai-helpers.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/bigquery-cost-analysis/skills/analyze-usage .github/skills/analyze-usage && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "analyze-usage" agent skill from https://github.com/openshift-eng/ai-helpers/tree/main/plugins/bigquery-cost-analysis/skills/analyze-usage into .github/skills/analyze-usage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyze-usage", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add openshift-eng/ai-helpers --skill analyze-usage -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install openshift-eng/ai-helpers analyze-usage --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openshift-eng/ai-helpers.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/bigquery-cost-analysis/skills/analyze-usage .opencode/skills/analyze-usage && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "analyze-usage" agent skill from https://github.com/openshift-eng/ai-helpers/tree/main/plugins/bigquery-cost-analysis/skills/analyze-usage into .opencode/skills/analyze-usage/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "analyze-usage", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
analyze-usageA skill your agent uses when analyzing BigQuery usage patterns, costs, and query performance for a GCP project
Analyze Usage is an agent skill from openshift-eng/ai-helpers. Use when analyzing BigQuery usage patterns, costs, and query performance for a GCP project
Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering Data warehousing and Query optimization. It works with Google BigQuery and Google Cloud. The repository describes itself as: Developer productivity tools for Claude Code & other AI assistants. The licence is Apache-2.0.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit a627176. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gcloudbrewbqFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use gcloud, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Analyze Usage loads about 2.7k tokens when it runs. Until then it costs about 26 tokens; SKILL.md has 743 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from openshift-eng/ai-helpers at commit a627176, republished under its Apache-2.0 licence (© openshift-eng). 743 words, ~2,687 tokens.
.claude/skills/analyze-usage/SKILL.md (or your agent's skills folder).This skill performs comprehensive analysis of BigQuery usage patterns, costs, and query performance for a given project. It identifies expensive queries, heavy users, and provides actionable optimization recommendations.
This skill is automatically invoked by the /bigquery-cost-analysis:analyze-usage command to perform usage analysis.
bq command-line tool) must be installedgcloud auth login)bigquery.jobs.list permission at minimumWhen invoked, this skill expects:
First, verify the environment is ready:
bq command is availableExecute the following BigQuery queries against INFORMATION_SCHEMA:
SELECT
COUNT(*) as total_queries,
ROUND(SUM(total_bytes_processed) / POW(10, 12), 2) as total_tb_scanned,
ROUND(SUM(total_bytes_processed) / POW(10, 12) * 6.25, 2) as estimated_cost_usd
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL @hours HOUR)
AND job_type = 'QUERY'
AND state = 'DONE'
AND statement_type != 'SCRIPT'SELECT
user_email,
COUNT(*) as query_count,
ROUND(SUM(total_bytes_processed) / POW(10, 12), 2) as total_tb_scanned,
ROUND(SUM(total_bytes_processed) / POW(10, 12) * 6.25, 2) as estimated_cost_usd,
ROUND(AVG(total_bytes_processed) / POW(10, 9), 2) as avg_gb_per_query
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL @hours HOUR)
AND job_type = 'QUERY'
AND state = 'DONE'
AND statement_type != 'SCRIPT'
GROUP BY user_email
ORDER BY total_tb_scanned DESC
LIMIT 20SELECT
creation_time,
user_email,
job_id,
ROUND(total_bytes_processed / POW(10, 12), 3) as tb_scanned,
ROUND(total_bytes_processed / POW(10, 12) * 6.25, 2) as cost_usd,
SUBSTR(query, 1, 200) as query_preview
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL @hours HOUR)
AND job_type = 'QUERY'
AND state = 'DONE'
AND statement_type != 'SCRIPT'
AND total_bytes_processed > 0
ORDER BY total_bytes_processed DESC
LIMIT 20SELECT
SUBSTR(query, 1, 200) as query_pattern,
COUNT(*) as execution_count,
ROUND(SUM(total_bytes_processed) / POW(10, 12), 3) as total_tb_scanned,
ROUND(AVG(total_bytes_processed) / POW(10, 9), 2) as avg_gb_per_execution,
ANY_VALUE(user_email) as sample_user
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL @hours HOUR)
AND job_type = 'QUERY'
AND state = 'DONE'
AND statement_type != 'SCRIPT'
AND total_bytes_processed > 0
GROUP BY query_pattern
HAVING execution_count > 10
ORDER BY total_tb_scanned DESC
LIMIT 15For the top 2-3 users by data scanned, perform detailed query pattern analysis:
SELECT
SUBSTR(query, 1, 300) as query_pattern,
COUNT(*) as execution_count,
ROUND(SUM(total_bytes_processed) / POW(10, 12), 3) as total_tb_scanned,
ROUND(AVG(total_bytes_processed) / POW(10, 9), 2) as avg_gb_per_execution,
MIN(creation_time) as first_execution,
MAX(creation_time) as last_execution
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE creation_time >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL @hours HOUR)
AND job_type = 'QUERY'
AND state = 'DONE'
AND statement_type != 'SCRIPT'
AND user_email = @user_email
AND total_bytes_processed > 0
GROUP BY query_pattern
ORDER BY total_tb_scanned DESC
LIMIT 20This reveals:
Look for common issues:
Query Anti-Patterns:
SELECT * on large tablesUser Behavior Patterns:
Cost Drivers:
For each issue found, provide:
Prioritization Framework:
Structure the output as:
# BigQuery Usage Analysis Report
**Project:** <project-id>
**Analysis Period:** Last <timeframe>
**Generated:** <timestamp>
## Executive Summary
- Total Queries Executed: <count>
- Total Data Scanned: <TB>
- Estimated Cost: $<amount>
### Key Findings
1. <Top issue with data/cost>
2. <Second major issue>
3. <Third issue>
## Usage by User/Service Account
<Table with top 10-20 users>
## Top Query Patterns
<Detailed breakdown of top patterns with recommendations>
## Per-User Analysis
### Top User 1: <user_email> (<TB> scanned, $<cost>)
<Summary of what this user does>
**Primary Query Types:**
1. <Pattern description> (<data scanned>)
- Execution count
- Average per query
- Specific optimization recommendation
### Top User 2: <user_email> (<TB> scanned, $<cost>)
<Summary of what this user does>
**Primary Query Types:**
1. <Pattern description> (<data scanned>)
- Execution count
- Average per query
- Specific optimization recommendation
## Top Individual Queries
<Table of most expensive queries>
## Optimization Recommendations
### Priority 1: High Impact, Easy Wins
1. **<Recommendation title>**
- Issue: <description>
- Fix: <specific steps>
- Estimated Savings: <$/day or %>
- Difficulty: Easy/Medium/Hard
### Priority 2: Medium Impact
...
### Priority 3: Architectural Improvements
...
## Cost Breakdown Summary
- Service Accounts: $<amount> (<percentage>)
- Human Users: $<amount> (<percentage>)After presenting the analysis, ask the user if they want to save it to a markdown file:
bigquery-usage-<project-id>-<YYYYMMDD>.mdHandle common issues by displaying a clear error message and suggesting a fix:
"bq command not found"
brew install google-cloud-sdk"Access Denied" errors
gcloud auth loginbq ls --project_id=<project-id>"Invalid project ID"
gcloud projects listNo data returned
region-us, US, EU, etc.)Query execution errors
region-us INFORMATION_SCHEMAUS or EU--format=json for easy parsing--use_legacy_sql=false for standard SQLGood User Analysis Example:
### openshift-ci-data-writer (4.07 TB, $25.41)
This service account runs test run analysis and backend disruption monitoring.
**Primary Query Types:**
1. **TestRuns_Summary_Last200Runs** (3.02 TB - 74% of usage)
- 96 executions using SELECT *
- 31.41 GB per query
- **Recommendation:** Replace SELECT * with specific columns.
Estimated savings: $9-15/day
2. **BackendDisruption Lookups** (0.68 TB - 17% of usage)
- 4,165 queries checking for job run names
- **Recommendation:** Add clustering on JobName + JobRunStartTime.
Implement result caching.This level of detail helps users understand exactly what's driving their costs and how to fix it.
A successful analysis should:
Add:
© openshift-eng, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in plugins/bigquery-cost-analysis/skills/analyze-usage of openshift-eng/ai-helpers.
Open the folder on GitHubat commit a627176
Analyze Usage next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Analyze Usage this skillopenshift-eng/ai-helpers | 120 | — | ~2.7k | Automated safety check: Pass | Apache-2.0 | |
| BigQuery Slot and Cost Optimizergoogle/skills | 21k | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Altimate Data Warehouse DelegateAltimateAI/data-engineering-skills | 127 | — | ~1.4k | Automated safety check: Pass | MIT | |
| GCP Audit Logssickn33/agentic-awesome-skills | 47k | 2 repos | ~3.8k | Automated safety check: Pass | MIT | |
| Imaging Data CommonsK-Dense-AI/scientific-agent-skills | 48k | 1 repos | ~7.8k | Automated safety check: Pass | MIT | |
| Bigquery Bigframesgoogle/skills | 21k | 1 repos | ~1.3k | Automated safety check: Pass | Apache-2.0 |
google/skills
Analyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans.
AltimateAI/data-engineering-skills
Delegates dbt and warehouse tasks such as lineage, migrations and cost attribution to the altimate-code CLI agent and relays its answer back.
sickn33/agentic-awesome-skills
Configure GCP Cloud Audit Logs for compliance. An agent skill from sickn33/agentic-awesome-skills.
K-Dense-AI/scientific-agent-skills
Queries and downloads public cancer imaging data from NCI Imaging Data Commons.
google/skills
Generates Python code using BigQuery DataFrames (BigFrames).
google/skills
Provides data-retrieval best practices, tool selection guidance, and performant SQL query syntax for BigQuery telemetry across INFORMATIONSCHEMA, Cloud Monitoring, and the REST API.
openshift-eng/ai-helpers
Find and independently validate actionable reliability defects across OpenShift release jobs and presubmits, then export portable issue handoffs.
openshift-eng/ai-helpers
Fetch and address all PR review comments — categorize by priority, make code changes, post replies, and push.
openshift-eng/ai-helpers
Categorize Jira issues into Red Hat Sankey Activity Type categories using MCP Jira tools.
openshift-eng/ai-helpers
Decide whether a GitHub PR has unanswered authorized review comments or new required CI failures worth a follow-up agent.
openshift-eng/ai-helpers
Analyze OpenShift must-gather diagnostic data including cluster operators, pods, nodes, and network components.
openshift-eng/ai-helpers
Schema for the autodl JSON data file produced by payload-analysis for database ingestion — you must use this skill whenever generating the autodl JSON file
Works with
Categories
A skill your agent uses when analyzing BigQuery usage patterns, costs, and query performance for a GCP project. Analyze Usage is an agent skill from openshift-eng/ai-helpers.
Analyze Usage fits situations like: analyzing BigQuery usage patterns; query performance for a GCP project.
Run `npx skills add openshift-eng/ai-helpers --skill analyze-usage -a claude-code`. Or copy the skill folder (plugins/bigquery-cost-analysis/skills/analyze-usage in openshift-eng/ai-helpers) into .claude/skills/analyze-usage in your project. Claude Code loads it when a task matches its description.
Run `npx skills add openshift-eng/ai-helpers --skill analyze-usage -a codex`. Or copy the skill folder (plugins/bigquery-cost-analysis/skills/analyze-usage in openshift-eng/ai-helpers) into .agents/skills/analyze-usage in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openshift-eng/ai-helpers --skill analyze-usage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/analyze-usage, .gemini/skills/analyze-usage, .github/skills/analyze-usage and .opencode/skills/analyze-usage in your project.
Going by SKILL.md and its folder, Analyze Usage needs the command-line tools its instructions call (gcloud, brew and bq).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Analyze Usage is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Analyze Usage: BigQuery Slot and Cost Optimizer (google/skills, 21k stars), Altimate Data Warehouse Delegate (AltimateAI/data-engineering-skills, 127 stars), GCP Audit Logs (sickn33/agentic-awesome-skills, 47k stars) and Imaging Data Commons (K-Dense-AI/scientific-agent-skills, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
openshift-eng (a GitHub organization) maintains it in openshift-eng/ai-helpers, which has 120 GitHub stars. The repository holds 118 skills in this directory. The repository was last updated on October 6, 2026.
Source: openshift-eng/ai-helpers on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.