scaffold-model

Generates PyTorch CNN-LSTM or Isolation Forest model classes with versioned save and load methods.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, scikit-learn, joblib, numpy.

What problem does it solve? Setting up battery health prediction models from scratch is repetitive and error-prone, especially when every model must follow the same project conventions for versioning, serialization, and architecture. This Skill scaffolds a ready-to-use model class that matches the project's approved designs. ## Core Features & Use Cases - CNN-LSTM Template: Generates a PyTorch SOH predictor class taking (batch, 30, 3) telemetry windows of voltage, current, and temperature and outputting a State of Health percentage. - Isolation Forest Template: Generates a scikit-learn anomaly detector wrapper with fit, score, and classify methods mapping anomaly scores to Normal, Degrading, or Failed battery states. - Versioned Persistence: Both templates include save and load methods that embed version metadata and assert on version mismatch at load time, preventing silent inference errors. - Use Case: Run the scaffold with the argument SOHPredictor to create models/soh_predictor.py with the full CNN-LSTM architecture, or AnomalyDetector to create models/anomaly_detector.py with the Isolation Forest wrapper. ## Quick Start Ask the assistant to scaffold a new battery model named SOHPredictor or AnomalyDetector and it will create the corresponding Python file under the models directory.

Frequently Asked Questions about scaffold-model

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

FAQPage Schema
How do I create a PyTorch CNN-LSTM model for battery SOH prediction?▼

Run the scaffold with a name containing SOH, LSTM, CNN, or Predictor to generate a CNN-LSTM class. It accepts input tensors of shape (batch, 30, 3) covering voltage, current, and temperature, and outputs a State of Health percentage.

How do I build an Isolation Forest anomaly detector for battery data?▼

Use a model name containing Anomaly, Forest, Iso, or Detector to generate an Isolation Forest wrapper. It includes fit, score, and classify methods that map anomaly scores to Normal, Degrading, or Failed battery states.

How does model version checking work when saving and loading?▼

Both templates embed a version string in the saved artifact via torch.save or joblib.dump. The load method asserts the stored version matches the expected version, raising an error on mismatch so inference never runs against stale weights.

Can I add a new model architecture beyond CNN-LSTM and Isolation Forest?▼

No. The skill explicitly restricts scaffolding to these two approved architectures. Adding a third model type requires leader approval before creation, per the project engineering rules.

Why should Isolation Forest not be fitted on production data?▼

Fitting on production, validation, or test data contaminates the anomaly baseline and invalidates detection results. The fit method is intended for the training set only, and the wrapper tracks a fitted flag to prevent scoring before training.