dbt-labs avatar

Adding Dbt Unit Test

This handles the YAML scaffolding for dbt unit tests, mocking upstream inputs and defining expected outputs for your models. It's designed for test-driven development workflows where you want to validate SQL logic before materializing anything in production. The skill comes directly from dbt Labs and includes comprehensive reference docs for different warehouse-specific quirks (BigQuery, Snowflake, Redshift, etc.) plus guidance on testing incremental models and ephemeral dependencies. One thing to note: you'll need upstream models to exist in your warehouse before running unit tests standalone, though the docs explain how to use the empty flag to create schema-only versions cheaply. Best suited for testing complex SQL logic like window functions, date math, or gnarly case statements where you want confidence before deploying.

skills.sh installs
1.1K
GitHub stars
759
last updated
Aug 21, 2026

Install

$ npx -y skills add dbt-labs/dbt-agent-skills --skill adding-dbt-unit-test --agent claude-code

Installs into .claude/skills of the current project.

Files

Add unit test for a dbt model

Additional Resources

Sponsors

Details

Repository
github.com/dbt-labs/dbt-agent-skills
Categories
Testing & QA, AI & Agent Building
First seen
Jun 3, 2026

More from dbt-labs/dbt-agent-skills

All 13
1adobe avatarappbuilder-e2e-testingadobe/skillsUse this skill whenever the user wants browser-based end-to-end tests for an Adobe App Builder application. Covers Playwright E2E testing for ExC Shell SPAs, AE800skills.sh installs
2aj-geddes avatare2e-testing-automationaj-geddes/useful-ai-promptsBuild end-to-end automated tests that simulate real user interactions across the full application stack. Use for E2E test, Selenium, Cypress, Playwright, browse695skills.sh installs
3existential-birds avatarvitest-testingexistential-birds/beagleVitest testing framework patterns and best practices. Use when writing unit tests, integration tests, configuring vitest.config, mocking with vi.mock/vi.fn, usi471skills.sh installs
4umbraco avatarumbraco-e2e-testingumbraco/umbraco-cms-backoffice-skillsE2E testing for Umbraco backoffice extensions using Playwright and @umbraco-cms/acceptance-test-helpers380skills.sh installs
5patricio0312rev avatarunit-test-generatorpatricio0312rev/skillsGenerates comprehensive unit tests with AAA pattern (Arrange-Act-Assert), edge cases, error scenarios, and coverage analysis. Creates test files matching source374skills.sh installs
6patricio0312rev avatarcypress-playwright-setuppatricio0312rev/skillsSets up end-to-end testing with Cypress or Playwright including page objects, fixtures, and CI integration. Use when users request "E2E testing", "Cypress setup309skills.sh installs