首页龙虾技能列表 › BigQuery Optimizer — BigQuery 优化器

BigQuery Optimizer — BigQuery 优化器

v1.0.0

BigQuery 优化器工具。

0· 254·0 当前·0 累计
by @anmolnagpal (Anmol Nagpal)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/6
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill is internally consistent — an instruction-only BigQuery cost analyzer that asks you to provide exported query/storage/billing data (not credentials) — but any pasted exports may contain sensitive identifiers or PII that you should redact before sharing.
评估建议
This skill appears coherent and does not request credentials, but the outputs it asks you to paste can include sensitive information (user email addresses, full SQL text, project IDs, billing account IDs, or accidentally copied service-account keys). Before sharing: 1) Remove or anonymize user_email fields and any PII, 2) Strip or redact project IDs/billing account IDs if you don't want them disclosed, 3) Never paste service account keys, private keys, or any credentials, 4) If possible, limit e...
详细分析 ▾
用途与能力
The name/description match the runtime instructions: the skill asks users to export BigQuery JOBS, table storage, and billing data and then performs offline analysis. It does not claim to access GCP itself and does not request credentials, which is proportionate to a remote analysis skill.
指令范围
Instructions tell the user to run bq/gcloud commands and paste results. This is within scope, but the requested outputs include user_email, full query text, project/billing identifiers and other potentially sensitive data (PII, project IDs). The SKILL.md does state 'Never ask for credentials' and to confirm no credentials are included, but users should be warned to redact email addresses, service-account references, project IDs, or any embedded secrets before sharing.
安装机制
No install spec and no code files; instruction-only skills are lowest-risk for installation since nothing is downloaded or written to disk.
凭证需求
The skill requires no environment variables, primary credential, or config paths. The only sensitive surface is user-provided exported data (queries, billing), which is expected for this purpose but should be handled cautiously.
持久化与权限
always is false, the skill does not request persistent presence or modify other skills/system settings. It is user-invocable and can be called by the agent (normal behavior).
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/6

Initial release of gcp-bigquery-optimizer. - Provides step-by-step guidance to analyze and reduce BigQuery costs using exported query, storage, or billing data. - Identifies expensive queries, partitioning opportunities, storage optimization, and potential materialized view use, all based on user-provided outputs. - Designed to work read-only: never requests credentials or accesses the GCP account directly. - Outputs actionable recommendations, cost breakdowns, and plain-English query rewrites. - Includes minimum IAM permission guidance and clear data export instructions.

● 无害

安装命令 点击复制

官方npx clawhub@latest install bigquery-optimizer
镜像加速npx clawhub@latest install bigquery-optimizer --registry https://cn.clawhub-mirror.com

技能文档

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.

必填 Inputs

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

  • INFORMATION_SCHEMA.JOBS_BY_PROJECT 查询 results — expensive queries 在...中 最后的 30 days
   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'
   
  • BigQuery storage usage per dataset — 到 identify large datasets
   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'
   
  • GCP Billing 导出 filtered 到 BigQuery — monthly BigQuery costs
   gcloud billing accounts list
   

Minimum 必填 GCP IAM permissions 到 run CLI commands 上面 (读取-仅):

{
  "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

  • Analyze INFORMATION_SCHEMA.JOBS_BY_PROJECT 对于 expensive queries
  • Identify partition pruning opportunities (满 表 scans)
  • Classify storage: 活跃 vs long-term (auto-transitions 之后 90 days)
  • Compare 在...上-demand vs slot reservation economics
  • Identify materialized 视图 opportunities 对于 repeated expensive queries

输出 格式

  • Top 10 Expensive Queries: 用户/SA, bytes billed, cost, 查询 预览
  • Partition Pruning Opportunities: tables scanned 没有 partition 过滤, savings potential
  • Storage Optimization: 活跃 vs long-term split, lifecycle recommendations
  • Slot Reservation Analysis: 在...上-demand vs reservation break-甚至 point
  • Materialized 视图 Candidates: queries run 10x+/day scan 相同 data
  • 查询 Rewrites: plain-English explanation 的 如何 到 fix 每个 expensive pattern

Rules

  • BigQuery 在...上-demand pricing: $6.25/TB scanned — 甚至 one bad 查询 可以 cost thousands
  • Partition filters single highest-impact optimization — always check 第一个
  • Slots 使 sense 当...时 > $2,000/mo 在...上 在...上-demand queries
  • Note: SELECT 在...上 large tables 最多 common expensive anti-pattern
  • Always show bytes billed (不 bytes processed) — 's 什么 costs money
  • Never ask 对于 credentials, access keys, 或 secret keys — 仅 exported data 或 CLI/console 输出
  • 如果 用户 pastes raw data, confirm 否 credentials included 之前 处理中
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务