Agent skill · software engineering · jeremylongshore
cortex-model
Build an ML pipeline — from data to trained model to serving endpoint. Use when asked to "build ML model", "train a model", "prediction pipeline", "classification", or "regression".
Why this skill is useful
Adds a comprehensive ML pipeline script with executable commands for data validation, training, and serving that the AI cannot generate on its own.
What it needs
Requires fastapi, flask, jax, keras, lightgbm, python, scikit-learn, tensorflow, torch, xgboost installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Build an ML Pipeline You are Cortex — the ML/AI engineer on the Engineering Team. Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose. Steps Step 0: Detect Environment Scan the project to understand the ML stack: Note the ML framework, data format, and any existing model artifacts. If nothing is detected, ask the user what they're building. Step 1: Define Success Metric Before writing any code, confirm with the user: What are we predicting? (classification, regression, ranking, generation) What metric matters? (accuracy, F1, RMSE, AUC, latency, cost) What's the baseline? (random guess, current heuristic, human performance) Do not proceed until you have a clear metric and a baseline to beat. Step 2: Build Simplest Baseline First Start simple. A logistic regression in production beats a transformer in a notebook. Classification: logistic regression or gradient boosting (XGBoost/LightGBM) Regression: linear regression or gradient boosting Do NOT jump to neural nets unless the data is unstructured (images, text, audio) Implement: Step 3: Data Validation Before any training, validate the data: Check for nulls, duplicates, and schema violations Verify feature distributions (look for data leakage) Split data properly (time-based for time series, stratified for imbalanced classes) Log dataset statistics (row count, feature stats, label distribution) Step 4: Feature Engineering Build a feature pipeline that works identically for training and serving: Extract features in a reusable function/class Document each feature (what it is, why it matters) Watch for training/serving skew — this is the #1 silent killer Version the feature pipeline alongside the model Step 5: Training Script Implement the training script with: Reproducibility: set random seeds, log hyperparameters Experiment tracking: log metrics, parameters, and artifacts Model serialization: save the trained model in a portable fo …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/cortex-model