Gcp live bigquery dataset deletion guard

From VincentChuWaiChow/vanguard-frontier-agentic · View interactive version

Gcp live bigquery dataset deletion guard is an AI agent skill from the GitHub repository VincentChuWaiChow/vanguard-frontier-agentic. Gate BigQuery dataset deletion, table truncation, and authorized view changes against a full downstream dependency audit and export confirmation. Dataset deletion is immediate and permanent with no recycle bin — this guard ensures no dataset is deleted without enumerating all tables, scheduled queri

How to use this skill

Skill file

GCP Live BigQuery Dataset Deletion Guard

Purpose

Act as the guarded live GCP operator for gcp-live-bigquery-dataset-deletion-guard work. Gate every BigQuery dataset deletion, table truncation, and authorized view change with a complete downstream dependency audit and export confirmation. Dataset deletion in BigQuery is immediate and permanent — there is no recycle bin, and all downstream pipelines break the moment the dataset is gone.

When to Use

Use this skill when:

When NOT to Use

Do not use this skill when:

Pre-Flight Checklist

Before executing any BigQuery deletion or truncation, verify all of the following:

  1. Dataset identity confirmed — run bq show --format=prettyjson <PROJECT>:<DATASET> and confirm the dataset name, project, and location match the intended target.
  2. Dataset inventory captured — run bq ls <PROJECT>:<DATASET> to enumerate all tables, views, and external tables. Document the table count and total bytes stored.
  3. Scheduled queries audited — run bq ls --transfer_config --transfer_location=<LOCATION> --project_id=<PROJECT> to list all scheduled queries and Data Transfer jobs that reference this dataset.
  4. Authorized views audited — check all authorized views that grant access to this dataset; identify any cross-project views that will break.
  5. Downstream pipeline dependencies confirmed — check Dataflow jobs, Looker/Looker Studio connections, and any application code that references the dataset for active dependencies.
  6. Export/backup confirmed — for production datasets, confirm that a full export to Cloud Storage (Avro, Parquet, or JSON) has been completed and verified before deletion is authorized.
  7. Data retention policy reviewed — confirm there are no legal hold, compliance retention, or regulatory requirements that prevent deletion.

Required Confirmation

The operator must explicitly state all of the following before any deletion is executed:

Execution Steps

  1. Capture full dataset inventory and downstream dependency audit.
  2. Confirm active principal has roles/bigquery.dataOwner for the target dataset.
  3. Present the dataset inventory, dependency findings, and export status to the operator for explicit approval.
  4. Execute the mutation:
  1. Confirm the deletion is reflected with bq ls <PROJECT>: (dataset should not appear).

Rollback Procedure

Post-Change Verification

  1. Run bq ls <PROJECT>: — confirm the deleted dataset no longer appears.
  2. Check Cloud Audit Logs for the deletion event: gcloud logging read 'protoPayload.methodName="google.cloud.bigquery.v2.DatasetService.DeleteDataset"' --limit=5 --project=<PROJECT>.
  3. Monitor scheduled query runs in the 24 hours following deletion — confirm no pipeline failures are attributed to the deleted dataset.
  4. Check Dataflow job logs and Looker connection health for any errors referencing the deleted dataset.

Response Shape

  1. Project and dataset identity confirmation
  2. Dataset inventory (tables, views, routines, bytes stored)
  3. Downstream dependency audit (scheduled queries, DTS jobs, authorized views)
  4. Export/backup confirmation before deletion
  5. Approval status
  6. Executed deletion or truncation action
  7. Post-change pipeline impact verification
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.