dbt-bigquery

Generates, modifies, and validates dbt models and pipelines targeting Google BigQuery.

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/Lathika-laa/Recipe_Box --skill dbt-bigquery-lathika-laa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dbt-bigquery
Source: https://github.com/Lathika-laa/Recipe_Box/tree/main/.github/.gemini/skills/dbt-bigquery
Command: npx skills add https://github.com/Lathika-laa/Recipe_Box --skill dbt-bigquery-lathika-laa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dbt-bigquery.

What problem does it solve? Building and maintaining dbt pipelines for BigQuery requires deep knowledge of dbt project structure, profiles configuration, SQL optimization patterns, and BigQuery-specific quirks like BigLake 4-part naming. This Skill guides an AI agent through the full lifecycle of creating, modifying, troubleshooting, and validating dbt models so pipelines compile correctly and follow best practices. ## Core Features & Use Cases - dbt Project Scaffolding & Configuration: Initializes new dbt projects in a dedicated folder with correct dbt_project.yml and profiles.yml settings mapped to BigQuery project, dataset, and location. - SQL Optimization & Data Cleaning: Automatically rewrites anti-patterns like IN (SELECT ...) to EXISTS, proposes UNION ALL and APPROX_COUNT_DISTINCT with confirmation, and applies a mandatory data-cleaning protocol. - Safe Validation Workflow: Compiles with dbt compile and runs dbt test without ever executing dbt run unless the user explicitly confirms, preventing unintended warehouse changes. - Troubleshooting & BigLake Support: Diagnoses local and remote (Cloud Composer) DAG failures via gcloud logging read, and handles BigLake Iceberg tables through catalog-dataset concatenation in source definitions. - Use Case: Ask the agent to create a new dbt model aggregating daily sales from a raw BigQuery table; it will inspect schemas with bq CLI, generate the model with a config block and descriptions, add unit tests, and compile the project to verify correctness. ## Quick Start Ask the agent to create a new dbt model in BigQuery that aggregates your source table, and it will set up the project, write the SQL, and validate it with dbt compile.

Frequently Asked Questions about dbt-bigquery

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

FAQPage Schema
How do I create a new dbt model for BigQuery?▼

Define a SQL file under the models/ directory with a config block specifying the materialization, reference upstream tables using ref() or source(), and add table and column descriptions. Then run dbt compile to validate syntax and dependencies before executing.

How do I optimize SQL queries inside a dbt project?▼

Replace WHERE col IN (SELECT ...) and count-based existence checks with WHERE EXISTS subqueries, which are mandatory rewrites. Optionally, with user confirmation, replace UNION with UNION ALL and COUNT(DISTINCT) with APPROX_COUNT_DISTINCT for faster approximate results.

Does dbt-bigquery support BigLake Iceberg tables with 4-part naming?▼

The dbt-bigquery adapter only supports 3-part naming natively. To query BigLake Iceberg tables, concatenate the catalog and dataset into the schema field of the source definition, though this conflicts with standard environment-based schema prefixing.

Why does my dbt pipeline fail with 'Could not find profile named X'?▼

This error means profiles.yml is missing or mismatched with the profile name in dbt_project.yml. Ensure profiles.yml exists in the dbt project directory (or set DBT_PROFILES_DIR) and maps the correct BigQuery project, dataset, and location.

Can the agent run dbt models automatically after writing them?▼

No. The workflow only runs dbt compile and dbt test to validate correctness without side effects. Executing dbt run requires explicit user confirmation to prevent unintended changes to warehouse data.