scaffold-ai-module

Bootstraps a complete Python AI module with FastAPI, PyTorch models, training scripts, and tests.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, scikit-learn, fastapi, uvicorn, pydantic, numpy, pandas, joblib, httpx, pytest, pytest-cov.

What problem does it solve? Setting up a new machine learning service from scratch involves repetitive boilerplate: folder structures, pinned dependencies, model classes, API endpoints, training scripts, and test files. This Skill automates the entire bootstrap of an AI inference module for battery State-of-Health prediction and anomaly detection in one orchestrated run. ## Core Features & Use Cases - Full Project Scaffolding: Creates the directory tree (api/, data/, models/, train/, tests/), pinned requirements.txt, pytest.ini, and .gitignore in one pass. - Orchestrated Sub-Skills: Sequentially invokes scaffold-model, scaffold-preprocessing, scaffold-training, scaffold-fastapi-endpoint, and scaffold-unit-tests to generate every source file. - Production-Ready Templates: Generates a FastAPI app with lifespan-based artifact loading (LSTM, Isolation Forest, MinMaxScaler), a /predict endpoint enforcing 30-timestep input windows, and a /health endpoint. - Use Case: When starting the AI module for the solar battery monitoring capstone, run this once to get a complete, importable, testable codebase ready for training on the NASA dataset. ## Quick Start Ask the AI to run /scaffold-ai-module in an empty repository to bootstrap the entire AI module structure with models, API, training scripts, and tests.

Frequently Asked Questions about scaffold-ai-module

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

FAQPage Schema
How do I scaffold a FastAPI machine learning project from scratch?▼

Run the scaffold-ai-module command once in an empty repository. It creates the folder structure, pinned requirements.txt, FastAPI app with lifespan artifact loading, a /predict endpoint, training scripts, and pytest test files in a single orchestrated pass.

How to serve a PyTorch LSTM model with FastAPI?▼

Load the model inside a FastAPI lifespan context manager and store it on app.state, then access it in routers via request.app.state. The generated template loads an LSTM, an Isolation Forest, and a MinMaxScaler at startup with existence assertions.

Can I run this scaffolding on a repository that already has code?▼

No, the skill is designed for empty modules only. It checks the repository state first and stops to ask for confirmation if source code already exists, since it assumes nothing has been created yet.

Why does the FastAPI predict endpoint return 422 errors?▼

The Pydantic schema enforces a minimum of 30 timesteps for voltage, current, and temperature arrays. Requests with fewer values fail validation; longer inputs are truncated to the last 30 timesteps by the field validator.

What are the limitations of this scaffolding approach?▼

It generates templates only, not trained models. You must place the NASA dataset CSV in data/raw/, run the training scripts to produce artifacts, and only then will the inference and API tests pass.