data-quality-checks
Skill4 starsChanged 6 days agoMITView on GitHub
Design and review data quality checks, validation rules and data tests for pipelines, ETL/ELT jobs and warehouse tables — completeness, uniqueness, validity and range checks, cross-source consistency, referential integrity, freshness and timeliness SLAs, distribution drift; row-count and sum reconciliation between source and destination, duplicate detection keys, null vs missing vs zero, timestamp ordering and timezone bugs, negative and impossible values, quarantine bad rows vs fail the pipeline, reporting what was checked and what was NOT.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- XData-si/xdata-agenthubtheir own version, first seen Nov 22, 2026
- khgouldy/skillstheir own version, first seen Oct 11, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- khgouldy/skills★ 1same name
- XData-si/xdata-agenthub★ 1same name
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 repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accounting-bookkeepingSkill
- agent-context-persistenceSkill
- asoSkill
- brainstorm-argumentationSkill
- brainstorm-debateSkill
- brainstorm-lensesSkill
- causal-inferenceSkill
- context-disciplineSkill
- creative-briefSkill
- customer-support-opsSkill
- design-fundamentalsSkill
- ecommerce-operationsSkill
- event-taxonomySkill
- exec-coding-standardsSkill
- exec-cppSkill
- exec-csharpSkill
- exec-deliverableSkill
- exec-github-actionsSkill
- exec-goSkill
- exec-jvmSkill
- exec-phpSkill
- exec-pythonSkill
- exec-rubySkill
- exec-rustSkill
- exec-self-testingSkill
- exec-swiftSkill
- exec-typescriptSkill
- executor-fallbackSkill
- exec-visualizationSkill
- fast-pathSkill
- final-reviewSkill
- financial-auditSkill
- hr-recruitingSkill
- influencer-strategySkill
- interview-ask-backSkill
- interview-elicitationSkill
- jev-assistSkill
- json-data-wranglingSkill
- legal-contract-basicsSkill
- localization-copySkill
- manufacturing-ops-planningSkill
- marketing-attributionSkill
- media-planningSkill
- okr-planningSkill
- pack-game-analyticsSkill
- parallel-executionSkill
- performance-marketingSkill
- personal-financeSkill
- plan-architectureSkill
- plan-backlogSkill
- plan-research-firstSkill
- preflightSkill
- profile-contentSkill
- profile-designSkill
- profile-pilotSkill
- profile-planSkill
- real-estate-analysisSkill
- review-conformanceSkill
- review-dualSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Every useful check is a predicate plus a threshold, evaluable automatically against a table:
- Very specific: line 43
Use the business key that defines the grain, not the surrogate key — surrogates are unique by construction and prove nothing.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data Quality Checks (assertions, reconciliation, honest reporting)
The seven check families, as assertions
Every useful check is a predicate plus a threshold, evaluable automatically against a table:
Completeness assert count(*) where required_col is null = 0
assert count(distinct load_date) over window = expected_days (partitions present)
Uniqueness assert count(*) = count(distinct <business_key>) (the declared grain)
Validity/range assert age between 0 and 120; status in (...); amount >= 0; format/length rules
Consistency assert abs(sum(a.rev) - sum(b.rev)) / sum(b.rev) <= tol (source vs source)
Referential assert count(child left join parent where parent.id is null) = 0 (no orphans)
Timeliness assert max(event_ts) >= now() - <SLA interval> (freshness)
Drift assert abs(mean_today - mean_baseline) <= k * stddev_baseline
assert null_rate_today <= null_rate_baseline * (1 + tol)Each assertion needs a grain, a severity (warn vs fail) and an owner. An unowned failing check gets muted, which is worse than having no check at all.
Reconciliation, source to destination
Row counts alone prove nothing — dedup, filtering and late arrivals legitimately change them. Reconcile counts and sums per partition, every term measured rather than assumed:
source_rows - filtered_rows - deduped_rows = destination_rows
sum(source.amount) over the window = sum(dest.amount) ± rounding tolerance
per-key spot check: sample N business keys, compare field by fieldReconcile a closed window, never the currently-loading partition, and state the tolerance with its cause (float rounding, FX conversion, timezone edge) instead of picking whatever makes it pass.
Grain and duplicate keys
Use the business key that defines the grain, not the surrogate key — surrogates are unique by
construction and prove nothing. Typical real keys: (event_id), (user_id, event_ts, event_type),
(order_id, line_no). Test near-duplicates too: same natural key with different surrogate ids (double
ingestion), same payload at different timestamps (retry storms). Document the resolution rule — keep
first, keep last by ingestion time, keep highest version — because distinct picks one silently.
Null vs missing vs zero
NULL value unknown / not captured → excluded from AVG; must never become 0
MISSING the row does not exist → a completeness problem, invisible to column checks
ZERO a measured value equal to zero → a real observation
EMPTY '' usually an upstream bug posing as a value → test separately from NULLAssert on both axes: column null rates and expected row presence per day and per entity. Never
coalesce(x, 0) on a metric before validation — that converts unknown into a measurement. Sentinels
(-1, 9999, '1970-01-01', 'N/A', 'unknown') are nulls in disguise: enumerate and test them.
Time, and impossible values
Assert causal ordering (created_at <= updated_at, start <= end, event_ts <= ingested_at) and flag
future-dated events beyond a small clock-skew allowance. Store and compare in UTC with the offset
preserved. Classic bugs: a naive local timestamp compared against UTC, shifting rows across day
boundaries and breaking daily counts; DST duplicate or missing hours; timezone applied at query time in
one report and at load time in another. Assert one day-boundary definition across all aggregates.
Domain-impossible values are usually joins or units, not typing: negative quantities, prices or
durations; percentages outside 0-100; conversions exceeding sessions; end before start; children older
than parents; counts above a known population. Asserting >= 0 on a never-negative column catches unit
errors, sign flips and fanned-out joins earlier than any dashboard will.
Quarantine vs fail — and reporting
FAIL the run the defect makes output untrustworthy or unfixable downstream: grain violated,
reconciliation outside tolerance, unexpected schema change, source empty.
QUARANTINE rows defects are row-local and the rest is usable: write rejects WITH the failed rule,
raw payload and timestamp; emit reject count and rate; alert above a threshold.Quarantine without a monitored reject rate and a replay path is silent data loss. Never drop bad rows inline unrecorded, and never let a partial load overwrite a good partition — stage, validate, publish atomically. Then report honestly: a report listing only passes manufactures false confidence. Per run, publish the rules executed with thresholds and outcomes, rows checked and quarantined, and explicitly the unchecked surface — columns with no assertions, tables with no freshness SLA, dimensions never reconciled, checks skipped because a dependency was missing. Distinguish "passed" from "not evaluated"; a skipped check rendered green is the most expensive failure mode here.
Failure modes
- Uniqueness asserted on the surrogate key, so real duplicates pass.
- Reconciling row counts only, so value corruption passes.
- Tolerances widened until the check stops alerting, with no record of why.
coalescebefore validation; sentinels treated as data.- Reconciling the currently-loading partition and chasing phantom mismatches.
- Drift baselines that include the incident, normalising the bad state.
- Muted alerts with no owner; no quarantine replay, so rejects are never recovered.
Reviewer checklist
- All seven families considered; gaps named deliberately, not silently omitted
- Every check is an executable assertion with grain, threshold, severity and owner
- Uniqueness asserted on the business key, not a surrogate id
- Reconciliation covers counts and sums per closed partition, tolerance justified
- Null / missing / zero / empty / sentinel handled distinctly; no pre-validation coalesce
- Timestamp ordering asserted; comparisons in UTC with one day-boundary definition
- Domain bounds asserted for impossible and negative values
- Quarantine records the failed rule and payload; reject rate monitored; replay path exists
- Fail-vs-quarantine stated per rule; publish is atomic after validation
- Report separates passed / failed / not evaluated and lists the unchecked surface
Provenance
Standard data-engineering and data-observability practice (assertion-based testing, source-to-target reconciliation, freshness SLAs, drift monitoring, quarantine patterns). The seven-family taxonomy and the fail-vs-quarantine rule as stated here are derived, unverified working conventions, not a citable standard, and the predicates above are illustrative pseudo-SQL. Every threshold, tolerance, SLA interval, drift multiplier and reject-rate limit must be replaced with the project's own measured values before being treated as a target.
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.

