bq-watch

Detect BigQuery schema drift against a baseline and propose fixes for dependent Apps Script SQL queries.

1|Updated May 23, 2026
One-click install
npx skills add https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2 --skill bq-watch-palfish-t-i-u
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bq-watch
Source: https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2/tree/main/.claude/skills/bq-watch
Command: npx skills add https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2 --skill bq-watch-palfish-t-i-u

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? BigQuery payroll tables and views change columns without notice, and Apps Script payroll scripts (BangLuong, BangTinhThue, DoiSoatLuong) reference column names directly in SQL, so every unannounced schema change risks crashing payroll processing. This Skill runs a schema watcher, analyzes drift, and guides fixes before scripts break. ## Core Features & Use Cases - Schema Drift Detection: Runs bq-schema-watch.js to compare current BigQuery schemas against a saved baseline, reporting added, removed, or retyped columns. - Impact Analysis: Greps affected column names across the Apps Script files to locate every SQL reference that needs updating. - Guided Fixes & Validation: Proposes column replacements, edits the scripts, and validates updated SQL with bq CLI dry-run queries before saving a new baseline. - Use Case: After a teammate updates a payroll table in BigQuery, ask the assistant to check for schema changes; it reports which columns changed, which script lines are affected, applies fixes, and updates the baseline. ## Quick Start Ask the assistant to run bq-watch and check whether the BigQuery payroll tables have any schema changes since the last baseline.

Frequently Asked Questions about bq-watch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect BigQuery schema changes automatically?

Run a schema watcher script that snapshots table schemas into a baseline JSON file and diffs subsequent runs against it. This Skill executes bq-schema-watch.js via Node.js with the bq CLI, reporting columns that were added, removed, or retyped.

How to find which SQL scripts break after a BigQuery column change?

Grep the changed column name across all dependent script files to locate every reference. This Skill searches the Apps Script files (BangLuong.gs, BangTinhThue.gs, DoiSoatLuong.gs, PhieuLuongGate.gs) and lists the exact lines using the affected column.

Can I validate BigQuery SQL without running the query?

Yes, use bq query with the --dry_run flag and --use_legacy_sql=false to validate syntax and schema references without executing or incurring costs. This Skill uses dry-run validation after editing scripts to confirm the updated SQL is valid.

Why does the bq CLI fail on Windows with a Python error?

The bq CLI requires a real Python interpreter, and the Windows Store Python stub is blocked. Set the CLOUDSDK_PYTHON environment variable to the full path of an installed Python executable before running bq commands in PowerShell.

What are the limitations of schema baseline diffing?

Baseline diffing only detects changes since the last saved snapshot, so changes made and reverted between runs are invisible. It also cannot judge semantic impact, so a human must decide whether new columns should be added to dependent scripts.