agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when building or operating a machine learning pipeline. Covers feature engineering, training reproducibility, train/serve skew, deployment, monitoring for drift, and retraining.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill ml-pipeline --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ml-pipelineContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when building or operating a machine learning pipeline. Covers feature engineering, training reproducibility, train/serve skew, deployment, monitoring for drift, and retraining.
name: ml-pipeline description: Use when building or operating a machine learning pipeline. Covers feature engineering, training reproducibility, train/serve skew, deployment, monitoring for drift, and retraining. metadata: category: ai version: 1.0.0 tags: [mlops, pipeline, features, drift, deployment]
Build a machine learning pipeline that produces the same model twice and behaves in production the way it did in training. The two defining failure modes are irreproducible training and train/serve skew — the model sees different features in production than it saw in training, and quietly degrades.
1. **Define the label precisely** — Including the time at which it becomes known. A label that is only available thirty days after the prediction cannot be used to evaluate a model deployed today, and this constraint shapes everything. 2. **Check for leakage first** — Any feature computed from information that would not exist at prediction time will make the offline model look excellent and the production model useless. This is the most common and most expensive ML bug. 3. **Compute features once, use them twice** — The same code path for training and serving. Two implementations of the same feature will diverge, silently, and the model will degrade without any code changing. 4. **Version everything** — Data, code, environment, hyperparameters, and the model artifact. "Which data produced this model" must be answerable a year later. 5. **Shadow before you serve** — Run the new model on live traffic, log its predictions, and compare — without acting on them. 6. **Monitor drift and performance** — Input distribution, prediction distribution, and (when labels arrive) actual accuracy. A model degrades silently; nothing errors.
**Target leakage — the bug that looks like success:**
# The task: predict at signup whether a user will churn within 90 days.
features = [
"plan_tier",
"signup_channel",
"company_size",
"days_since_last_login", # LEAK: computed from the full history, including
# after the churn event. In production, at signup,
# this is always 0.
"total_support_tickets", # LEAK: counts tickets over the whole lifetime,
# including ones filed after the prediction point.
"cancelled_at_is_null", # LEAK: this IS the label, wearing a hat.
]
# Offline AUC: 0.97. Production AUC: 0.54 — barely better than a coin flip.
# Correct: every feature must be computable using only data available at the
# prediction timestamp.
features_at_prediction_time = [
"plan_tier",
"signup_channel",
"company_size",
"signup_day_of_week",
"referrer_domain",
]
# Offline AUC: 0.71. Production AUC: 0.69. Honest, and actually useful.**One code path for features, in training and in serving:**
# The feature definition lives in exactly one place.
@feature_view(entities=[user], ttl=timedelta(days=90))
def user_activity_features(df: DataFrame) -> DataFrame:
return df.assign(
orders_last_30d=count_orders(df, window="30d"),
avg_order_cents=avg_order_value(df, window="90d"),
days_since_first_order=days_since(df, "first_order_at"),
)
# Training reads it as of a historical point in time (point-in-time correct join).
train = store.get_historical_features(
entity_df=labels, # each row has an event_timestamp
features=["user_activity_features:orders_last_30d", ...],
)
# Serving reads it as of now — the same definition, the same code.
features = store.get_online_features(
features=["user_activity_features:orders_last_30d", ...],
entity_rows=[{"user_id": user_id}],
)**Drift monitoring that fires before the accuracy does:**
# Labels arrive 90 days late. Waiting for accuracy to drop means finding out
# in three months. Input drift is visible today.
for feature in MONITORED_FEATURES:
psi = population_stability_index(
reference=training_distribution[feature],
current=production_distribution(feature, wA curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…