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

--- name: mlops-prototyping-cn version: 1.0.0 description: Structured Jupyter notebook prototyping with pipeline integrity license: MIT --- # MLOps Prototyping 🔬 Create standardized, reproducible Jupyter notebooks. ## Features ### 1. Notebook Structure Check ✅ Validate notebook follows best practices: ```bash ./scripts/check-notebook.sh notebook.ipynb ``` Checks for: - H1 title - Imports section - Config/Constants - Data loading - Pipeline usage ### 2. Template 📝 Use this structure: 1. **Title & Purpose** 2. **Imports** (standard → third-party → local) 3. **Configs** (all constants at top) 4. **Datasets** (load, validate, split) 5. **Analysis** (EDA) 6. **Modeling** (use `sklearn.pipeline.Pipeline`) 7. **Evaluations** (metrics on test data) ## Quick Start ```bash # Check your notebook ./scripts/check-notebook.sh my-notebook.ipynb # Follow structure in notebook # Use Pipeline for all transforms # Set RANDOM_STATE everywhere ``` ## Key Rules ✅ **DO:** - Put all params in Config section - Use `sklearn.pipeline.Pipeline` - Split data BEFORE any transforms - Set `random_state` everywhere ❌ **DON'T:** - Magic numbers in code - Manual transforms (use Pipeline) - Fit on full dataset (data leakage) ## 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 notebook checker

path: package.json
content: {
  "name": "mlops-prototyping-cn",
  "version": "1.0.0",
  "description": "MLOps Prototyping - Structured Jupyter notebooks with pipeline integrity",
  "main": "SKILL.md",
  "scripts": {
    "check": "./scripts/check-notebook.sh"
  },
  "keywords": [
    "mlops",
    "jupyter",
    "notebook",
    "prototyping",
    "pipeline"
  ],
  "author": "money-maker-ai",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/MLOps-Courses/mlops-coding-skills"
  }
}


path: scripts/check-notebook.sh
content: #!/bin/bash
# Check notebook structure and best practices

NOTEBOOK="${1:-*.ipynb}"

echo "🔍 Checking notebook: $NOTEBOOK"

# Check if notebook exists
if [ ! -f "$NOTEBOOK" ]; then
    echo "❌ Notebook not found"
    exit 1
fi

# Check required sections
python3 << EOF
import json
import sys

with open("$NOTEBOOK") as f:
    nb = json.load(f)

cells = nb['cells']
markdown_cells = [c for c in cells if c['cell_type'] == 'markdown']
code_cells = [c for c in cells if c['cell_type'] == 'code']

# Check structure
checks = {
    'Title (H1)': False,
    'Imports': False,
    'Config/Constants': False,
    'Data Loading': False,
}

for cell in markdown_cells:
    text = ''.join(cell['source'])
    if text.startswith('# '):
        checks['Title (H1)'] = True
    if 'import' in text.lower():
        checks['Imports'] = True

for cell in code_cells:
    text = ''.join(cell['source'])
    if 'import' in text:
        checks['Imports'] = True
    if any(kw in text for kw in ['RANDOM_STATE', 'DATA_PATH', 'CONFIG']):
        checks['Config/Constants'] = True
    if any(kw in text for kw in ['read_csv', 'read_parquet', 'load']):
        checks['Data Loading'] = True

print("\n📊 Structure Check:")
for check, passed in checks.items():
    status = "✅" if passed else "❌"
    print(f"  {status} {check}")

# Check for anti-patterns
anti_patterns = {
    'Magic numbers in code': False,
    'Hardcoded paths': False,
}

for cell in code_cells[1:]:  # Skip first cell (usually imports)
    text = ''.join(cell['source'])
    # Simple heuristics
    if any(char.isdigit() for char in text) and 'RANDOM_STATE' not in text:
        anti_patterns['Magic numbers in code'] = True

print("\n⚠️  Anti-patterns:")
for pattern, found in anti_patterns.items():
    status = "❌" if found else "✅"
    print(f"  {status} {pattern}")

sys.exit(0 if all(checks.values()) else 1)
EOF

echo ""
echo "✅ Notebook check complete"


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