adding-dbt-unit-test

Generate dbt unit test YAML definitions with given inputs and expected outputs.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/piyushmal13/kandhogaya --skill adding-dbt-unit-test-piyushmal13
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-dbt-unit-test
Source: https://github.com/piyushmal13/kandhogaya/tree/main/.kilocode/skills/dbt/skills/adding-dbt-unit-test
Command: npx skills add https://github.com/piyushmal13/kandhogaya --skill adding-dbt-unit-test-piyushmal13

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

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.

Core Features & Use Cases

  • Generates comprehensive unit_tests blocks for models, including given inputs and expected outputs, covering common scenarios such as ephemeral and versioned models.
  • Integrates with dbt project conventions, supporting versions, overrides, and platform-specific considerations via the references and examples.
  • Provides a quick-start workflow to bootstrap tests and accelerate test-driven development in dbt.

Quick Start

Describe the target dbt model and test scenarios to generate a complete unit_test YAML definition.

Frequently Asked Questions about adding-dbt-unit-test

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

FAQPage Schema
How do I generate dbt unit test YAML definitions for my data models?

dbt unit tests validate data transformations by mocking upstream model inputs and comparing them against expected outputs. You define these mocked inputs and expected results in a YAML configuration to verify model logic before production.

How do I mock upstream inputs when adding unit tests to a dbt model?

You mock upstream inputs by defining them within the given block of the unit_tests YAML. This structure simulates the data dependencies and validates the expected outputs against the mocked input rows.

Can I write dbt unit tests for ephemeral and versioned models?

Yes, you can write unit tests for ephemeral and versioned dbt models. The generated YAML supports specifying model versions and applying overrides to handle platform-specific considerations and dependencies.

What fields are required in a dbt unit test YAML file?

The required fields in a dbt unit test YAML file are model, given, and expect. The structure must adhere to dbt's unit test spec, with optional fields for versions and overrides to handle model dependencies.

How do I use test-driven development (TDD) with dbt unit tests?

To use test-driven development with dbt, generate the unit test YAML defining expected outputs first, then build or refactor your dbt model transformations to make the mocked inputs pass the expected results.

Does dbt unit testing support overrides for platform-specific logic?

Yes, dbt unit testing supports overrides. The generated YAML definitions can include overrides and versions to manage platform-specific considerations and ensure accurate data transformation validation across dependencies.