Agent skill

Testing Dbt Models

by AltimateAI in AltimateAI/data-engineering-skills

Adds schema tests and data quality validation to dbt models.

MITAuto-check passedData & Analytics

Install Testing Dbt Models

skills CLI
$ npx skills add AltimateAI/data-engineering-skills --skill testing-dbt-models -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AltimateAI/data-engineering-skills testing-dbt-models --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AltimateAI/data-engineering-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dbt/testing-dbt-models .claude/skills/testing-dbt-models && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing-dbt-models
GitHub stars
127
Token cost
~1.1k tokens
SKILL.md length
253 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Adds schema tests and data quality validation to dbt models.

  • Works in 7 steps: Study Existing Test Patterns → Read Model SQL → Check Existing Tests for This Model → …
  • Working with dbt tests for:
  • SKILL.md covers Workflow, Test Types Reference and Anti-Patterns
  • Calls dbt

What it does

Testing Dbt Models is an agent skill from AltimateAI/data-engineering-skills. Adds schema tests and data quality validation to dbt models. Use when working with dbt tests for: (1) Adding or modifying tests in schema.yml files (2) Task mentions "test", "validate", "data quality", "unique", "notnull", or "acceptedvalues" (3) Ensuring data integrity - primary keys, foreign keys, relationships (4) Debugging test failures or understanding why dbt test failed Matches existing project test patterns and YAML style before adding new tests.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Data & Analytics, covering Data pipelines and ETL. It works with dbt. The repository describes itself as: Skills related to Data Engineering Work for Claude Code. The licence is MIT.

When your agent uses it

  • Working with dbt tests for:
  • Modifying tests in schema.yml files
  • Task mentions test
  • Ensuring data integrity - primary keys

Example prompts

  • “validate”
  • “data quality”
  • “unique”
  • “/testing-dbt-models”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Study Existing Test Patterns
  2. Read Model SQL
  3. Check Existing Tests for This Model
  4. Identify Testable Columns
  5. Write Tests in schema.yml
  6. Run Tests
  7. Fix Failing Tests

What it can do on your machine

Read from SKILL.md and the folder at commit 705c68b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dbt

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing Dbt Models loads about 1.1k tokens when it runs. Until then it costs about 120 tokens; SKILL.md has 253 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~120
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AltimateAI/data-engineering-skills at commit 705c68b, republished under its MIT licence (© AltimateAI). 253 words, ~1,135 tokens.

Download SKILL.mdSave it as .claude/skills/testing-dbt-models/SKILL.md (or your agent's skills folder).
name
testing-dbt-models
description
Adds schema tests and data quality validation to dbt models. Use when working with dbt tests for: (1) Adding or modifying tests in schema.yml files (2) Task mentions "test", "validate", "data quality", "unique", "not_null", or "accepted_values" (3) Ensuring data integrity - primary keys, foreign keys, relationships (4) Debugging test failures or understanding why dbt test failed Matches existing project test patterns and YAML style before adding new tests.

dbt Testing

Every model deserves at least one test. Primary keys need unique + not_null.

Workflow

1. Study Existing Test Patterns

CRITICAL: Match the project's existing testing style before adding new tests.

bash
# Find all schema.yml files with tests
find . -name "schema.yml" -exec grep -l "tests:" {} \;

# Read existing tests to learn patterns
cat models/staging/schema.yml | head -100
cat models/marts/schema.yml | head -100

# Check for custom tests or dbt packages
ls tests/
cat packages.yml 2>/dev/null

Extract from existing tests:

  • YAML formatting style (indentation, spacing)
  • Test coverage depth (all columns vs key columns only)
  • Use of custom tests (dbt_utils, dbt_expectations, custom macros)
  • Description style (brief vs detailed)
  • Severity levels used (warn vs error)
2. Read Model SQL
bash
cat models/<path>/<model_name>.sql

Identify: primary keys, foreign keys, categorical columns, date columns, business-critical fields.

3. Check Existing Tests for This Model
bash
cat models/<path>/schema.yml | grep -A 50 "<model_name>"
# or
find . -name "schema.yml" -exec grep -l "<model_name>" {} \;
4. Identify Testable Columns
Column TypeRecommended Tests
Primary keyunique, not_null
Foreign keynot_null, relationships
Categoricalaccepted_values (ask user for valid values)
Required fieldnot_null
Date/timestampnot_null
Booleanaccepted_values: [true, false]
5. Write Tests in schema.yml

Match the existing style from step 1. Example format (adapt to project):

yaml
version: 2

models:
  - name: model_name
    description: "Brief description of what this model contains"
    columns:
      - name: primary_key_column
        description: "Unique identifier for this record"
        tests:
          - unique
          - not_null

      - name: foreign_key_column
        description: "Reference to related_model"
        tests:
          - not_null
          - relationships:
              to: ref('related_model')
              field: related_key_column

      - name: status
        description: "Current status of the record"
        tests:
          - not_null
          - accepted_values:
              values: ['pending', 'active', 'completed', 'cancelled']

      - name: created_at
        description: "Timestamp when record was created"
        tests:
          - not_null
6. Run Tests
bash
# Test specific model
dbt test --select <model_name>

# Test with upstream
dbt test --select +<model_name>
7. Fix Failing Tests

Common failures and fixes:

FailureLikely CauseFix
unique failsDuplicate recordsAdd deduplication in model
not_null failsNULL values in sourceAdd COALESCE or filter
relationships failsOrphan recordsAdd WHERE clause or fix upstream
accepted_values failsNew/unexpected valuesUpdate accepted values list

Test Types Reference

Generic Tests (built-in)
yaml
tests:
  - unique
  - not_null
  - accepted_values:
      values: ['a', 'b', 'c']
  - relationships:
      to: ref('other_model')
      field: id
Custom Generic Tests
yaml
tests:
  - dbt_utils.expression_is_true:
      expression: "amount >= 0"
  - dbt_utils.recency:
      datepart: day
      field: created_at
      interval: 1
Singular Tests

Create tests/<test_name>.sql:

sql
-- tests/assert_positive_revenue.sql
select *
from {{ ref('orders') }}
where revenue < 0

Anti-Patterns

  • Adding tests without checking existing project patterns first
  • Using different YAML formatting style than existing tests
  • Models without any tests
  • Primary keys without both unique AND not_null
  • Testing only obvious columns, ignoring business-critical ones
  • Hardcoding accepted_values without confirming with stakeholders
  • Adding dbt_utils tests when project doesn't use that package

© AltimateAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/dbt/testing-dbt-models of AltimateAI/data-engineering-skills.

Open the folder on GitHubat commit 705c68b

Compare with similar skills

Testing Dbt Models next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing Dbt Models compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing Dbt Models this skillAltimateAI/data-engineering-skills127—~1.1kAutomated safety check: PassMIT
Dbt Databricks PR Readydatabricks/dbt-databricks379—~2.8kAutomated safety check: PassApache-2.0
Mz Dbt ReleaseMaterializeInc/materialize6.4k—~1.2kAutomated safety check: PassCustom licence
Erd Studio Setupliam-machine/erd-studio165—~8.5kAutomated safety check: PassCustom licence
PR Verifydocglow/docglow147—~1.5kAutomated safety check: PassMIT
Migrating Dagster To Airflowastronomer/agents450—~3.8kAutomated safety check: PassApache-2.0

Similar skills

  • Dbt Databricks PR Ready

    databricks/dbt-databricks

    Official

    A skill your agent uses for an open dbt-databricks pull request, including your own PR or a fork PR, to assess merge readiness and optionally repair selected gaps on the PR head branch.

    379 GitHub stars~2.8k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Mz Dbt Release

    MaterializeInc/materialize

    Cut a dbt-materialize PyPI release: bump the version in version.py and setup.py, date the Unreleased CHANGELOG entry, and open the release PR with a Ship: <url body.

    6.4k GitHub stars~1.2k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Erd Studio Setup

    liam-machine/erd-studio

    Friendly, step-by-step setup for ERD Studio in an existing dbt project, for people who may be new to dbt or data modelling.

    165 GitHub stars~8.5k tokensUpdated 3 days ago
    Data & AnalyticsAuto-check passed
  • PR Verify

    docglow/docglow

    Verify a Docglow change actually works before submitting or merging a PR.

    147 GitHub stars~1.5k tokensUpdated 10 days ago
    Data & AnalyticsAuto-check passed
  • Guide for migrating Dagster projects to Apache Airflow 3 on Astro.

    450 GitHub stars~3.8k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • Dbt Parser Refresh

    yu-iskw/dbt-artifacts-parser

    Refreshes dbt artifact schemas from dbt-labs/dbt-core and regenerates Pydantic parser classes.

    118 GitHub stars~716 tokensUpdated 13 days ago
    Data & AnalyticsAuto-check passed

More from AltimateAI/data-engineering-skills

All 12 skills in this repo
  • Altimate Data Warehouse Delegate

    AltimateAI/data-engineering-skills

    Delegates dbt and warehouse tasks such as lineage, migrations and cost attribution to the altimate-code CLI agent and relays its answer back.

    127 GitHub stars~1.4k tokensUpdated 5 days ago
    Auto-check passed
  • dbt Model Builder

    AltimateAI/data-engineering-skills

    Creates or modifies dbt models in line with a project's own conventions, then runs dbt build and dbt show to check the output instead of stopping at compile.

    127 GitHub stars~890 tokensUpdated 5 days ago
    Auto-check passed
  • dbt Error Debugging

    AltimateAI/data-engineering-skills

    Walks through fixing dbt compilation, database and test errors: read the full error, check upstream models, apply a fix, then verify with dbt build and a data preview.

    127 GitHub stars~1.1k tokensUpdated 5 days ago
    Auto-check passed
  • dbt Incremental Models

    AltimateAI/data-engineering-skills

    Helps choose an incremental strategy, design a reliable unique_key and debug failing dbt incremental models, and says when a plain table is the better choice.

    127 GitHub stars~2.3k tokensUpdated 5 days ago
    Auto-check passed
  • dbt Model Documentation

    AltimateAI/data-engineering-skills

    Writes model and column descriptions in dbt schema.yml files, matching the project's existing documentation style and recording grain, business rules and caveats.

    127 GitHub stars~1.2k tokensUpdated 5 days ago
    Auto-check passed
  • Expensive Snowflake Query Finder

    AltimateAI/data-engineering-skills

    Ranks the costliest, slowest or heaviest-scanning Snowflake queries from query history and suggests how to optimize them.

    127 GitHub stars~662 tokensUpdated 5 days ago
    Auto-check passed

Works with

Questions about Testing Dbt Models

What does Testing Dbt Models do?

Adds schema tests and data quality validation to dbt models. Testing Dbt Models is an agent skill from AltimateAI/data-engineering-skills. Adds schema tests and data quality validation to dbt models.

When should I use Testing Dbt Models?

Testing Dbt Models fits situations like: working with dbt tests for:; modifying tests in schema.yml files; task mentions test; ensuring data integrity - primary keys.

How do I install Testing Dbt Models in Claude Code?

Run `npx skills add AltimateAI/data-engineering-skills --skill testing-dbt-models -a claude-code`. Or copy the skill folder (skills/dbt/testing-dbt-models in AltimateAI/data-engineering-skills) into .claude/skills/testing-dbt-models in your project. Claude Code loads it when a task matches its description.

How do I install Testing Dbt Models in Codex?

Run `npx skills add AltimateAI/data-engineering-skills --skill testing-dbt-models -a codex`. Or copy the skill folder (skills/dbt/testing-dbt-models in AltimateAI/data-engineering-skills) into .agents/skills/testing-dbt-models in your project. Codex loads it when a task matches its description.

Can I use Testing Dbt Models in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AltimateAI/data-engineering-skills --skill testing-dbt-models -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-dbt-models, .gemini/skills/testing-dbt-models, .github/skills/testing-dbt-models and .opencode/skills/testing-dbt-models in your project.

What does Testing Dbt Models need to run?

Going by SKILL.md and its folder, Testing Dbt Models needs the command-line tools its instructions call (dbt).

Does Testing Dbt Models access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing Dbt Models safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing Dbt Models use?

Testing Dbt Models is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing Dbt Models use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Testing Dbt Models?

Skills that share tags, products or a category with Testing Dbt Models: Dbt Databricks PR Ready (databricks/dbt-databricks, 379 stars), Mz Dbt Release (MaterializeInc/materialize, 6.4k stars), Erd Studio Setup (liam-machine/erd-studio, 165 stars) and PR Verify (docglow/docglow, 147 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing Dbt Models?

AltimateAI (a GitHub organization) maintains it in AltimateAI/data-engineering-skills, which has 127 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 1, 2026.

Source: AltimateAI/data-engineering-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.