Command Palette

Search for a command to run...

Back to skills
skill № 08124

data-testing

Use when the user asks about dbt unit tests, data regression testing, data-diff / Datafold, Soda or GX tests in CI, or testing data pipelines before deploy…

FreeNo executable scripts
j4flmaoby j4flmao★ 47 GitHub stars

Install data-testing in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Data Testing

Purpose

Implement automated data testing across the data platform: unit tests for dbt models, regression detection between environments, data quality validation with Soda/Great Expectations, and CI/CD gates for data pipeline changes.

Agent Protocol

Trigger

Exact user phrases: "data testing", "dbt testing", "dbt unit test", "data-diff", "datafold", "Soda", "Great Expectations", "data regression", "data quality test", "data contract test", "data testing framework", "data validation test", "test data pipeline".

Input Context

Before activating, verify:

  • Data transformation tool (dbt, SQLMesh, custom)
  • Testing infrastructure (Soda Cloud, Great Expectations, datafold, data-diff)
  • CI/CD platform (GitHub Actions, GitLab CI, Jenkins)
  • Environments (dev, staging, prod) and data sources
  • Data contracts or SLAs in place
  • Existing test coverage and failure patterns

Output Artifact

Test suite configuration with dbt unit tests, Soda checks, Great Expectations suites, data regression test configs, and CI pipeline integration.

Response Format

# dbt test config
# Soda checks
# Unit test fixtures and assertions
# Regression diff queries
# Great Expectations suite
# CI pipeline

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

Completion Criteria

  • dbt unit tests written for all critical transformation models
  • Regression tests configured between staging and production
  • Soda or Great Expectations checks for row count, freshness, null rates, uniqueness
  • Data contract tests enforcing schema and shape on every deploy
  • CI pipeline runs tests and blocks on failures
  • Alerting on test failure with Slack/PagerDuty integration
  • Test coverage measured and reported

Max Response Length

300 lines of code and configuration.

dbt Unit Testing

Unit Test Setup

# packages.yml
packages:
  - package: equalexperts/dbt_unit_testing
    version: 1.0.0

Unit Test Definition

-- tests/unit/test_stg_orders.sql
{{ dbt_unit_testing.test('stg_orders') }}

{{ dbt_unit_testing.mock_ref('raw_orders', [
    {'order_id': 1, 'customer_id': 100, 'amount': 50.00, 'status': 'completed'},
    {'order_id': 2, 'customer_id': 101, 'amount': 100.00, 'status': 'pending'},
    {'order_id': 3, 'customer_id': 100, 'amount': -10.00, 'status': 'refunded'},
]) }}

{{ dbt_unit_testing.expect_model_columns([
    'order_id', 'customer_id', 'amount', 'status',
    'is_refund', 'amount_abs', 'row_num'
]) }}

{{ dbt_unit_testing.expect_row_count(3) }}

{{ dbt_unit_testing.expect_specific_row(
    'order_id', 1,
    {'customer_id': 100, 'amount': 50.00, 'is_refund': false}
) }}

dbt Test Configuration

# dbt_project.yml
tests:
  +severity: warn  # default severity, override per test

# tests/schema.yml
version: 2
models:
  - name: stg_orders
    columns:
      - name: order_id
        tests:
          - unique
          - not_null
      - name: customer_id
        tests:
          - not_null
          - relationships:
              to: ref('stg_customers')
              field: customer_id
      - name: amount
        tests:
          - not_null
          - dbt_utils.accepted_range:
              min_value: 0
              max_value: 100000

Data Regression Testing

data-diff CLI

# Diff tables across environments
data-diff \
  --warehouse-type postgresql \
  --warehouse-type postgresql \
  --warehouse-conn "postgresql://user:pass@prod:5432/warehouse" \
  --warehouse-conn "postgresql://user:pass@staging:5432/warehouse" \
  "SELECT order_id, customer_id, amount, status FROM orders WHERE order_date >= '2026-05-01'" \
  "SELECT order_id, customer_id, amount, status FROM orders WHERE order_date >= '2026-05-01'" \
  -k order_id

# Generate diff report
data-diff \
  --warehouse-type snowflake \
  --warehouse-type snowflake \
  --warehouse-conn "snowflake://user:pass@account/prod" \
  --warehouse-conn "snowflake://user:pass@account/staging" \
  "prod.analytics.fct_orders" \
  "staging.analytics.fct_orders" \
  -k order_id \
  --output diff_report.json

datafold Integration

# .datafold/config.yml
environments:
  - name: production
    data_source: prod_warehouse
  - name: staging
    data_source: staging_warehouse

monitors:
  - name: orders_pipeline
    schedule: "0 6 * * *"
    description: "Daily regression check on orders models"
    models:
      - fct_orders
      - dim_customers
      - fct_payments

diff_config:
  primary_keys:
    fct_orders: order_id
    dim_customers: customer_id
  compare_columns: all
  threshold_percentage: 0.01  # 0.01% allowed diff before alert

Custom Regression Queries

-- Row count comparison
SELECT 'staging' as env, COUNT(*) as row_count FROM staging.fct_orders
UNION ALL
SELECT 'production', COUNT(*) FROM prod.fct_orders;

-- Distribution drift detection
SEL
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • references/contract-driven-testing.md
  • references/data-comparison-tools.md
  • references/data-quality-catalog.md
  • references/data-testing-performance.md
  • references/data-testing-pipeline.md
  • references/dbt-testing-framework.md
  • references/schema-testing.md
  • references/testing-strategy-framework.md

FAQ

What does the data-testing skill do?

Use when the user asks about dbt unit tests, data regression testing, data-diff / Datafold, Soda or GX tests in CI, or testing data pipelines before deploy. Produces a layered data test strategy with unit, contract and diff tests. Not for runtime quality monitors (use data-data-observability) or CI wiring (use data-pipeline-cicd).

How do I install the data-testing skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the data-testing skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare data-testing with