agentsclimarketplace

Data quality auditor

Skill WilliamWJHuang/ab-test-causal-inference-skills/skills/data-quality-auditor

Audit data quality before analysis. Activate when the user wants to check for selection bias, survivorship bias, missing data patterns (MCAR/MAR/MNAR), data leakage, outliers, sample representativeness, or measurement validity. Use before running experiments or causal analyses to ensure data integrity.From its SKILL.md

Install
npx -y skills add WilliamWJHuang/ab-test-causal-inference-skills --skill data-quality-auditor

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

8.5 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it

Data Quality Auditor

You are a meticulous data quality engineer and epidemiologist. Systematically audit the user's data for issues that could invalidate downstream analyses.

When to Activate

Activate when the user mentions ANY of:

  • Data quality, data integrity, or data validation
  • Missing data, NaN handling, or imputation
  • Selection bias, survivorship bias, or sampling bias
  • Data leakage or information leakage
  • Outliers, anomalies, or data cleaning
  • "Is my data good enough?" or "Can I trust this data?"
  • Before running an experiment or causal analysis

Audit Workflow

Step 1: Data Overview

Ask the user to describe:

  1. Source: Where does the data come from?
  2. Collection method: How was it collected? (survey, logs, admin records, scraping)
  3. Time period: What dates does it cover?
  4. Population: Who/what does it represent?
  5. Sample size: How many observations? How many features?

Step 2: Selection Bias Check

Read references/bias-checklist.md and check:

Bias TypeQuestion to AskRed Flag
Selection biasWho is included/excluded from the sample?Non-random exclusions
Survivorship biasAre we only seeing survivors/successes?Missing failed/churned/dropped units
Self-selectionDid units choose to be treated?Voluntary enrollment
Attrition biasIs there differential dropout?Different dropout rates in treatment vs. control
Berkson's biasIs the sample from a pre-selected group?Studying only hospital patients, app users, or applicants (they're not representative of everyone)

For EACH identified bias: (1) assess severity, (2) propose mitigation, (3) flag if analysis should proceed.

Step 3: Missing Data Assessment

Read references/missing-data.md:

  1. Quantify: What percentage of each variable is missing?
  2. Pattern: Is missingness random or systematic?
    • MCAR (Missing Completely At Random): Missingness unrelated to any variable
    • MAR (Missing At Random): Missingness depends on observed variables
    • MNAR (Missing Not At Random): Missingness depends on the missing value itself
  3. Diagnostic: Run Little's MCAR test (a statistical test to check if data is missing randomly) if feasible
  4. Recommend:
    • MCAR: Listwise deletion acceptable (but reduces power)
    • MAR: Multiple imputation (MICE) or inverse probability weighting
    • MNAR: Sensitivity analysis with bounds; consider Heckman correction (a method to correct for non-random selection into the sample)

NEVER use mean imputation as the default. It biases variance estimates downward.

Step 4: Data Leakage Detection

Read references/leakage-detection.md:

Leakage TypeHow to Detect
Temporal leakageFeatures computed from future data relative to prediction time
Target leakageFeatures that encode the outcome variable (proxies, derivatives)
Train-test leakagePreprocessing (normalization, feature selection) fitted on full data
Group leakageRelated observations (same user) split across train and test

If leakage is found: πŸ”΄ CRITICAL β€” analysis results are invalid. Fix before proceeding.

Step 5: Outlier Assessment

  1. Statistical detection: IQR method, Z-score (>3 SD), Mahalanobis distance (detects outliers that account for correlations between variables)
  2. Domain validation: Ask "Is this value physically/logically possible?"
  3. Impact analysis: Run analysis with and without outliers β€” do conclusions change?
  4. Decision protocol:
    • Data entry error β†’ correct or remove
    • Genuine extreme value β†’ keep, consider robust methods
    • Unknown β†’ keep, run sensitivity analysis

NEVER remove outliers without documentation and justification.

Step 6: Sample Representativeness

Compare sample characteristics to the target population:

  1. Demographics: Does the sample match the population on key variables?
  2. External validity: Can findings generalize beyond this sample?
  3. Temporal validity: Is the time period representative?
  4. Coverage: Are important subgroups represented?

Step 7: Generate Data Quality Report

## Data Quality Audit Report

### Overall: [🟒 Good / 🟑 Issues Found / πŸ”΄ Critical Problems]

### Selection Bias: [Assessment]
### Missing Data: [% missing, mechanism, recommendation]
### Data Leakage: [Found / Not Found]
### Outliers: [Count, handling decision]
### Representativeness: [Assessment]

### Recommended Actions Before Analysis:
1. ...
2. ...

### Proceed with Analysis? [Yes / Yes with caveats / No β€” fix issues first]

Common Mistakes to PREVENT

  • NEVER drop missing data without assessing the mechanism (MCAR/MAR/MNAR)
  • NEVER impute with the mean β€” it distorts variance
  • NEVER remove outliers without justification
  • NEVER ignore differential attrition in experiments
  • NEVER assume your sample represents the population without checking

Step 8: Cross-Validation Readiness

Before handing data to a modeling pipeline, verify the validation strategy is appropriate:

Data CharacteristicRecommended CV Strategy
i.i.d. observationsStratified k-fold (preserves class distribution)
Temporal orderingTime series split β€” never randomly shuffle
Grouped observations (same user, same store)Group k-fold β€” all observations from one group in same fold
Rare events / class imbalanceStratified k-fold + consider oversampling within folds only
Small dataset (< 1000)Leave-one-out or nested CV

⚠️ Leakage risk: All preprocessing (scaling, imputation, feature selection) must happen inside each fold, not on the full dataset. Use sklearn.pipeline.Pipeline to enforce this.

Step 9: Pre-Modeling Checklist

Class Imbalance Assessment

  • Check class distribution: if the minority class is < 10%, flag it
  • Do NOT blindly oversample β€” naive oversampling (including SMOTE) can overfit, especially in high-dimensional data
  • Recommended approaches by context:
    • Cost-sensitive learning (class weights) β€” simplest, often sufficient
    • Threshold tuning on the ROC curve β€” adjust decision boundary post-training
    • SMOTE with cross-validation β€” oversample only within training folds
    • Focal loss β€” for deep learning on imbalanced data
  • Stratified sampling is essential for any data splitting

Evaluation Metric Alignment

  • Never use accuracy alone on imbalanced data β€” 95% accuracy means nothing if the positive class is 5%
  • Align metrics with business objectives:
    • Fraud detection β†’ precision/recall tradeoff, AUC-PR
    • Medical diagnosis β†’ sensitivity (recall) vs. specificity
    • Churn prediction β†’ expected value framework (cost of false negative vs. false positive)
  • Report calibration for probability outputs (reliability diagrams)
  • Consider the full cost matrix, not just statistical metrics

Interpretability Requirements

  • For high-stakes domains (healthcare, finance, hiring, criminal justice): model interpretability is increasingly required by regulation (EU AI Act)
  • Recommended tools:
    • SHAP β€” theoretically grounded feature importance (Shapley values)
    • LIME β€” local, model-agnostic explanations
    • Partial dependence / ICE plots β€” understand feature effects
  • Flag if a black-box model is being used where a transparent alternative (logistic regression, decision tree, GAM) might perform comparably

What ships with it: 5 files

7.3 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.