What it does. - Spec Reference - All required and optional YAML keys for unit tests - Examples - Unit test examples across formats (dict, csv, sql) - Incremental Models - Unit testing incremental models - Ephemeral Dependencies - Unit testing models depending on ephemeral models - Special Case Overrides - Introspective macros, project variables, environment variables - Versioned Models - Unit testing versioned SQL models - BigQuery Caveats - BigQuery-specific caveats - BigQuery Data Types - BigQuery data type handling - Postgres Data Types - Postgres data type handling - Redshift Caveats - Redshift-specific caveats - Redshift Data Types - Redshift data type handling - Snowflake Data Types - Snowflake data type handling - Spark Data Types - Spark data type handling
dbt unit tests validate SQL modeling logic on static inputs before materializing in production. If any unit test for a model fails, dbt will not materialize that model.
Highlights
- Spec Reference - All required and optional YAML keys for unit tests
- Examples - Unit test examples across formats (dict, csv, sql)
- Incremental Models - Unit testing incremental models
- Ephemeral Dependencies - Unit testing models depending on ephemeral models
- Special Case Overrides - Introspective macros, project variables, environment variables
When to use it. Creates unit test YAML definitions that mock upstream model inputs and validate expected outputs. Use when adding unit tests for a dbt model or practicing test-driven development (TDD) in dbt.
Install
npx skills add dbt-labs/dbt-agent-skills --skill adding-dbt-unit-test
Or copy the skill folder manually:
git clone https://github.com/dbt-labs/dbt-agent-skills.git
cp -r dbt-agent-skills/skills/dbt/skills/adding-dbt-unit-test/ ~/.claude/skills/adding-dbt-unit-test
Source: dbt-labs/dbt-agent-skills — 699 stars, Apache-2.0, last pushed 2026-09-01.