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…
от j4flmao★ 47 звёзд на GitHub
Установить data-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- 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
Что делает скилл 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. 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).
Как установить скилл data-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл data-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…