designing-leakage-safe-experiments

designing-leakage-safe-experiments is a skill for Claude Code, Codex from aiopshwang/data-analysis-ml-agent-skills. It costs 59 tokens per session (728 once invoked), scanned A, original, MIT.

A method for designing machine-learning experiments whose tests resemble how the model will receive new data in practice. It defines prediction timing, eligible features, data splits, comparison rules, and error costs.

In plain words
What is it for?
Use it to choose time-based, grouped, location-based, or other data splits; check when features become available; define baselines and metrics; and compare model versions fairly.
Why use it?
It reduces data leakage, where training or testing accidentally uses information that would not be available when making a real prediction. This makes comparisons and future-performance estimates more credible.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the data-analysis-ml-agent-skills plugin — 7 skills shipped together

Good fit Use it to choose time-based, grouped, location-based, or other data splits; check when features become available; define baselines and metrics; and compare model versions fairly.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aiopshwang/data-analysis-ml-agent-skills/designing-leakage-safe-experiments
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 aiopshwang/data-analysis-ml-agent-skills --skill designing-leakage-safe-experiments
Clone the repo
git clone --depth 1 https://github.com/aiopshwang/data-analysis-ml-agent-skills

Made for: Claude Code, Codex.

Or install data-analysis-ml-agent-skills, the plugin that ships this one along with the rest of its 7 skills.

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 designing-leakage-safe-experiments

README.md
[![agentmods](https://agentmods.dev/badge/skills/aiopshwang/data-analysis-ml-agent-skills/designing-leakage-safe-experiments/github.svg)](https://agentmods.dev/skills/aiopshwang/data-analysis-ml-agent-skills/designing-leakage-safe-experiments)
Your own site
<a href="https://agentmods.dev/skills/aiopshwang/data-analysis-ml-agent-skills/designing-leakage-safe-experiments"><img src="https://agentmods.dev/badge/skills/aiopshwang/data-analysis-ml-agent-skills/designing-leakage-safe-experiments/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 designing-leakage-safe-experiments

Your own site · 80×15
<a href="https://agentmods.dev/skills/aiopshwang/data-analysis-ml-agent-skills/designing-leakage-safe-experiments"><img src="https://agentmods.dev/badge/skills/aiopshwang/data-analysis-ml-agent-skills/designing-leakage-safe-experiments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 728 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.00059 $0.00728
Opus 5 $0.00030 $0.00364
Sonnet 5 $0.00012 $0.00146
Haiku 4.5 $0.00006 $0.00073

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

Security

Grade A, and why

designing-leakage-safe-experiments 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 11d 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/designing-leakage-safe-experiments/SKILL.md · 56 lines

How it starts

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

Design Leakage-Safe Experiments

Create an experiment whose result would remain credible when the model meets new data in its intended operating environment. Leakage prevention starts with time and causality, not with a random split parameter.

Define the prediction event

Write down:

  • entity and prediction grain;
  • decision made from the prediction;
  • prediction timestamp and feature cutoff;
  • outcome definition and maturity window;
  • eligible population at prediction time;
  • deployment cadence, horizon, and retraining policy;
  • operational cost of each error type.

Build an availability ledger for candidate features: source event, observation time, recording delay, correction or backfill behavior, earliest production availability, and whether the value depends on the outcome. Exclude or reconstruct features that would not exist in the same form at prediction time.

Read references/leakage-threats-and-splits.md when choosing a split or investigating a suspected leakage path.

Lock the comparison protocol

  1. Choose a split that matches deployment: temporal for future generalization, grouped for repeated entities, spatial or site holdout for new locations, or a justified combination.
  2. Reserve the final test set before feature selection or tuning. Repeated test inspection turns it into validation data.
  3. Fit preprocessing, imputation, encoding, scaling, selection, and resampling only on the training portion of each fold.
  4. Fit a calibrator from a separate calibration split or from out-of-fold predictions that did not train the base prediction for those records.
  5. Choose the operating threshold or decision policy from validation or calibration evidence. Keep the final test untouched until the model, calibrator, and policy are locked.
  6. Define primary and guardrail metrics before seeing candidate results.
  7. Establish a transparent baseline: prevalence, naive forecast, rule, or simple regularized model as appropriate.
  8. Hold data, split, metric implementation, and compute budget constant while comparing one material change at a time.
  9. Record every run, including failures and negative results. Complexity earns adoption only through a repeatable, decision-relevant improvement.

Read the full file on GitHub · 56 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 56 lines · 59 tokens per session scan A fcfe90e90f4d

Subscribe to this mod's changes

designing-leakage-safe-experiments is a skill published in the GitHub repository aiopshwang/data-analysis-ml-agent-skills (12 stars, last pushed 14d ago), licensed MIT. It adds 59 tokens to every session and 728 once invoked, about $0.0003 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

eu-ai-act-readiness

Build a preliminary, evidence-based EU AI Act readiness assessment across AI-system inventory, territorial scope, operator roles, prohibited-practice screening, risk classification, transparency, high-risk controls, general-purpose AI obligations, governance, and implementation milestones. Use when an organization…

seb1n/awesome-ai-agent-skills · 136 tokens

data-labeling

Set up and manage data labeling workflows using manual annotation tools, semi-automated pipelines, active learning, and programmatic weak supervision. Use when the user requests data labeling or provides relevant inputs for this workflow.

seb1n/awesome-ai-agent-skills · 46 tokens

knowledge-graph-creation

Build structured knowledge graphs from unstructured text by extracting entities, mapping relationships, generating graph triples, and visualizing the result. Use when the user requests knowledge graph creation or provides relevant inputs for this workflow.

seb1n/awesome-ai-agent-skills · 47 tokens

literature-review

Conduct a structured literature review on a given topic by defining a search strategy, applying inclusion and exclusion criteria, extracting key findings, and synthesizing results into a coherent academic review. Use when the user requests literature review or provides relevant inputs for this workflow.

seb1n/awesome-ai-agent-skills · 54 tokens

hyperparameter-tuning

Optimize machine learning model hyperparameters using grid search, random search, Bayesian optimization, and Hyperband to maximize model performance within a compute budget. Use when the user requests hyperparameter tuning or provides relevant inputs for this workflow.

seb1n/awesome-ai-agent-skills · 49 tokens

model-training

Train machine learning models end-to-end, covering data loading, preprocessing, architecture selection, training loops, validation, and checkpointing. Use when the user requests model training or provides relevant inputs for this workflow.

seb1n/awesome-ai-agent-skills · 44 tokens