Skill: guohongbin-git/mlops-initialization-cn (version 1.0.0)

--- name: mlops-initialization-cn version: 1.0.0 description: MLOps project initialization with uv/git/VS Code best practices license: MIT --- # MLOps 项目初始化 🚀 Setup new MLOps projects with modern Python toolchain. ## Features ### 1. Project Initialization 📦 Create complete project structure: ```bash ./scripts/init-project.sh my-mlops-project ``` Creates: - `src/` layout - `pyproject.toml` with uv - `.gitignore` (Python/MLOps) - `.vscode/settings.json` - Git repository ### 2. Configuration Templates 📋 Copy reference configs: ```bash # pyproject.toml template cp references/pyproject.toml ../your-project/ # VS Code settings cp references/vscode-settings.json ../your-project/.vscode/ ``` ## Quick Start ```bash # Initialize new project ./scripts/init-project.sh my-project cd my-project # Add dependencies uv add pandas numpy scikit-learn # Sync environment uv sync # Verify uv run python -c "import sys; print(sys.executable)" ``` ## What You Get - ✅ `src/` package layout - ✅ Locked dependencies (`uv.lock`) - ✅ Ruff + MyPy configured - ✅ VS Code settings - ✅ Git repository ## References - `references/pyproject.toml` - Full config example - `references/vscode-settings.json` - IDE settings ## Author Converted from [MLOps Coding Course](https://github.com/MLOps-Courses/mlops-coding-skills) ## Changelog ### v1.0.0 (2026-02-18) - Initial OpenClaw conversion - Added init script - Added reference configs

path: README.md
content: # MLOps 项目初始化

Modern Python project setup using `uv` package manager.

## Features

- 📦 **Project Initialization** - Create complete project structure
- 📋 **Configuration Templates** - pyproject.toml, VS Code settings
- 🔧 **Git Setup** - .gitignore, initial commit
- ✅ **Validation** - Ensure environment correctness

## Quick Start

```bash
# Initialize new project
./scripts/init-project.sh my-mlops-project

# Add dependencies
uv add pandas numpy scikit-learn

# Sync environment
uv sync
```

## Author

Converted from [MLOps Coding Course](https://github.com/MLOps-Courses/mlops-coding-skills)

## License

MIT


path: package.json
content: {
  "name": "mlops-initialization-cn",
  "version": "1.0.0",
  "description": "MLOps Project Initialization - Setup with uv/git/VS Code best practices",
  "main": "SKILL.md",
  "scripts": {
    "init": "./scripts/init-project.sh"
  },
  "keywords": [
    "mlops",
    "python",
    "initialization",
    "uv",
    "git",
    "vscode"
  ],
  "author": "money-maker-ai",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/MLOps-Courses/mlops-coding-skills"
  }
}


path: references/pyproject.toml
content: # Example pyproject.toml for MLOps projects
# Copy and customize for your project

[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 = "[REDACTED_SECRET]" }
]
dependencies = [
    "pandas>=2.2.0",
    "loguru>=0.7.0",
    "pydantic>=2.0.0",
    # Add 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",
    "pytest-cov>=4.0.0",
    "ruff>=0.3.0",
    "mypy>=1.9.0",
    "pre-commit>=3.0.0",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

# Ruff configuration
[tool.ruff]
line-length = 88
target-version = "py311"

[tool.ruff.lint]
select = ["E", "F", "I", "N", "UP", "B", "C4", "SIM"]
ignore = ["E501"]

# MyPy configuration
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true

# Pytest configuration
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --cov=src --cov-report=term-missing"

# UV configuration
[tool.uv]
dev-dependencies = [
    "pytest>=8.0.0",
    "pytest-cov>=4.0.0",
    "ruff>=0.3.0",
    "mypy>=1.9.0",
    "pre-commit>=3.0.0",
]


path: references/vscode-settings.json
content: {
  "[python]": {
    "editor.defaultFormatter": "charliermarsh.ruff",
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.organizeImports": "explicit"
    }
  },
  "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
  "python.terminal.activateEnvironment": true,
  "python.analysis.typeCheckingMode": "basic",
  "python.testing.pytestEnabled": true,
  "python.testing.unittestEnabled": false,
  "files.trimTrailingWhitespace": true,
  "files.insertFinalNewline": true,
  "editor.rulers": [88],
  "editor.tabSize": 4,
  "files.exclude": {
    "**/__pycache__": true,
    "**/.pytest_cache": true,
    "**/.ruff_cache": true,
    "**/.mypy_cache": true,
    "**/.venv": true,
    "**/*.egg-info": true
  },
  "search.exclude": {
    "**/.venv": true,
    "**/node_modules": true
  },
  "extensions": {
    "recommendations": [
      "ms-python.python",
      "charliermarsh.ruff",
      "ms-python.vscode-pylance",
      "ms-toolsai.jupyter",
      "eamodio.gitlens"
    ]
  }
}


path: scripts/init-project.sh
content: #!/bin/bash
# Initialize a new MLOps project with uv/git/VS Code

set -e

PROJECT_NAME="${1:-my-mlops-project}"

echo "🚀 Initializing MLOps project: $PROJECT_NAME"

# Create directory
mkdir -p "$PROJECT_NAME"
cd "$PROJECT_NAME"

# Check tools
command -v uv >/dev/null 2>&1 || { echo "❌ uv not installed. Run: curl -LsSf https://astral.sh/uv/install.sh | sh"; exit 1; }
command -v git >/dev/null 2>&1 || { echo "❌ git not installed"; exit 1; }

# Initialize with uv
uv init

# Create src layout
mkdir -p "src/${PROJECT_NAME//-/_}"
touch "src/${PROJECT_NAME//-/_}/__init__.py"

# Create .gitignore
cat > .gitignore << 'EOF'
# Python
.venv/
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Testing
.pytest_cache/
.coverage
htmlcov/

# Linting
.ruff_cache/
.mypy_cache/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Environment
.env
.env.local

# Data & Models (use DVC/LFS if needed)
data/
models/
outputs/
*.pkl
*.joblib
*.h5
*.pt

# OS
.DS_Store
Thumbs.db
EOF

# Create VS Code settings
mkdir -p .vscode
cat > .vscode/settings.json << 'EOF'
{
  "[python]": {
    "editor.defaultFormatter": "charliermarsh.ruff",
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.organizeImports": "explicit"
    }
  },
  "python.defaultInterpreterPath": "${workspaceFolder}/.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
  }
}
EOF

# Initialize git
git init
git branch -M main
git add .
git commit -m "chore: initialize project with uv and vscode settings"

echo "✅ Project initialized!"
echo ""
echo "Next steps:"
echo "  cd $PROJECT_NAME"
echo "  uv add pandas loguru  # Add dependencies"
echo "  uv sync               # Create venv"
echo "  uv run python -c 'import sys; print(sys.executable)'  # Verify"


Security scan verdicts — ClawScan: clean | static analysis:  | VirusTotal: suspicious | SkillSpector: clean (LOW)