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.
npx skills add StamKavid/last-ds-mile --skill target-leakage-detectiongit clone --depth 1 https://github.com/StamKavid/last-ds-mileWrote 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.
[](https://agentmods.dev/skills/stamkavid/last-ds-mile/target-leakage-detection)<a href="https://agentmods.dev/skills/stamkavid/last-ds-mile/target-leakage-detection"><img src="https://agentmods.dev/badge/skills/stamkavid/last-ds-mile/target-leakage-detection/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.
<a href="https://agentmods.dev/skills/stamkavid/last-ds-mile/target-leakage-detection"><img src="https://agentmods.dev/badge/skills/stamkavid/last-ds-mile/target-leakage-detection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00093 | $0.01132 |
| Opus 5 | $0.00046 | $0.00566 |
| Sonnet 5 | $0.00019 | $0.00226 |
| Haiku 4.5 | $0.00009 | $0.00113 |
Grade A, and why
target-leakage-detection 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 12d 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.
How it starts
The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.
target-leakage-detection
Overview
Leakage is the single most common way a DS project's offline metric lies about real world performance. This skill gives concrete detection techniques for the four ways it usually happens, rather than a vague "watch out for leakage" reminder.
When to Use
- A metric looks implausibly good on the first real attempt (see
ds-method's Red Flags). - Building a feature from an aggregate, a rolling window, or a join that could include future rows.
- A single feature dominates importance rankings in
/ds-explainor an ad hoc check. - NOT for: choosing a validation split (that's
ds-validate) — this skill is about what's inside a feature, not how data is split.
Core Process
- For every candidate feature, ask the "would this value have been known at
prediction time" question from
/ds-prep— but here go one level deeper: check the actual computation, not just the column name. - Run the four checks in the table below against every feature that wasn't hand-
verified already. For a full pipeline sweep (many features, or a pre-ship check
rather than one suspicious feature), delegate to the
leakage-auditoragent instead of running the sweep inline — it does the same four checks adversarially and keeps the intermediate trace-through out of this stage's context. Its findings come tagged Confirmed / Likely / Worth checking — remove or fix the feature for Confirmed and Likely findings before proceeding; record a Worth-checking finding in the stage doc as a flagged, unresolved item rather than blocking on it. - If a check fires, don't quietly drop the feature — trace it to its source (a join? an aggregate? a leaked label?) and record what was fixed.
Techniques/Patterns — four leakage types and how to catch each
| Leakage type | How it slips in | Detection technique | Fix |
|---|---|---|---|
| Post-outcome feature | A column is only populated after the target is known (e.g. "cancellation_reason" when predicting churn, "days_to_close" when predicting whether a deal closes) | Ask each feature's owner/source system when it's populated relative to the target event, not just what it's named | Drop it, or replace with a version computed strictly before the target event |
| Full-dataset aggregate ("time-traveling feature") | A rolling mean/sum/rank computed once over the whole dataset instead of per-row as-of-date | Recompute the same aggregate using only rows with an earlier timestamp than the row being predicted, and diff against the original — if they differ, the original leaked | Recompute as an as-of, expanding/rolling-window aggregate |
| Train/test contamination | The same real-world entity (customer, house, patient) appears in both train and validation, or a transform (scaler, encoder, target encoding) was fit on the full dataset before splitting | Check for duplicate/near-duplicate rows or shared keys across the split; confirm every fit-requiring transform lives inside a pipeline fit per-fold | Group-aware splitting (see ds-validate); move every stateful transform inside the CV loop |
| Direct target derivation | A feature is an arithmetic function of the target itself (e.g. "profit_margin" when predicting "profit", where margin = profit/revenue) | Compute the correlation AND check the literal formula/join that produced the feature, not just the correlation number | Drop the feature; if the underlying real-world quantity is genuinely available at prediction time, recompute it without touching the target |
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.
- 12d ago First seen · 73 lines · 93 tokens per session scan A 63d1842cf654
target-leakage-detection is a skill published in the GitHub repository StamKavid/last-ds-mile (3 stars, last pushed 1mo ago), licensed MIT. It adds 93 tokens to every session and 1,132 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.
Other skills, from other repositories
developing-with-streamlit
Use for ALL Streamlit tasks: creating, editing, debugging, beautifying, styling, theming, optimizing, or deploying Streamlit apps. Also custom components, st.components.v2, HTML/JS/CSS work. Discovers and loads version-matched reference docs from the user's installed Streamlit (>=1.57). Triggers: streamlit, st.…
marimo-pair
Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.
wax
Swift framework guidance for Wax on-device memory/RAG. Use when writing Swift code with the public Memory facade, experimental PhotoMemory / VideoMemory, BuiltInMultimodalEmbeddings, embedding providers, retrieval modes, or hybrid search. For agent operators using the Wax MCP server tools, use the separate wax-mcp…
wax-memory-maintenance
Maintain the Wax memory store used by the Hermes wax-memory provider.
ml-expert
Expert-level machine learning, deep learning, model training, and MLOps. Use when the user mentions machine learning, deep learning, neural networks, MLOps, or data science, or when the task involves Machine Learning Fundamentals, Data Preparation, or Model Training.
fast-dash
Build a Fast Dash web app from a Python function. Use when the user wants to turn a function into an interactive app, add a UI to an existing function, or build a dashboard / form / wizard. Fast Dash infers UI components from type hints, so a well-typed function becomes an app with one decorator.