dbt-bigquery

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

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/Jatinkrmahato993203/crime --skill dbt-bigquery-jatinkrmahato993203
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dbt-bigquery
Source: https://github.com/Jatinkrmahato993203/crime/tree/main/skills/dbt-bigquery
Command: npx skills add https://github.com/Jatinkrmahato993203/crime --skill dbt-bigquery-jatinkrmahato993203

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dbt-bigquery.

What problem does it solve? Building and maintaining dbt pipelines for BigQuery requires deep knowledge of adapter quirks, SQL optimization patterns, and project configuration. This Skill guides an AI agent through the full lifecycle of creating, modifying, validating, and troubleshooting dbt models so pipelines compile correctly and follow BigQuery best practices. ## Core Features & Use Cases - dbt Project Scaffolding: Initializes new dbt projects with correct dbt_project.yml and profiles.yml configuration mapped to BigQuery project, dataset, and location settings. - SQL Optimization: Automatically rewrites inefficient patterns (e.g., IN (SELECT ...) to EXISTS) and proposes conditional optimizations like UNION ALL or APPROX_COUNT_DISTINCT with user confirmation. - Validation & Troubleshooting: Compiles models with dbt compile, runs dbt test, diagnoses remote orchestration failures via gcloud logging, and resolves missing-profile errors. - Use Case: A data engineer asks the agent to add a new staging model reading from a BigLake Iceberg source. The Skill inspects schemas with bq CLI commands, generates the model with proper source() references and config blocks, adds unit tests, and compiles the project to verify correctness. ## Quick Start Ask the agent to create a new dbt model in your project that transforms a specific BigQuery source table and compile the project to validate it.

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() syntax, and compile with dbt compile to validate. The Skill generates the model, ensures profiles.yml exists, and adds unit tests when appropriate.

How to 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. Conditional optimizations like UNION ALL or APPROX_COUNT_DISTINCT are proposed with explicit user confirmation due to tradeoffs in duplicates or accuracy.

Does dbt-bigquery support BigLake Iceberg tables?▼

The dbt-bigquery adapter does not natively support 4-part Project.Catalog.Dataset.Table naming. Work around this by concatenating the catalog and dataset into the schema field of the source definition, though this conflicts with standard environment schema prefixing.

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

This error occurs when profiles.yml is missing from the dbt project directory or remote orchestration bundle. Ensure profiles.yml sits alongside dbt_project.yml, matches the profile name declared there, and maps correct BigQuery project, dataset, and location settings.

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

No. The Skill only compiles and tests models to catch syntax and dependency errors without side effects. Executing dbt run requires explicit user confirmation, so generated code is validated but never executed against BigQuery automatically.