agentleFS
antonrischantonrisch/db-skills/skills/data-quality-audit/SKILL.md

data-quality-audit

Skill9 starsChanged 10 months agoMITView on GitHub

Audits database data quality (nulls, duplicates, orphans, invalid ranges) and produces a short findings report with remediation queries. Use when debugging data issues, validating migrations, or verifying analytics correctness.

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. strikersam/autonomous-ai-agency★ 9same name
    2. motao123/dev-workflow-kit★ 1same name
    3. sp1e/claude-skills★ 1same name
    4. vermapragya/analytics-skill★ 0same 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 repository3 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 11 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    after migrations/backfills to prove invariants still hold

    line 15
  2. Distinctive:

    when analytics numbers disagree between systems

    line 16
  3. Distinctive:

    run cheap checks first (nulls, duplicates on keys)

    line 28
  4. Distinctive:

    run relationship checks (orphans)

    line 29
  5. Distinctive:

    run domain checks (ranges, enums)

    line 30
  6. Distinctive:

    write a short findings report + safe remediation plan

    line 31
  7. Very specific:

    always start with count(*) + targeted where clauses

    line 82
  8. Very specific:

    add limit when inspecting example rows

    line 83
  9. Distinctive:

    prefer indexed predicates (id ranges, created_at) for sampling

    line 85
  10. Distinctive:

    write a deterministic dedupe query

    line 92
  11. Distinctive:

    add a unique constraint or unique index after cleanup

    line 93
  12. Distinctive:

    add fk constraint after data is corrected

    line 98
  13. Distinctive:

    add not null only after verification

    line 103

“Common” is measured: kept by at least 6 in 10 of the 3 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data Quality Audit

Quick Start

Goal: find correctness issues quickly and return a small, actionable report.

When to use this skill

  • bug reports that smell like data drift (missing rows, double counts, weird nulls)
  • after migrations/backfills to prove invariants still hold
  • when analytics numbers disagree between systems

Before you run checks

  • database engine
  • target tables + expected primary keys
  • expected invariants (unique, not null, fk relationships, allowed ranges)
  • performance constraints (large tables, peak hours)

Workflow (default)

  1. pick 1–3 core tables for the issue
  2. run cheap checks first (nulls, duplicates on keys)
  3. run relationship checks (orphans)
  4. run domain checks (ranges, enums)
  5. write a short findings report + safe remediation plan

Core checks (portable sql)

null checks

SELECT COUNT(*) AS null_count
FROM your_table
WHERE important_col IS NULL;

duplicates on a candidate key

SELECT key_col, COUNT(*) AS c
FROM your_table
GROUP BY key_col
HAVING COUNT(*) > 1
ORDER BY c DESC
LIMIT 50;

orphan rows (broken references)

SELECT COUNT(*) AS orphan_count
FROM child c
LEFT JOIN parent p ON p.id = c.parent_id
WHERE c.parent_id IS NOT NULL
  AND p.id IS NULL;

invalid ranges

SELECT COUNT(*) AS bad_count
FROM your_table
WHERE amount < 0;

time sanity (example)

SELECT COUNT(*) AS bad_count
FROM your_table
WHERE created_at > NOW();

Performance-safe tips

  • always start with count(*) + targeted where clauses
  • add limit when inspecting example rows
  • scope by time window if tables are huge (last 7/30 days)
  • prefer indexed predicates (id ranges, created_at) for sampling

Remediation patterns

fix duplicates

  • decide on a canonical row rule (latest by updated_at, highest priority status, etc.)
  • write a deterministic dedupe query
  • add a unique constraint or unique index after cleanup

fix orphans

  • pick policy: delete orphans, reattach to parent, or set fk to null
  • add fk constraint after data is corrected

fix nulls

  • backfill from source columns or defaults
  • add not null only after verification

Output format (copy/paste)

## data quality audit

### scope

- tables:
- time window:

### findings

- [severity] issue: evidence

### likely impact

- user impact:
- analytics impact:

### remediation

- step 1:
- step 2:

### verification

- query checks:

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.