.gemini/skills/MLOps Prototyping/SKILL.md
Guide to create structured, reproducible Jupyter notebooks for MLOps prototyping, emphasizing configuration management and pipeline integrity.
npx skillsauth add fmind/mlops-python-package MLOps PrototypingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
To create standardized, reproducible, and production-ready prototypes in Jupyter notebooks. This skill enforces a structured layout (Imports -> Configs -> Load -> EDA -> Modeling -> Eval) and robust engineering practices (Pipelines, Split-Verification) to prevent technical debt and data leakage.
uv managed project (.venv).ipynb file or converting to one.Enforce the following linear sections in every notebook to ensure readability and maintainability.
sklearn.pipeline.Pipeline objects.Expose all "knobs" at the top of the notebook for easy experimentation.
Randomness: Define RANDOM_STATE = 42 and use it in splits and model initialization.
Paths: Use pathlib for robust path handling.
from pathlib import Path
ROOT = Path("..")
DATA_PATH = ROOT / "data" / "input.parquet"
Hyperparameters: Group model params (e.g., N_ESTIMATORS, MAX_DEPTH).
Toggles: Use booleans for expensive operations (e.g., USE_GPU = True, RUN_GRID_SEARCH = False).
Ensure data integrity and prevent leakage.
pd.read_parquet for speed/types, or pd.read_csv.X_train, X_test, y_train, y_test before any data-dependent transformations (imputation, scaling).sklearn.model_selection.train_test_split with stratify for balanced classification.sklearn.model_selection.TimeSeriesSplit if data has a temporal dimension (do NOT shuffle).random_state=RANDOM_STATE.Prohibit raw data transformations on the full dataset.
Mandate: Use sklearn.pipeline.Pipeline or ColumnTransformer.
Why: Automation of fit on train and transform on test prevents data leakage.
Example:
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.impute import SimpleImputer
from sklearn.compose import ColumnTransformer
CACHE = "./.cache" # Define a cache directory
numeric_transformer = Pipeline(steps=[
('imputer', SimpleImputer(strategy='median')),
('scaler', StandardScaler())
])
preprocessor = ColumnTransformer(transformers=[
('num', numeric_transformer, numeric_features)
])
# Use 'memory' to cache transformer outputs, speeding up GridSearch
model = Pipeline(steps=[
('preprocessor', preprocessor),
('classifier', RandomForestClassifier())
], memory=CACHE)
Go beyond accuracy/MSE.
sklearn.metrics appropriate for the task (F1, ROC-AUC, RMSE, MAE).feature_importances_ or SHAP values.Facilitate the move from notebook to python package (src/).
.py file trivial later.parameters (for Papermill) or export to mark cells that should be part of the final documentation or automated pipeline.Restart Kernel and Run All) without errors before committing.Configs section?fit called ONLY on X_train?random_state set for all stochastic operations?development
Guide to implement rigorous validation layers including static analysis, automated testing, structured logging, and security scanning.
testing
Guide to implement full stack observability including reproducibility, lineage, monitoring, alerting, and explainability.
tools
Guide to initialize a new MLOps project with standard tools (uv, git, VS Code) and best practices.
development
Guide to transform prototypes into robust, distributable Python packages using the src layout, hybrid paradigm, and strict configuration management.