leakage-audit
Skill54 starsChanged 7 days agoMITView on GitHub
Audit sports modeling tables and workflows for target, temporal, join, preprocessing, and split leakage. Use before trusting backtests or reported predictive performance.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- yuiseki/GeoAI-master-skillstheir own version, first seen Oct 17, 2026
- thanatchon36/skillstheir own version, first seen Oct 15, 2026
- gmanch94/claude-code-aidlc-templatetheir own version, first seen Jul 11, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- yuiseki/GeoAI-master-skills★ 3same name
- gmanch94/claude-code-aidlc-template★ 2same name
- thanatchon36/skills★ 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 repository19 other files it gives its agents.
- anti-slop-analyticsSkill
- baseline-modelsSkill
- calibration-checkSkill
- data-sourcesSkill
- eda-sportsSkill
- environment-setupSkill
- experiment-logSkill
- feature-rulesSkill
- model-cardSkill
- model-interpretationSkill
- predictive-modelingSkill
- ratings-strength-modelsSkill
- results-reportingSkill
- simulation-sportsSkill
- sports-modeling-doctrineSkill
- sports-visualizationSkill
- statistical-modelingSkill
- time-series-sportsSkill
- validation-designSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
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 27
Do not use this skill as a substitute for:
- Distinctive: line 41
Before inspecting correlations or metrics, write the target, row grain, exact prediction decision time T, eligible population, source …
- Distinctive: line 45
Use the audit checklist during every audit.
- Distinctive: line 58
Verify preprocessing, selection, encoding, and tuning fit only on training rows.
- Distinctive: line 59
Verify validation moves forward in time and related rows remain together.
- Distinctive: line 60
Run automated matrix heuristics, then manually investigate every finding.
- Distinctive: line 100
Check sort tie-breaks, reset boundaries, offseason carryover, minimum periods, and whether the first entity event has an unexplained …
- Distinctive: line 189
Prefer a false review to a false clean.
- Distinctive: line 191
Do not repair leakage by dropping a bad test period or redefining success.
- Very specific: line 193
Use references/audit_checklist.md for completion, references/leakage_patterns.md for taxonomy, and references/case_studies.md for diagnosis.
≈ “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
Leakage Audit
Outcome and stance
Assume leakage until the pipeline proves time-safe. Produce an adversarial,
evidence-backed verdict: CLEAN, REVIEW REQUIRED, or NOT CLEAN, with
contaminated fields, affected claims, required repairs, and retest conditions.
A strong metric is never evidence of cleanliness.
When to Use This Skill
Use when:
- trusting a backtest or “good” metric for the first time;
- reviewing a feature table before modeling or after a suspiciously strong result;
- auditing target aliases, joins, shifts, preprocessing, or split design;
- the user says the model looks too good / results are unexpected.
Do not use this skill as a substitute for:
- designing legal features from scratch →
feature-rules; - designing folds and metrics →
validation-design; - first-pass panel EDA →
eda-sports.
| Need | Go instead |
| Feature construction rules | feature-rules |
| Fold / metric charter | validation-design |
| Probability reliability after clean design | calibration-check |
Lock the audit contract
Before inspecting correlations or metrics, write the target, row grain, exact prediction decision time T, eligible population, source publication/revision policy, and intended validation split. If T is ambiguous, the audit cannot pass.
Use the audit checklist during every audit. Consult the leakage-pattern catalog while tracing failure modes and the case studies when performance or a join looks implausible.
Audit sequence
- Trace the target to its source and identify aliases, transformations, proxies, and duplicated labels.
- Inventory every candidate feature, raw source, event/publication/revision time, and availability at T.
- Inspect temporal transforms for stable sort and shift-before-roll/expand.
- Trace opponent, roster, injury, rating, weather, price, and schedule joins.
- Verify preprocessing, selection, encoding, and tuning fit only on training rows.
- Verify validation moves forward in time and related rows remain together.
- Run automated matrix heuristics, then manually investigate every finding.
- Reproduce suspicious rows and performance jumps from raw inputs.
- Issue the verdict and block unsupported claims until repair and rerun.
Leakage catalog
| Pattern | Example | Evidence to inspect | Repair |
| Target alias | won, margin sign, final rank | lineage and exact/near correlation | remove from inputs |
| Same-event contamination | current score, EPA, box totals | source/event timestamps | target-only or redefine T |
| Unshifted history | current result in rolling mean | transform order and boundary rows | shift, then aggregate |
| Season bleed | final season average on week 2 | snapshot/publication policy | expanding prior value |
| Opponent contamination | opponent total includes matchup | join trace and paired rows | join safe opponent priors |
| Revision leakage | corrected stat used historically | publication/revision timestamps | reconstruct as-of vintage |
| Random row split | future games in train | fold date ranges | forward-only split |
| Group leakage | two game perspectives split apart | game/entity membership | group related rows |
| Preprocessing leak | scaler/encoder fit globally | fitted-object lineage | fit in training fold |
| Tuning leak | final fold drives hyperparameters | experiment history | nested tuning/untouched holdout |
| Duplicate leakage | same event or player appears in both | hashes and keys | deduplicate/group before split |
Manual review
Target and time
- Is the target post-T by definition, and are canceled/tied/incomplete events handled?
- Are prediction timestamps stored or reconstructable rather than assumed?
- Which provider fields are revised, and which historical vintage is used?
- Could a feature name be harmless while its source table is post-event?
Transformations
# df is the team-game panel from data-sources
ordered = df.sort_values(["team", "event_time", "game_id"])
expected = ordered.groupby("team")["won"].transform(
lambda s: s.shift(1).expanding(min_periods=1).mean()
)
assert expected.equals(ordered["pre_win_pct"])Check sort tie-breaks, reset boundaries, offseason carryover, minimum periods, and whether the first entity event has an unexplained empirical prior. A future perturbation test should prove that changing later outcomes cannot alter earlier features.
Joins
For every join, document left/right grain, keys, expected cardinality,
publication-time predicate, unmatched rate, duplicate rate, and fields retained.
An as-of join must be backward-looking and satisfy right_published_at <= T.
Display-name joins and silent many-to-many expansion are audit failures until
resolved. Opponent features must equal the opponent's own pre-event row.
Splits and preprocessing
For every fold prove train max time < test min time, allowing only the declared
gap/embargo. Keep paired team-game rows, repeated observations from the same
event, and other dependency groups together when the estimand requires it.
Imputers, scalers, encoders, selectors, target encoders, PCA, early stopping,
and hyperparameter search must see training data only.
Too-good triggers
Near-perfect accuracy, implausibly low log-loss/error, a dramatic single-feature jump, train/test equality, or a result far beyond domain baselines triggers a stop. Recheck target aliases, current-event fields, shifts, opponent joins, duplicates, global preprocessing, and test-fold tuning before discussing merit.
Heuristic checks
On the user's table, check column names, exact copies of the target, duplicate keys, and near-perfect correlations. Name the forbidden columns for the task. The first-event null-rate check is always REVIEW, not PASS, because a legitimate prior can populate first events. Duplicate rows and near-perfect correlations are also REVIEW: they are suspicious, not proof. A direct forbidden or target-identical feature is NOT CLEAN. Otherwise the heuristic result is REVIEW REQUIRED. Heuristics never return CLEAN. Only a completed manual audit of lineage, transforms, joins, splits, and fold-local preprocessing can issue CLEAN.
| Heuristic result | Agent action |
REVIEW REQUIRED | Continue. Complete the manual audit. |
NOT CLEAN | Stop predictive claims until the table is repaired and retested. |
Automated checks cannot prove source availability, transform correctness, join direction, or fold scope. They supplement lineage and code review.
Diagnosis examples
Rolling form without a shift: manually recomputation shows row i contains
its own result. Mark NOT CLEAN, rebuild with shift(1), regenerate all
downstream artifacts, and rerun validation.
Final-season efficiency on early games: the value is constant within season and reflects later games. Replace with an expanding as-of statistic from prior events; do not merely drop the first weeks.
Legitimate first-event prior: first rows have non-null ratings, but lineage
shows a fixed preseason rating published before T. Keep REVIEW REQUIRED until
the initialization and timestamp are documented, then pass that item.
Random K-fold with clean features: feature checks pass but future seasons
enter training. The pipeline is still NOT CLEAN; redesign folds and rerun all
reported metrics.
Verdict rules
| Verdict | Meaning |
CLEAN | complete inventory reviewed; no unresolved violations or review items |
REVIEW REQUIRED | no proven contamination, but evidence or availability is incomplete |
NOT CLEAN | at least one feature, join, transform, split, or tuning path uses forbidden information |
Uncertainty is not CLEAN. A fixed matrix must be regenerated and reevaluated;
deleting a suspicious column after scoring does not rescue prior metrics.
Audit report template
Leakage audit
Sport / question / target / grain:
Decision time T and publication policy:
Data snapshot and feature count:
Validation and grouping rule:
Heuristic result:
Lineage and transform evidence reviewed:
Findings:
1. [PASS | REVIEW | FAIL] item, evidence, affected scope
Contaminated fields/artifacts:
Required repairs and retests:
Remaining uncertainty:
Verdict: CLEAN | REVIEW REQUIRED | NOT CLEAN
Auditor / date:Integrity and resource routing
- Prefer a false review to a false clean; never infer cleanliness from metrics.
- Timeline sort in the audit must match construction exactly.
- Do not repair leakage by dropping a bad test period or redefining success.
NOT CLEANblocks predictive claims until rebuilt and retested.- Use
references/audit_checklist.mdfor completion,references/leakage_patterns.mdfor taxonomy, andreferences/case_studies.mdfor diagnosis. - Pair with
feature-rulesfor remediation andvalidation-designfor folds.
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.

