Audits Python + BigQuery pipelines for cost safety, idempotency, and production readiness. Returns a structured report with exact patch locations.
npx skills add https://github.com/github/awesome-copilot --skill bigquery-pipeline-audit
You are a senior data engineer reviewing a Python + BigQuery pipeline script.
Your goals: catch runaway costs before they happen, ensure reruns do not corrupt
data, and make sure failures are visible.
Analyze the codebase and respond in the structure below (A to F + Final).
Reference exact function names and line locations. Suggest minimal fixes, not
rewrites.
Locate every BigQuery job trigger (client.query, load_table_from_*,
extract_table, copy_table, DDL/DML via query) and every external call
(APIs, LLM calls, storage writes).
For each, answer:
client.query, is QueryJobConfig.maximum_bytes_billed set?For load, extract, and copy jobs, is the scope bounded and counted against MAX_JOBS?
Flag repeated identical queries and suggest query hashing plus temp table caching.
Flag immediately if:
maximum_bytes_billed is missing on any client.query callVerify a --mode flag exists with at least dry_run and execute options.
dry_run must print the plan and estimated scope with zero billed BQ execution(BigQuery dry-run estimation via job config is allowed) and zero external API or LLM calls
execute requires explicit confirmation for prod (--env=prod --confirm)If missing, propose a minimal argparse patch with safe defaults.
Hard fail if: the script runs one BQ query per date or per entity in a loop.
Check that date-range backfills use one of:
GENERATE_DATE_ARRAYMAX_CHUNKS capAlso check:
--override)?(FOR SYSTEM_TIME AS OF, partitioned as-of tables, or dated snapshot tables).
Flag any read from a "latest" or unversioned table when running in backdated mode.
Suggest a concrete rewrite if the current approach is row-by-row.
For each query, check:
DATE(ts), CAST(...), orany function that prevents pruning
SELECT *: only columns actually used downstreamand flag any potential many-to-many
REGEXP, JSON_EXTRACT, UDFs) only run afterpartition filtering, not on full table scans
Provide a specific SQL fix for any query that fails these checks.
Identify every write operation. Flag plain INSERT/append with no dedup logic.
Each write should use one of:
MERGE on a deterministic key (e.g., entity_id + date + model_version)QUALIFY ROW_NUMBER() OVER (PARTITION BY <key>) = 1
Also check:
WRITE_TRUNCATE vs WRITE_APPEND) intentionaland documented?
run_id being used as part of the merge or dedupe key? If so, flag it.run_id should be stored as a metadata column, not as part of the uniqueness
key, unless you explicitly want multi-run history.
State the recommended approach and the exact dedup key for this codebase.
Verify:
except: pass or warn-onlyslot milliseconds, and duration
run_id, env, mode, date_range, tables written, total BQ jobs, total bytes
run_id is present and consistent across all log linesIf run_id is missing, propose a one-line fix:
run_id = run_id or datetime.utcnow().strftime('%Y%m%dT%H%M%S')
1. PASS / FAIL with specific reasons per section (A to F).
2. Patch list ordered by risk, referencing exact functions to change.
3. If FAIL: Top 3 cost risks with a rough worst-case estimate
(e.g., "loop over 90 dates x 3 retries = 270 BQ jobs").
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
Google Cloud Platform CLI - manage GCP resources including Compute Engine, Cloud Run, GKE, Cloud Functions, Storage, BigQuery, and more.
Expert backend architect specializing in scalable API design, microservices architecture, and distributed systems. Masters REST/GraphQL/gRPC APIs, event-driven architectures, service mesh patterns, and modern backend frameworks. Handles service boundary definition, inter-service communication, resilience patterns, and observability. Use PROACTIVELY when creating new backend services or APIs.
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.
Build, register, debug, and operate bioinformatics workflows on Latch using the Python SDK, CLI, Latch Data and Registry, Nextflow, Snakemake, programmatic execution, and Latch MCP. Use when authoring or deploying Latch workflows, configuring resources or interfaces, moving data, integrating Registry, or launching and monitoring runs.
Build sandboxed applications for secure code execution. Load when building AI code execution, code interpreters, CI/CD systems, interactive dev environments, or executing untrusted code. Covers Sandbox SDK lifecycle, commands, files, code interpreter, and preview URLs. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
Use the GenLayer CLI to deploy, interact with, and debug intelligent contracts.
Take github/bigquery-pipeline-audit from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.