
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@new-code/spec-forecasting
Advanced tools
BMAD module for rigorous time series forecasting specification - prevents MAPE disasters and enforces forecasting discipline through AI agents
BMAD Module Code: ts-forecast-spec
Version: 1.0.0-alpha.1
Status: 🎉 Phase 1 Complete - Production Ready
Author: Philippe Béliveau (Newcode)
License: MIT
# Install globally
npm install -g @new-code/spec-forecasting
# Or use with npx (no installation)
npx @new-code/spec-forecasting
# Or install in your BMAD project
cd your-bmad-project
npm install @new-code/spec-forecasting
👉 Installation Guide - Full installation instructions 👉 Quick Start Guide - Get started in 5 minutes 👉 Roadmap - See what's built and what's coming
TL;DR Installation:
ts-forecast-spec to bmad/_cfg/manifest.yamlbmad/_cfg/agent-manifest.csvbmad business-context-architectSee _module-installer/MANUAL_INSTALL.md for step-by-step instructions.
Prevent forecasting failures by forcing rigorous problem specification BEFORE any modeling begins.
Most forecasting projects fail not because of bad models, but because teams skip fundamental diagnostic questions and specification steps. This BMAD module provides a framework of specialized AI agents that act as "blocking gatekeepers" — refusing to let you proceed until critical diagnostics are addressed.
Core Philosophy:
"Most forecasting failures stem from specification problems, not model problems." — Inspired by Valeriy Manokhin's "5% models, 95% everything else"
Real Corporate Failure (Valeriy Manokhin's Case Study):
Two forecasting projects at a large corporation optimized for MAPE (Mean Absolute Percentage Error) without understanding its destructiveness for their data. The result:
The Problem: MAPE explodes when actual values are near zero (division by small numbers). The models optimized to avoid zeros, not to make good business decisions.
This module prevents this exact disaster — and many others like it.
Phase 1 is complete and production-ready. The following components are fully implemented and tested:
agents/business-context-architect.mdbmad business-context-architectagents/metrics-guardian.mdbmad metrics-guardianagents/data-diagnostician.mdbmad data-diagnostician1. Problem Specification ✅
Lead: Business Context Architect (Elena)
Output: 790-line Problem Specification Document with business context, stakeholders, cost asymmetry, viability
Path: workflows/problem-specification/
2. Metric Selection ✅
Lead: Metrics Guardian (Marcus)
Output: Metric Justification Document with primary metric, supporting metrics, avoided metrics
Path: workflows/metric-selection/
All 4 core tasks are fully implemented:
tasks/conformal-prediction-validator.xmltasks/calibration-monitor.xmltasks/uncertainty-diagnostics.xmltasks/antipattern-detector.xmlThe following components are planned for future releases (see ROADMAP.md):
Tasks are reusable diagnostic utilities that agents invoke. All 4 tasks are fully implemented.
See QUICKSTART.md for a complete 5-minute getting started guide.
Full Instructions: INSTALL.md
Quick Install:
bmad/_cfg/manifest.yaml - add ts-forecast-spec to modules listbmad/_cfg/agent-manifest.csv - add 3 agent entries (see _module-installer/MANUAL_INSTALL.md)bmad business-context-architectScenario: You need to forecast daily sales for inventory planning
# Step 1: Activate Business Context Architect
bmad business-context-architect
# Step 2: Select Problem Specification Workflow
> 1 # or type: problem-spec
# Step 3: Answer Elena's diagnostic questions
Elena will guide you through:
- What decision does this forecast drive?
- Who makes the decision?
- What happens if forecast is wrong?
- Cost asymmetry analysis (over vs under-forecast)
- Stakeholder mapping
- Viability checks
# Output: Problem Specification Document (790 lines)
# Saved to: output/forecasting/problems/problem-specification-{date}.md
# Activate Metrics Guardian
bmad metrics-guardian
# Quick MAPE disaster check
> 2 # or type: mape-check
# Marcus will ask about near-zero values
# If detected: 🚨 CRITICAL WARNING - MAPE is BLOCKED
# Recommendation: Switch to MAE or sMAPE
# Full metric selection workflow
> 1 # or type: metric-selection
# Output: Metric Justification Document
# Includes: Primary metric, supporting metrics, avoided metrics
# Activate Data Diagnostician
bmad data-diagnostician
# Check stationarity
> 1 # or type: stationarity
# Dr. Sarah Chen will guide you through:
# - ADF and KPSS test interpretation
# - Differencing recommendations
# - Implications for model selection
# Other options:
> 2 # Decomposition (trend, seasonality)
> 3 # ACF/PACF analysis
> 4 # Missing data classification
> 5 # Signal-to-noise analysis
Symptom: Optimizing MAPE with near-zero values Prevention: Antipattern Detector + Metrics Guardian block MAPE usage with zeros Outcome: Billion-dollar client loss avoided
Symptom: Point forecasts without uncertainty for high-stakes decisions Prevention: Metrics Guardian mandates prediction intervals Outcome: Risk-aware decision making, contingency planning enabled
Symptom: Random train/test split on time series (future trains the model) Prevention: Antipattern Detector catches temporal violations Outcome: Valid performance metrics, production success
Symptom: Synthetic oversampling destroys conformal prediction guarantees Prevention: Antipattern Detector blocks SMOTE + CP combination Outcome: Mathematically valid prediction intervals
Symptom: ARIMA on trending data without differencing (spurious regression) Prevention: Data Diagnostician mandates stationarity tests Outcome: Reliable statistical forecasts
Symptom: Symmetric metrics (RMSE) with asymmetric costs (stockout ≠ overstock) Prevention: Metrics Guardian forces business cost function alignment Outcome: Optimized for real business decisions, not academic metrics
This module is built on the rigorous forecasting methodology of Valeriy Manokhin (PhD Machine Learning, "Black Belt 🥋 in Time Series"):
Key Insights:
Referenced Works:
Real-World Context from:
Newcode Philosophy:
"If you learn to ask the right question, then you can build anything with AI agents."
bmad/ts-forecast-spec/
├── agents/ # ✅ 3/7 agents (Phase 1 complete)
│ ├── business-context-architect.md # ✅ Elena 🎯
│ ├── metrics-guardian.md # ✅ Marcus 🛡️
│ ├── data-diagnostician.md # ✅ Dr. Sarah Chen 🔬
│ ├── signal-architect.md # 📋 Phase 2
│ ├── missing-data-specialist.md # 📋 Phase 2
│ ├── method-advisor.md # 📋 Phase 2
│ └── validation-strategist.md # 📋 Phase 2
│
├── workflows/ # ✅ 2/6 workflows (Phase 1 complete)
│ ├── problem-specification/ # ✅ Full workflow
│ │ ├── workflow.yaml
│ │ ├── instructions.md
│ │ ├── template.md
│ │ └── checklist.md
│ ├── metric-selection/ # ✅ Full workflow
│ │ ├── workflow.yaml
│ │ ├── instructions.md
│ │ ├── template.md
│ │ └── checklist.md
│ ├── data-diagnostics/ # 📋 Phase 2
│ ├── signal-design/ # 📋 Phase 2
│ ├── model-selection/ # 📋 Phase 2
│ └── validation-deployment/ # 📋 Phase 2
│
├── tasks/ # ✅ 4/4 core tasks (ALL IMPLEMENTED)
│ ├── conformal-prediction-validator.xml
│ ├── calibration-monitor.xml
│ ├── uncertainty-diagnostics.xml
│ └── antipattern-detector.xml
│
├── _module-installer/ # ✅ Installation infrastructure
│ ├── install.py # Python installer
│ ├── install.sh # Shell installer
│ ├── MANUAL_INSTALL.md # Manual installation guide
│ └── README.md
│
├── config.yaml # ✅ Module configuration
├── README.md # ✅ This file
├── INSTALL.md # ✅ Full installation guide
├── QUICKSTART.md # ✅ 5-minute getting started
└── ROADMAP.md # ✅ Development roadmap
Delivered:
Total Delivered: ~7,500 lines of code and documentation
See ROADMAP.md for detailed plans:
Phase 2: Diagnostic Infrastructure (2-3 weeks)
Phase 3: Complete Framework (2-4 weeks)
| Document | Description |
|---|---|
| README.md | This file - Module overview and architecture |
| INSTALL.md | Complete installation guide with troubleshooting |
| QUICKSTART.md | 5-minute getting started guide with examples |
| ROADMAP.md | Development roadmap and phase planning |
| config.yaml | Module configuration file |
| Document | Description |
|---|---|
| _module-installer/MANUAL_INSTALL.md | Step-by-step manual installation (recommended) |
| _module-installer/README.md | Installer directory overview |
| _module-installer/install.py | Automated Python installer |
| Agent | File | Description |
|---|---|---|
| Elena 🎯 | agents/business-context-architect.md | Problem framing specialist |
| Marcus 🛡️ | agents/metrics-guardian.md | Metric selection expert |
| Dr. Sarah Chen 🔬 | agents/data-diagnostician.md | Data diagnostics specialist |
| Workflow | Path | Description |
|---|---|---|
| Problem Specification | workflows/problem-specification/ | Business context and viability |
| Metric Selection | workflows/metric-selection/ | Metric justification and selection |
Each workflow directory contains:
workflow.yaml - Configurationinstructions.md - Execution logictemplate.md - Output templatechecklist.md - Validation checklist| Task | File | Purpose |
|---|---|---|
| Antipattern Detector | tasks/antipattern-detector.xml | Detect forecasting antipatterns |
| Calibration Monitor | tasks/calibration-monitor.xml | Monitor probabilistic calibration |
| Conformal Prediction Validator | tasks/conformal-prediction-validator.xml | Validate CP coverage |
| Uncertainty Diagnostics | tasks/uncertainty-diagnostics.xml | Decompose uncertainty types |
Start Here: QUICKSTART.md Get up and running in 5 minutes with example scenarios
Deep Dive: Explore agent files
Workflow Details: Read workflow instructions
Valeriy Manokhin's Books:
LinkedIn: Follow Valeriy Manokhin for case studies and methodology insights
Classic Textbook:
Current Status: Module in active development by Philippe Béliveau.
Future Collaboration:
MIT License
Copyright (c) 2025 Philippe Béliveau / Newcode
Philippe Béliveau Co-Founder, Newcode Montréal, Quebec, Canada
Newcode Philosophy: "If you learn to ask the right question, then you can build anything with AI agents"
Built with BMAD V6 Module Builder Making AI agents work together to solve hard problems
FAQs
BMAD module for rigorous time series forecasting specification - prevents MAPE disasters and enforces forecasting discipline through AI agents
We found that @new-code/spec-forecasting demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.