/data-analytics-skills:ml-ops-engineerfrom data-analytics-skills
Handles MLOps workflows: model deployment, training pipeline validation, drift detection (PSI/KS), model registry with version comparison, feature store setup, and ML CI/CD automation.
Ships in data-analytics-skills. 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.
Read when SKILL.md points to them; scripts run unread.
The agent operates as a senior MLOps engineer, deploying models to production, orchestrating training pipelines, monitoring model health, managing feature stores, and automating ML CI/CD.
Before deploying, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
| Level | Capabilities | Key signals |
|---|---|---|
| 0 - Manual | Jupyter notebooks, manual deploy | No version control on models |
| 1 - Pipeline | Automated training, versioned models | MLflow tracking in use |
| 2 - CI/CD | Continuous training, automated tests | Feature store operational |
| 3 - Full MLOps | Auto-retraining on drift, A/B testing | SLA-backed monitoring |
# model_server.py -- FastAPI model serving
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import mlflow.pyfunc, time
app = FastAPI()
model = mlflow.pyfunc.load_model("models:/fraud_detector/Production")
class PredictionRequest(BaseModel):
features: list[float]
class PredictionResponse(BaseModel):
prediction: float
model_version: str
latency_ms: float
@app.post("/predict", response_model=PredictionResponse)
async def predict(req: PredictionRequest):
start = time.time()
try:
pred = model.predict([req.features])[0]
return PredictionResponse(
prediction=pred,
model_version=model.metadata.run_id,
latency_ms=(time.time() - start) * 1000,
)
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
@app.get("/health")
async def health():
return {"status": "healthy", "model_loaded": model is not None}
# k8s/model-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: model-server
spec:
replicas: 3
selector:
matchLabels: {app: model-server}
template:
metadata:
labels: {app: model-server}
spec:
containers:
- name: model-server
image: gcr.io/project/model-server:v1.2.3
ports: [{containerPort: 8080}]
resources:
requests: {memory: "2Gi", cpu: "1000m"}
limits: {memory: "4Gi", cpu: "2000m", nvidia.com/gpu: 1}
env:
- {name: MODEL_URI, value: "s3://models/production/v1.2.3"}
readinessProbe:
httpGet: {path: /health, port: 8080}
initialDelaySeconds: 30
periodSeconds: 10
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: model-server-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: model-server
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target: {type: Utilization, averageUtilization: 70}
# monitoring/drift_detector.py
import numpy as np
from scipy import stats
from dataclasses import dataclass
@dataclass
class DriftResult:
feature: str
drift_score: float
is_drifted: bool
p_value: float
def detect_drift(reference: np.ndarray, current: np.ndarray, threshold: float = 0.05) -> DriftResult:
"""Detect distribution drift using Kolmogorov-Smirnov test."""
statistic, p_value = stats.ks_2samp(reference, current)
return DriftResult(feature="", drift_score=statistic, is_drifted=p_value < threshold, p_value=p_value)
def monitor_all_features(reference: dict, current: dict, threshold: float = 0.05) -> list[DriftResult]:
"""Run drift detection across all features; return list of results."""
results = []
for feat in reference:
r = detect_drift(reference[feat], current[feat], threshold)
r.feature = feat
results.append(r)
return results
ALERT_RULES = {
"latency_p99": {"threshold": 200, "severity": "warning", "msg": "P99 latency exceeded 200 ms"},
"error_rate": {"threshold": 0.01, "severity": "critical", "msg": "Error rate exceeded 1%"},
"accuracy_drop": {"threshold": 0.05, "severity": "critical", "msg": "Accuracy dropped > 5%"},
"drift_score": {"threshold": 0.2, "severity": "warning", "msg": "Feature drift detected (PSI)"},
}
# Starting points (heuristics, not benchmarks): tune each against your own SLA and baseline.
# features/customer_features.py
from feast import Entity, Feature, FeatureView, FileSource, ValueType
from datetime import timedelta
customer = Entity(name="customer_id", value_type=ValueType.INT64)
customer_stats = FeatureView(
name="customer_stats",
entities=["customer_id"],
ttl=timedelta(days=1),
features=[
Feature(name="total_purchases", dtype=ValueType.FLOAT),
Feature(name="avg_order_value", dtype=ValueType.FLOAT),
Feature(name="days_since_last_order", dtype=ValueType.INT32),
Feature(name="lifetime_value", dtype=ValueType.FLOAT),
],
online=True,
source=FileSource(
path="gs://features/customer_stats.parquet",
timestamp_field="event_timestamp",
),
)
Online retrieval at serving time:
from feast import FeatureStore
store = FeatureStore(repo_path=".")
features = store.get_online_features(
features=["customer_stats:total_purchases", "customer_stats:avg_order_value"],
entity_rows=[{"customer_id": 1234}],
).to_dict()
import mlflow
mlflow.set_tracking_uri("http://mlflow.company.com")
mlflow.set_experiment("fraud_detection")
with mlflow.start_run(run_name="xgboost_v2"):
mlflow.log_params({"n_estimators": 100, "max_depth": 6, "learning_rate": 0.1})
model = train_model(X_train, y_train)
mlflow.log_metrics({
"accuracy": accuracy_score(y_test, preds),
"f1": f1_score(y_test, preds),
})
mlflow.sklearn.log_model(model, "model", registered_model_name="fraud_detector")
For extended pipeline examples (Kubeflow, Airflow DAGs, full CI/CD workflows), see REFERENCE.md.
REFERENCE.md -- Extended patterns: Kubeflow pipelines, Airflow DAGs, CI/CD workflows, model registry operationsPython standard library only, no network. Run from the skill folder; --format text|json on every tool (--json is an alias).
python3 scripts/drift_detector.py --reference assets/reference.csv --current assets/current_drifted.csv
python3 scripts/pipeline_validator.py assets/flawed_pipeline.json --strict
python3 scripts/model_registry.py --registry assets/sample_registry.json compare --name fraud_detector --versions v1 v2 v3
python3 scripts/model_registry.py --registry my_registry.json register --name fraud_detector --version v4 --metrics '{"f1":0.92}'
python3 scripts/model_registry.py --registry my_registry.json promote --name fraud_detector --version v4 --stage production
python3 scripts/model_registry.py --registry my_registry.json list --stage production --format json
Real output of the first command (excerpt):
Read 200 reference rows and 200 current rows; checked 3 feature(s), PSI threshold 0.2
Feature Type PSI KS Drifted
plan categorical 4.2205 - YES
age numeric 2.4647 0.5550 YES
income numeric 0.0379 0.0550 no
! 'age' PSI 2.4647 >= 0.2; mean 40.5005 -> 52.013, KS 0.555 (5% critical 0.1358)
fix: Check the upstream source for a unit/scale or filter change; ...
FIX 2 of 3 feature(s) drifted (66.7%)
| Code | Meaning |
|---|---|
| 0 | Clean: no feature drifted / no pipeline errors or warnings / registry action done or no regression |
| 1 | Findings: a drifted or missing feature; a pipeline error or warning; compare found the newest version worse than an earlier one |
| 2 | Unusable input: missing, unreadable, empty or malformed file; invalid JSON; unknown column, model or version; duplicate version; bad stage. One BLOCKED: ... line on stderr, never a traceback |
| Tool | Purpose | Key Flags |
|---|---|---|
model_registry.py | Register, promote, list and compare model versions in a local JSON file; promotion to production archives the previous production version | --registry <file>, register --name --version --metrics --params, promote --stage, list, compare --versions <oldest..newest> [--lower-better m] |
drift_detector.py | PSI per feature (numeric: 10 equal-width bins; categorical: category shares) plus the KS statistic with its 5% critical value; flags missing columns and new categories | --reference <csv>, --current <csv>, --columns, --threshold (PSI, default 0.2) |
pipeline_validator.py | Checks stage types and order, unresolved inputs, evaluation gate, rollback, cron schedule, notifications; every finding carries a fix | <pipeline.json>, --strict, top-level "external_inputs" for data from outside the pipeline |
Heuristics, not tests: the PSI bands (below 0.1 stable, 0.1-0.2 moderate, 0.2 and above significant) are a long-standing credit-risk rule of thumb; PSI is unreliable below about 30 rows a side (the tool warns). compare treats metrics containing loss, error, rmse, mae, mse, latency, drift or fpr as lower-is-better; override with --lower-better.
| Problem | Likely Cause | Resolution |
|---|---|---|
| Model latency exceeds P99 SLA (> 200 ms) | Model is too large, input preprocessing is slow, or pod resources are undersized | Profile the serving endpoint; consider model distillation, input caching, or increasing CPU/memory limits |
drift_detector.py flags all features as drifted | Threshold is too low or the reference data is from a different time period than expected | Raise --threshold above the 0.2 default only with a stated reason or regenerate the reference dataset from a more representative window |
| Pipeline fails at the evaluation gate | Model accuracy dropped below the configured threshold | Check for data quality issues upstream; compare feature distributions with drift_detector.py; retrain with fresh data |
| Model registry shows "already registered" error | The exact name + version combination was previously registered | Use a new version string (e.g., v2.3.1) or remove the old entry if it was a test |
| Kubernetes pods crash-loop on model server | OOM kill due to model size exceeding memory limits, or health check timeout too short | Increase resources.limits.memory; extend initialDelaySeconds on readiness probe for large models |
| Feature store returns stale features | Materialization job failed or ran outside the TTL window | Check materialization logs; re-run materialize_features; consider reducing TTL or adding freshness alerts |
pipeline_validator.py reports STAGE_ORDER error | Pipeline stages are defined out of the expected sequence (data -> transform -> train -> evaluate -> deploy) | Reorder stages to follow the canonical sequence; the validator expects data stages before training stages |
pipeline_validator.py --strict with zero errors before deployment.In scope: Model deployment (real-time and batch), ML pipeline orchestration, model registry management, drift detection (data drift, concept drift, prediction drift), feature store patterns, monitoring and alerting, Kubernetes deployment configurations, and CI/CD for ML.
Out of scope: Model architecture design and algorithm selection (see data-scientist), raw data ingestion pipelines, BI dashboard development, and business strategy.
Limitations: The Python tools use only the Python standard library. drift_detector.py computes PSI and the KS statistic per feature but does not support multivariate drift detection or Evidently/Alibi Detect integration. model_registry.py stores state in a local JSON file -- for production use, integrate with MLflow Model Registry or a similar platform. pipeline_validator.py validates structure and conventions but does not execute pipeline stages.
data-analytics/data-scientist): Receives trained models with experiment metadata; promotes winning experiments to the registry for deployment.data-analytics/analytics-engineer): Feature engineering pipelines may depend on dbt mart models; schema changes trigger pipeline revalidation.engineering/senior-ml-engineer): Collaborates on model architecture optimization for serving constraints (latency, memory, GPU).engineering/): Kubernetes configurations, autoscaling policies, and CI/CD workflows are co-managed with platform engineering.data-analytics/business-intelligence): Model predictions may feed into BI dashboards; monitoring metrics are surfaced in operational dashboards.REFERENCE.md (opens in a new tab)assets/contract.json (opens in a new tab)assets/current_drifted.csv (opens in a new tab)assets/current_stable.csv (opens in a new tab)assets/flawed_pipeline.json (opens in a new tab)assets/malformed_pipeline.json (opens in a new tab)assets/malformed_reference.csv (opens in a new tab)assets/malformed_registry.json (opens in a new tab)assets/reference.csv (opens in a new tab)assets/sample_pipeline.json (opens in a new tab)assets/sample_registry.json (opens in a new tab)scripts/drift_detector.py (opens in a new tab)scripts/model_registry.py (opens in a new tab)scripts/pipeline_validator.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub borghei/claude-skills --plugin data-analytics-skills8 skills in this plugin
/analytics-engineerAnalytics engineering across data modeling, dbt, transformation, and semantic layers, with tools that check a dbt manifest/catalog (model quality, downstream impact, schema drift, model docs). Use when building dbt models, designing star schemas, writing staging or mart SQL, configuring data tests, optimizing warehouse queries, or before merging a dbt change that may break dashboards.
/business-intelligenceScore KPIs against targets, validate metric definitions, lay out dashboards and review a finished dashboard spec for overload, chart misuse and conflicting definitions. Use when designing, reviewing or automating BI dashboards and KPIs.
/data-analystProfiles CSV/JSON exports for data-quality problems (with the fix per column), checks SQL for correctness traps and slow patterns, and builds a paste-ready summary report. Use when someone shares a data export or a query and asks what it says, whether it can be trusted, or how to fix it; also for cohort, funnel and dashboard work.
/data-scientistExperiment design and A/B readouts (sample size, sample-ratio and contamination checks, tests with intervals), feature screening for leakage, model evaluation against a no-skill baseline, and fair experiment comparison. Use when sizing or reading out an A/B test, choosing features, judging a model from its predictions, or picking between training runs.
/data-storytellingCheck that an analysis write-up says what the data says: figures traced to the results file, headline and caveats, chart choices. Use when reviewing a report, dashboard narrative or findings memo before it goes out.
/statistical-analystApplied statistics for business and product questions — test selection, assumption checks, power planning, effect sizes with intervals, multiplicity correction. Use when interpreting an experiment, sizing a study, or vetting a claim.
Other plugins' skills for the same job