.gemini/skills/MLOps Initialization/SKILL.md
Guide to initialize a new MLOps project with standard tools (uv, git, VS Code) and best practices.
npx skillsauth add fmind/mlops-python-package MLOps InitializationInstall 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 initialize a robust, production-ready MLOps project structure using the modern Python toolchain (uv), industry-standard version control (git), and a configured development environment (VS Code). This skill ensures reproducibility, collaboration, and high code quality from day one.
uv (replaces pip, venv, poetry, pyenv)Before modifying files, verify that the essential tools are available.
uv:
uv is installed: uv --versioncurl -LsSf https://astral.sh/uv/install.sh | shgit:
git is installed: git --versionInitialize the project structure using uv to ensure modern standards (pyproject.toml).
mkdir <project_name> && cd <project_name>uv initpyproject.toml, .python-version, and a basic hello.py.pyproject.toml:
Update metadata: name, version, description, authors, license.
Set requires-python: Ensure it matches the project's target environment (e.g., >=3.10).
Example Structure:
[project]
name = "my-mlops-project"
version = "0.1.0"
description = "A robust MLOps project."
readme = "README.md"
requires-python = ">=3.11"
license = { file = "LICENSE" }
authors = [{ name = "Your Name", email = "[email protected]" }]
dependencies = [
"pandas>=2.2.0",
"loguru>=0.7.0",
# Add other runtime dependencies here
]
[project.urls]
Repository = "https://github.com/username/my-mlops-project"
Documentation = "https://username.github.io/my-mlops-project"
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"ruff>=0.3.0",
"mypy>=1.9.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Establish a clean separation between production and development dependencies.
uv add <package> for libraries needed in production (e.g., fastapi, numpy, torch).[project.dependencies] in pyproject.toml.uv add --dev <package> (or --group dev) for tools like pytest, ruff, pre-commit.[project.optional-dependencies] and are kept separate from production builds.uv sync to resolve dependencies, create the .venv, and generate the uv.lock file.uv.lock file pins exact versions of all dependencies (including transitive ones). It ensures that every developer and CI/CD pipeline uses the exact same environment, preventing "it works on my machine" issues. Commit this file to git.Set up a clean repository and ensure unwanted files are ignored.
git initgit branch -M main.gitignore:
.gitignore tailored for Python/MLOps..venv/, .env__pycache__/, .pytest_cache/, .ruff_cache/, .mypy_cache/dist/, build/, *.egg-info/data/, models/, outputs/ (unless using DVC/LFS).vscode/ (selectively), .idea/, .DS_Store.vscode/settings.json but ignore User settings.git status should show only source files, config files, and the lockfile.Standardize the developer experience (DX) by committing project-specific settings.
ms-python.python, headers.ruff, ms-python.vscode-pylance, ms-toolsai.jupyter.eamodio.gitlens, alefragnani.project-manager, usernamehw.errorlens..vscode Directory:
mkdir .vscodesettings.json:
Configure settings to enforce code quality and use the uv environment.
Key Settings:
{
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"python.defaultInterpreterPath": ".venv/bin/python",
"python.terminal.activateEnvironment": true,
"python.analysis.typeCheckingMode": "basic",
"python.testing.pytestEnabled": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.rulers": [88],
"files.exclude": {
"**/__pycache__": true,
"**/.pytest_cache": true,
"**/.ruff_cache": true,
"**/.venv": true
}
}
Finalize the initialization.
uv run python -c "import sys; print(sys.executable)" to confirm it uses the .venv.git add .git commit -m "chore: initialize project with uv, git, and vscode settings"uv sync should be the only command needed to set up the environment.uv.lock to ensure all environments are identical..vscode/settings.json reduces onboarding friction and enforces standards (formatting, linting).dev.uv.lock exist?.venv/ created and ignored in .gitignore?pyproject.toml validly describe the project?git clone and uv sync to get the exact same state?development
Guide to implement rigorous validation layers including static analysis, automated testing, structured logging, and security scanning.
testing
Guide to create structured, reproducible Jupyter notebooks for MLOps prototyping, emphasizing configuration management and pipeline integrity.
testing
Guide to implement full stack observability including reproducibility, lineage, monitoring, alerting, and explainability.
development
Guide to transform prototypes into robust, distributable Python packages using the src layout, hybrid paradigm, and strict configuration management.