data-rigor-and-leakage

data-rigor-and-leakage is a skill for Claude Code from mxslr/mlcraft. It costs 96 tokens per session (557 once invoked), scanned A, original, MIT.

A checklist for preparing machine-learning data and finding data leakage, where information from the answer or test set accidentally reaches training. It covers correct train, validation, and test splits for grouped, patient-based, or time-ordered data.

In plain words
What is it for?
Use it before training to inspect labels, duplicates, class balance, preprocessing, and split rules, then repeat the checks when results look unusually good.
Why use it?
It prevents unrealistically high results that fail on new data because the model has seen related examples or future information during training.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the mlcraft plugin — 23 skills, 1 command, 1 agent shipped together

Good fit Use it before training to inspect labels, duplicates, class balance, preprocessing, and split rules, then repeat the checks when results look unusually good.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mxslr/mlcraft/data-rigor-and-leakage
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mxslr/mlcraft --skill data-rigor-and-leakage
Clone the repo
git clone --depth 1 https://github.com/mxslr/mlcraft

Made for: Claude Code.

Or install mlcraft, the plugin that ships this one along with the rest of its 23 skills, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for data-rigor-and-leakage

README.md
[![agentmods](https://agentmods.dev/badge/skills/mxslr/mlcraft/data-rigor-and-leakage/github.svg)](https://agentmods.dev/skills/mxslr/mlcraft/data-rigor-and-leakage)
Your own site
<a href="https://agentmods.dev/skills/mxslr/mlcraft/data-rigor-and-leakage"><img src="https://agentmods.dev/badge/skills/mxslr/mlcraft/data-rigor-and-leakage/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for data-rigor-and-leakage

Your own site · 80×15
<a href="https://agentmods.dev/skills/mxslr/mlcraft/data-rigor-and-leakage"><img src="https://agentmods.dev/badge/skills/mxslr/mlcraft/data-rigor-and-leakage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 557 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00096 $0.00557
Opus 5 $0.00048 $0.00279
Sonnet 5 $0.00019 $0.00111
Haiku 4.5 $0.00010 $0.00056

Measured 9d ago against content hash 1632bcf1dd77, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

data-rigor-and-leakage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/data-rigor-and-leakage/SKILL.md · 30 lines

How it starts

The opening of the file, as written. The whole thing — 30 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Data Rigor & Leakage Audit

Wrong splits invalidate every downstream number. Do this before training and re-check whenever results look too good.

Leakage checklist

  • Group leakage (most common). If one entity (patient, person, product, document, study) yields multiple samples, ALL its samples must sit in ONE split. Random per-sample splitting scatters them across train/test the model memorizes the entity. Use GroupShuffleSplit / StratifiedGroupKFold keyed by the entity id.
  • Temporal leakage. Time-series / any time-ordered data: train must be strictly earlier than val/test. No shuffling across time. No future-derived features.
  • Official split. If the benchmark defines a train/test split (e.g., encoded in an ID), use it - otherwise numbers aren't comparable to papers.
  • Preprocessing / normalization leakage. Fit scalers, PCA, class weights, augmentation stats, and target encodings on train only, then apply to val/test. Never fit on the full set.
  • Duplicate / near-duplicate leakage. De-duplicate (and augmented copies) across splits.
  • Target leakage in features. Drop features that encode the label or are only known post-outcome.
  • Threshold/selection leakage. Choosing a decision threshold or doing model selection using test labels is leakage. Do it on validation.

Make it enforceable

Add explicit assertions that split membership is disjoint at the entity level, e.g.:

assert not (train_ids & val_ids) and not (train_ids & test_ids) and not (val_ids & test_ids)

Print per-split counts of entities (not just samples) and the class balance.

Also verify

  • Labels are correct and consistent (one authoritative source; handle multi-label-per-entity deliberately).
  • Class balance - decide handling now (class-weighted loss OR resampling, not both by default).
  • Manifest, not copies. Prefer a manifest table (path, entity, label, split) over shuffling files into folders - it makes the split auditable.

Read the full file on GitHub · 30 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 30 lines · 96 tokens per session scan A 1632bcf1dd77

Subscribe to this mod's changes

data-rigor-and-leakage is a skill published in the GitHub repository mxslr/mlcraft (8 stars, last pushed 2mo ago), licensed MIT. It adds 96 tokens to every session and 557 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

transformers

This skill should be used when working with pre-trained transformer models for natural language processing, computer vision, audio, or multimodal tasks. Use for text generation, classification, question answering, translation, summarization, image classification, object detection, speech recognition, and fine-tuning…

synthetic-sciences/openscience · 63 tokens

chief-data-officer

Owns data as an asset — governance, quality, the warehouse and semantic layer, analytics capability, and the governance of models built on top. Use this for a decision about how data is collected, stored, defined, or shared; when numbers disagree between teams; when deciding what to build in-house versus buy; when…

cbrock84/headcount · 88 tokens

ai-workflow-architect

Designs AI systems, automations, and agent workflows for a business — identifying which manual work is worth automating, how to structure the system, which tools fit, and what could go wrong. Use this to automate part of an operation, design an agent or MCP workflow, reduce repetitive manual work, connect tools into a…

cbrock84/headcount · 89 tokens

ai-ml-governance

Governs models and AI systems in production — intended use, evaluation, monitoring, human oversight, documentation, and the decision to deploy or retire. Use this before deploying a model or AI feature, when defining evaluation criteria, when a model's behavior has drifted, when assessing AI risk or regulatory…

cbrock84/headcount · 83 tokens

data-engineering

Builds and operates data pipelines — ingestion, transformation, orchestration, quality testing, and reliability of data delivery. Use this to design or debug a pipeline, decide batch versus streaming, add data quality checks, handle late or duplicate data, or work out why a dashboard's numbers changed without anyone…

cbrock84/headcount · 67 tokens

llm-integration

LLM integration patterns for function calling, streaming responses, local inference with Ollama, and fine-tuning customization. Use when implementing tool use, SSE streaming, local model deployment, LoRA/QLoRA fine-tuning, or multi-provider LLM APIs.

yonatangross/orchestkit · 58 tokens