testing-dbt-models

Add schema-level YAML tests to dbt models and validate with dbt test.

2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/miptah21/skills --skill testing-dbt-models
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-dbt-models
Source: https://github.com/miptah21/skills/tree/main/.agents/skills/testing-dbt-models
Command: npx skills add https://github.com/miptah21/skills --skill testing-dbt-models

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

dbt models can silently degrade as sources change, breaking downstream analytics and pipelines without early warning, so you need reliable schema tests that match your project’s existing conventions.

Core Features & Use Cases

  • What it does: Adds and updates schema.yml tests for data integrity, including key uniqueness, required fields, allowed values, and inter-model relationships.
  • Where to use it: Modifying schema.yml when you add or change dbt models, when test failures occur, and when you need to validate primary/foreign key logic and categorical fields.
  • How it prevents regressions: Encourages matching the repository’s current YAML formatting, test coverage depth, custom test usage, and severity conventions.

Quick Start

Ask the agent to review the model SQL and existing schema.yml patterns, then propose the exact YAML tests to add for primary keys, foreign keys, required fields, and accepted categorical values before running dbt test for the selected model.

Frequently Asked Questions about testing-dbt-models

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

FAQPage Schema
How do I add dbt schema tests for primary keys and foreign key relationships?

To add dbt schema tests, you update your schema.yml file with built-in test types like unique and relationships. This ensures primary key uniqueness and validates foreign key referential integrity to prevent broken analytics.

What dbt data quality tests should I use for categorical fields and required columns?

For categorical fields and required columns, use accepted_values and not_null schema tests in dbt. These tests enforce allowed categorical inputs and validate required fields, catching silent data degradation before it breaks downstream pipelines.

How do I match existing dbt test patterns and YAML style when updating schema.yml?

When updating schema.yml, you must match the repository's existing YAML formatting, test coverage depth, custom test usage, and severity conventions. This maintains consistency and prevents regressions across your dbt models.

Why does my dbt pipeline break when source data changes, and how can schema tests help?

dbt pipelines break when source data changes silently, but schema tests provide early warning. By applying data-integrity invariants in schema.yml, you catch issues like duplicate keys or invalid values before they impact analytics.

Can I validate dbt schema tests by running dbt test on a specific target model?

Yes, you validate dbt schema tests by running the dbt test command on your selected target model. This executes the configured uniqueness, relationships, and accepted_values checks to confirm data integrity.

What are the limitations of using schema.yml tests for dbt data quality?

schema.yml tests are limited to predefined checks like uniqueness, not_null, accepted_values, and relationships. Complex custom logic requires custom test macros, and severe test failures will halt pipelines if severity conventions are set to error.