/ml:ml-skewfrom ml
Finds and fixes training-serving skew in a live ML system by measuring the three gaps (training, holdout, next-day, live), comparing logged serving features with rebuilt ones, and checking sampling weights, joined tables, shared feature code, filter holdouts and position features. Use when the user says "training-serving skew", "offline metrics don't match production", "log features at serving time", "importance weight sampled data", "position bias in ranking", "unfiltered holdout traffic", "next-day evaluation" or "same feature code for training and serving". Also use it when a model scores well offline but worse live, or when a ranking or filtering model feeds its own training data. Not for monitoring data freshness, export checks or alerts (use ml-monitoring).
Ships in ml. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an ML engineer hunting training-serving skew. Measure where the model loses quality between training and serving, find the cause, and record it.
../../references/lessons.md and, if it exists, docs/ml-plans/lessons.md.../../references/rules.md (rules 29 to 37).../../references/workflow.md for the folder layout, phases and verdict format.plan.md, pipeline.md and monitoring.md in docs/ml-plans/*/ if present.
Do not ask again what they answer./ml:ml-first-pipeline and stop.../../templates/ml_checks.py into analysis/. Change only the data loading.skew_gaps(train, holdout, nextday, live). Read each gap (rule 37):
serving_mismatch(served, rebuilt) on the same example
ids. Any differing feature is FATAL, because the model trains on values it never
sees at serving (rules 29, 32).Recommend only the fixes the diagnostics support, each with its rule.
After a fix, run skew_gaps and serving_mismatch again on fresh next-day and live
data. Check that the next-day versus live gap is zero, that calibration holds after
reweighting, and that the unfiltered slice is still being labelled. Emit a verdict
for any check that fails; when in doubt, choose the higher label.
Tick every box in the gate in workflow.md. In addition, the four metrics come
from one run of skew_gaps, and the live number comes from serving logs, not from
replaying the training pipeline. If a box is not ticked, say what is missing.
Write docs/ml-plans/<project>/skew.md:
# Training-serving skew: <project>
**Date**: <date> **Metric**: <metric>
## The three gaps (rule 37)
| Training | Holdout | Next-day | Live |
|---|---|---|---|
| <n> | <n> | <n> | <n> |
<verdicts from skew_gaps, quoted>
## Serving features (rules 29, 31, 32)
Logged at serving: <yes | sample | no>. serving_mismatch: <quoted output>.
## Sampling, filtering, ranking (rules 30, 34, 35, 36)
<weights used, unfiltered slice size, position handling>
## Fixes and owners
<fix, rule, status>
Next: /ml:ml-error-analysis if the gaps are closed and quality is still low;
/ml:ml-monitoring to alert on the gaps; /ml:ml-auditor before a launch.
| Mistake | Why it is wrong | Instead |
|---|---|---|
| Random split from training dates | Hides time-sensitive features | Train up to a date, test after it (rule 33) |
| Accepting a small next-day versus live gap | Same examples must score the same | Treat it as a bug and find it (rule 37) |
| Rebuilding serving features from tables | The tables changed since serving | Log features at serving (rules 29, 31) |
| Dropping sampled data without weights | Breaks calibration | Weight by 1/p (rule 30) |
| Training a filter on user flags only | Users never see blocked items | Label an unfiltered held-out slice (rule 34) |
| Crossing position with document features | The model learns a feedback loop | Keep position additive, serve a default (rule 36) |
| Two codebases for features | They diverge silently | One shared conversion function (rule 32) |
Rules 29 to 37, training-serving skew, in Phase II (no own anchor):
https://developers.google.com/machine-learning/guides/rules-of-ml#ml_phase_ii_feature_engineering.
URLs checked 2026-10-22.
When the user corrects you, append a lesson to docs/ml-plans/lessons.md
(format in ../../references/lessons.md).
What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/ml-auditorStress-tests an existing production ML system or an ML design doc against all 43 rules in six categories (objective and metrics, pipeline and infrastructure, monitoring, features, evaluation and skew, launch decisions), rates each finding fatal, serious or minor with evidence and the rule number, and hands each fix to the owning skill without making it. Use when the user says "audit my ML system", "audit our ML pipeline", "review my ML design doc", "stress-test our ML design", "check against the rules of ML" or "Zinkevich rules review". Also use it when the user doubts whether a production ML system or its offline numbers can be trusted before a launch. Not for building or fixing a system, and not for time series forecasting./ml-error-analysisRuns human analysis of a live ML system before and after a launch, namely rater and persona checks instead of insider judgment, the model delta between old and new models with a self-delta stability check, judging by the decision rather than log loss, turning error patterns into candidate features, rated metrics for undesirable behaviour, and short-term versus long-term behaviour. Use when the user says "error analysis", "model delta", "look at the model's mistakes", "false positives and false negatives", "human raters", "dogfood", "log loss improved but the product got worse" or "measure the bad results". Also use it when the user asks why the new model gets certain instances wrong or whether a candidate model really differs from production. Not for reviewing a whole ML system (use ml-auditor), and not for launch trade-offs between metrics (use ml-plateau).Other plugins' skills for the same job
npx claudepluginhub robinicole/skills --plugin ml