scaffold-training

Generates PyTorch or Isolation Forest training scripts with fixed hyperparameters and versioned model artifacts.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/GSU26SE55/backend --skill scaffold-training-gsu26se55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scaffold-training
Source: https://github.com/GSU26SE55/backend/tree/main/.claude/skills/dev/ai/scaffold-training
Command: npx skills add https://github.com/GSU26SE55/backend --skill scaffold-training-gsu26se55

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, numpy.

What problem does it solve? Writing a new model training script from scratch is repetitive and error-prone: seeds get forgotten, early stopping is skipped, and artifacts are saved without version metadata. This Skill scaffolds a complete, convention-compliant training script for battery SOH prediction or anomaly detection in one step. ## Core Features & Use Cases - Automatic template selection: Picks the PyTorch template (Adam lr=1e-3, MSELoss, early stopping patience=10) for names like SOHPredictor, or the Isolation Forest template for names like AnomalyDetector. - Reproducibility built in: Sets seed=42 across random, numpy, and torch, and enforces a checklist covering hyperparameters, metric reporting, and data leakage rules. - Versioned artifacts: Saves model weights to models/weights with embedded version metadata, and prints MAE/RMSE with warnings when targets (MAE < 2%, RMSE < 3%) are missed. - Use Case: Run /scaffold-training SOHPredictor to get a ready-to-edit train/train_soh.py that loads preprocessed battery data, trains with early stopping, evaluates, and saves a versioned checkpoint. ## Quick Start Ask the assistant to scaffold a training script for your model, for example by saying: scaffold a training script for SOHPredictor.

Frequently Asked Questions about scaffold-training

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a PyTorch training script for SOH prediction?▼

Invoke the skill with a model name containing SOH, LSTM, CNN, or Predictor, such as /scaffold-training SOHPredictor. It generates train/train_soh.py with Adam lr=1e-3, MSELoss, early stopping patience=10, and seed=42 already configured.

How do I train an Isolation Forest anomaly detector in Python?▼

Use a model name containing Anomaly, Forest, Iso, or Detector, such as /scaffold-training AnomalyDetector. The generated script flattens the training windows, fits an Isolation Forest, and saves a versioned .pkl artifact to models/weights.

What hyperparameters does the SOH training template use?▼

The template fixes LR=1e-3 with the Adam optimizer, MSELoss, 50 epochs, batch size 32, and early stopping patience of 10. It reports train and validation MAE plus validation RMSE, warning when MAE exceeds 2% or RMSE exceeds 3%.

Does the training script use test data for validation?▼

No. The template explicitly forbids using X_test in the training loop or validation loss, and the checklist verifies this. Early stopping decisions rely only on the validation split returned by prepare_splits().

Why should the scaler not be refit inside the training script?▼

Refitting the scaler during training causes data leakage and inconsistent preprocessing. The template relies on prepare_splits() from data.preprocess to handle scaling, so the training script only consumes already-scaled arrays.