data-quality
Skill6 starsChanged 4 months agoApache-2.0View on GitHub
Use when adding or reviewing data quality tests for dbt models in warehouse-backed analytics projects. Covers dbt generic tests, singular tests (assert_*.sql), accepted-values macros, dbt_utils patterns, cross-system consistency tests, and warehouse-oriented validation. Use when writing data tests, creating assert_*.sql files, testing business logic, or validating referential integrity.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- SSameer20/data-analyst-toolkittheir own version, first seen Nov 8, 2026
- SWEStash/swe-workflow-skillstheir own version, first seen Nov 8, 2026
- Happy-Technologies-LLC/happy-platform-skillstheir own version, first seen Nov 1, 2026
- newsc2/claude-skillstheir own version, first seen Oct 20, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- SkillMedev/data-engineering-pipelinetheir own version, first seen Oct 5, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- nahid-sparktales/agent-dispatcher★ 59same name
- Happy-Technologies-LLC/happy-platform-skills★ 41same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- brainbytes-dev/everything-claude-trading★ 16same name
- khuynh22/agent-dev-team★ 9same name
- SSameer20/data-analyst-toolkit★ 4same name
- gmanch94/claude-code-aidlc-template★ 2same name
- SWEStash/swe-workflow-skills★ 1same name
- Abdox-menara/guard-skills★ 0same name
- IngAs8/ClaudeSkill★ 0same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository116 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/graphify/references/CLAUDE.mdCLAUDE.md
- agent-config-security-auditSkill
- agent-harness-designSkill
- agent-readable-docsSkill
- agent-runtime-patternsSkill
- agent-session-forensicsSkill
- ai-regression-testingSkill
- ai-slop-cleanerSkill
- api-doc-reviewSkill
- architecture-decision-recordsSkill
- architecture-simplificationSkill
- ask-claudeSkill
- ask-codexSkill
- ask-geminiSkill
- autonomous-delivery-pipelineSkill
- baseline-comparison-reviewSkill
- bigquery-cost-auditSkill
- brainstormingSkill
- browser-automation-safetySkill
- bug-huntSkill
- build-fix-minimal-diffSkill
- canonical-advisor-routingSkill
- change-impact-checkSkill
- changelog-generatorSkill
- ci-failure-readoutSkill
- codebase-migration-batchesSkill
- context-compressionSkill
- context-docsSkill
- context-minimizationSkill
- context-retrieval-loopSkill
- dataset-split-reviewSkill
- dbt-incremental-strategy-auditSkill
- dbt-preflightSkill
- dbt-strategySkill
- dead-code-removalSkill
- defuddleSkill
- dependency-cleanupSkill
- deploy-pipeline-runbookSkill
- dispatching-parallel-agentsSkill
- doc-consistency-checkSkill
- environment-doctorSkill
- experiment-tracking-reviewSkill
- failure-triageSkill
- filesystem-mcp-guardrailsSkill
- finishing-a-development-branchSkill
- flaky-test-investigationSkill
- gh-address-commentsSkill
- github-ci-failure-triageSkill
- graphifySkill
- handoff-disciplineSkill
- hard-won-skill-extractorSkill
- hook-safety-reviewSkill
- incident-readoutSkill
- incremental-migrationSkill
- json-canvasSkill
- local-rag-mcpSkill
- log-driven-diagnosisSkill
- managed-codebase-contextSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 85
Every model's primary key (id) must have both tests:
- Very specific: line 107
Use macros from macros/accepted_values/ instead of hardcoding values:
- Very specific: line 249
Use macros from macros/accepted_values/ — never hardcode enum lists in YAML
- Distinctive: line 250
Write singular tests for non-obvious business rules that need explicit documentation
- Very specific: line 252
Use --store-failures in development to inspect what went wrong
- Distinctive: line 253
Test referential integrity between fact and dimension tables
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data Quality
Testing patterns for dbt projects on analytical warehouses such as BigQuery. This workflow uses dbt tests exclusively — no external data-quality framework required.
Test Types
1. Generic Tests (in YAML files)
Defined in .yml files alongside models. Use data_tests: (not tests:):
# models/core/shared/dim_teams.yml
models:
- name: dim_teams
columns:
- name: id
description: Surrogate key
data_tests:
- unique
- not_null
- name: natural_id
description: Natural key from source
data_tests:
- unique
- not_null
- name: plan_code
description: Subscription plan code
data_tests:
- accepted_values:
values: "{{ get_plan_code_values() }}" # Use macros, not hardcoded lists2. Singular Tests (assert_*.sql files)
Business logic tests live in tests/ as assert_*.sql files. They pass when they return zero rows:
-- tests/teams/assert_teams_created_before_deleted.sql
with teams as (
select * from {{ ref('dim_teams') }}
)
select
teams.natural_id,
teams.created_at,
teams.deleted_at
from teams
where teams.deleted_at < teams.created_at-- tests/academy/assert_students_with_completed_modules_are_enrolled.sql
with completed as (
select distinct student_id from {{ ref('fct_academy_course_modules_completed') }}
),
enrolled as (
select distinct student_id from {{ ref('fct_academy_course_enrollments') }}
),
orphaned as (
select completed.student_id
from completed
left join enrolled
on completed.student_id = enrolled.student_id
where enrolled.student_id is null
)
select * from orphanedOrganize singular tests in subdirectories matching the domain: tests/accounts/, tests/billing/, tests/content/, etc.
Generic Test Patterns
Primary Key Tests
Every model's primary key (id) must have both tests:
- name: id
data_tests:
- unique
- not_nullReferential Integrity
- name: dim_user_id
data_tests:
- not_null
- relationships:
to: ref('dim_users')
field: idAccepted Values
Use macros from macros/accepted_values/ instead of hardcoding values:
- name: plan_code
data_tests:
- accepted_values:
values: "{{ get_plan_code_values() }}"Browse available macros: macros/accepted_values/get_*.sql
dbt_utils Tests
models:
- name: fct_team_members
data_tests:
# Table must not be empty
- dbt_utils.at_least_one:
column_name: id
# Data freshness — table updated in last 24h
- dbt_utils.recency:
datepart: hour
field: created_at
interval: 24
# Business rule on a measure
- dbt_utils.expression_is_true:
expression: "total_seats >= 0"
columns:
- name: team_id
data_tests:
# Cross-table: team must exist in dim_teams
- relationships:
to: ref('dim_teams')
field: natural_idDate Logic Tests
- name: end_at
data_tests:
# end_at must be after start_at when both are set
- dbt_utils.expression_is_true:
expression: "end_at is null or end_at > start_at"Custom Generic Tests
Define reusable tests in tests/generic/ or use the project's existing test_utils:
-- tests/generic/test_no_future_dates.sql
{% test no_future_dates(model, column_name) %}
select {{ column_name }}
from {{ model }}
where {{ column_name }} > current_timestamp
{% endtest %}Usage in YAML:
- name: created_at
data_tests:
- no_future_datesCross-System Consistency
Assert that data is consistent across source systems. These go in tests/ as singular tests:
-- tests/finance/assert_billing_plan_matches_team_plan.sql
-- Tests consistency between billing records and team plan data
with invoices as (
select * from {{ ref('fct_billing_invoices') }}
),
teams as (
select * from {{ ref('dim_teams') }}
),
mismatched as (
select
invoices.invoice_id,
invoices.plan_code as invoice_plan,
teams.plan_code as team_plan
from invoices
inner join teams
on invoices.team_id = teams.natural_id
where invoices.plan_code != teams.plan_code
and invoices.is_active
)
select * from mismatchedTest Organization
tests/
├── accounts/ Tests for account and team domain models
├── adhoc/ Ad-hoc spot-check tests
├── billing/ Finance and billing consistency tests
├── content/ Content or product-domain tests
└── generic/ Reusable generic test definitionsRunning Tests
dbt test # All tests
dbt test -s <model> # Tests for one model
dbt test -s tag:critical # Tests with a specific tag
dbt build -s <model> # Run + test together
dbt test --store-failures # Persist failures to BQ for inspectionTo inspect test failures in BigQuery (development):
select * from `dbt_<username>`.`dbt_test__audit`.<test_name>Test Coverage Checklist
For every new model:
- Primary key
id:unique+not_null - Primary key
natural_id:unique+not_null - All FK columns:
relationshipstest - All enum columns:
accepted_valuesusing a macro - Business rules:
dbt_utils.expression_is_trueor singular tests - Missing record sentinel: verify
idtest catches duplicates - Data freshness:
dbt_utils.recencyfor frequently updated tables
Best Practices
- Focus tests on columns that matter to business decisions
- Use macros from
macros/accepted_values/— never hardcode enum lists in YAML - Write singular tests for non-obvious business rules that need explicit documentation
- Organize singular tests in domain subdirectories matching the model domain
- Use
--store-failuresin development to inspect what went wrong - Test referential integrity between fact and dimension tables
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

