adding-dbt-unit-test

Generate YAML unit test definitions for dbt models with mocked inputs and outputs.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/randoneering/nix-flake-mirror --skill adding-dbt-unit-test-randoneering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-dbt-unit-test
Source: https://github.com/randoneering/nix-flake-mirror/tree/main/home/programs/opencode/skills/dbt/adding-dbt-unit-test
Command: npx skills add https://github.com/randoneering/nix-flake-mirror --skill adding-dbt-unit-test-randoneering

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

dbt projects often require structured unit tests to validate model logic before deployment. This Skill provides a standardized way to generate YAML-based unit tests that mock upstream inputs and verify expected outputs, aligning with dbt best practices.

Core Features & Use Cases

  • Generates YAML unit_test definitions for dbt models following the official spec.
  • Integrates with references (spec, examples, and case studies) to accelerate test creation and validation.
  • Supports testing for single versions, multiple versions, and models with ephemeral or versioned dependencies.

Quick Start

Inspect the provided references and run the skill to generate unit tests for your dbt models.

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 models?

Create dbt unit tests by defining mock upstream inputs, expected outputs, and optional configurations in YAML format. This validates model logic before deployment using the standard dbt unit test schema.

What are dbt unit tests and when do I need them?

dbt unit tests are structured YAML definitions that mock upstream inputs and verify expected outputs to validate model logic. You need them to test transformations safely before deploying changes to production data pipelines.

Can I create dbt unit tests for incremental and versioned models?

Yes, dbt unit tests support incremental and versioned models. The YAML generation handles multiple versions and dependencies, including ephemeral models, by applying the appropriate test schema configurations.

Does the dbt unit test YAML generator work without external dependencies?

Yes, the dbt unit test YAML generator operates without external dependencies. It uses internal references and spec guidelines to produce validated YAML definitions aligned with repository conventions.

What is the best way to structure YAML for dbt model testing?

Follow the official dbt unit test spec to structure YAML with defined inputs, expected outputs, and optional configurations. This ensures well-formed definitions free of sensitive data and aligned with repository conventions.