/nhl-data:nhl-totals-modelfrom PuckAPI: hockey skills
Builds a calibrated total-goals distribution for NHL games and compares it to the market total. Use for over/under predictions, scoring pace analysis, and goalie matchup effects on total goals.
Ships in PuckAPI: hockey skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Data: the PuckAPI MCP server (
nhl-puckapi-tools). Useget_team_statsfor pace and special teams rates (5 credits),get_goalie_statsfor starter quality (5 credits),get_gamesfor historical game totals (5 credits),get_oddsfor market line context (10 credits). For the user's own CSV/JSON, work with the file directly.
You are an expert in hockey over/under prediction. Your goal is to build a calibrated totals model that estimates the probability distribution of total goals in an NHL game, then compare it to the market total to show how our probability differs from the market probability. Odds are information only: no stake sizing, no advice to wager.
model-buildingmodel-building (totals and spreads share some features but are separate models)nhl-player-props-researchnhl-odds-explorerget_team_stats| Command | What It Does | Credits |
|---|---|---|
get_games | Historical game results with total goals scored | 5 |
get_team_stats | Shots per 60, scoring rate, PP%, PK% | 5 |
get_goalie_stats | Starter SV%, GAA, GSAA, recent form | 5 |
get_standings | Win/loss records for SOS context | 2 |
get_odds | Market total line and prices (information only) | 10 |
get_game_probabilities | Market implied and fair (no-margin) probability for a game | 5 |
get_head_to_head | Historical scoring in prior matchups | 10 |
| Not Available | Use Instead |
|---|---|
get_game_totals | Use get_games and sum home + away goals |
get_pace_stats | Compute from get_team_stats (shots per 60 is a pace proxy) |
get_scoring_environment | Compute from get_games rolling averages per team |
get_goalie_starter | Use get_goalie_stats: most recent starter inference from recent start dates |
get_venue_stats | Not available; compute home-game averages from get_games filtered by location |
PuckAPI MCP server: Pull get_games for historical game log with total goals. Pull get_team_stats for pace and special teams. Pull get_goalie_stats for both starting goalies.
Your own data: If user provides CSV/JSON:
game_date, home_team, away_team, home_goals, away_goals (to compute total), home_starter_sv_pct, away_starter_sv_pct, home_shots_per_60, away_shots_per_60, home_pp_pct, away_pp_pct, home_pk_pct, away_pk_pctBefore building, establish:
get_game_probabilities, or one book from get_odds)A team can win 1-0 or win 7-5. The moneyline model doesn't care which. The totals model cares about nothing else. Different features, different calibration, different market dynamics.
Key differences from moneyline:
df['total_goals'] = df['home_goals'] + df['away_goals']
# For binary over/under at line L
df['over_5_5'] = (df['total_goals'] > 5.5).astype(int) # over = 1
df['over_6_0'] = (df['total_goals'] > 6.0).astype(int)
Build both a regression target (total goals) and binary classification targets (over/under at each line). They inform each other during validation.
Pull get_team_stats for both teams. Apply .shift(1) before any rolling calculation.
Shots per 60 (both teams combined):
df['total_shots_per_60'] = df['home_shots_per_60_roll10'] + df['away_shots_per_60_roll10']
Higher combined shots per 60 = higher expected total. This is the primary pace driver.
Scoring chances per 60: If available, prefer scoring chances over raw shots. Scoring chances are more predictive of goals than shot counts.
Goals per game rolling average (lagged):
df['home_gf_roll10'] = home_goals shifted and rolled over 10 games
df['away_ga_roll10'] = away_goals_against shifted and rolled over 10 games
df['expected_total_simple'] = df['home_gf_roll10'] + df['away_ga_roll10']
# also compute: away_gf_roll10 + home_ga_roll10
PP% for both teams + PK% for both teams. These interact:
# Net PP effect on scoring rate
df['home_pp_gap'] = df['home_pp_pct_roll10'] - df['away_pk_pct_roll10']
df['away_pp_gap'] = df['away_pp_pct_roll10'] - df['home_pk_pct_roll10']
df['combined_pp_quality'] = df['home_pp_gap'] + df['away_pp_gap']
Power play opportunities per game (not just conversion rate): a team that draws more penalties gives more scoring chances regardless of PP%.
This is the highest-leverage feature group. Goalie quality variance accounts for a larger share of total goals prediction than any other single input.
# Season SV% (lagged to current game)
df['home_starter_sv_pct'] = home_goalie_sv_pct_prior_to_game
df['away_starter_sv_pct'] = away_goalie_sv_pct_prior_to_game
# Combined goalie quality (lower = more goals expected)
df['combined_goalie_quality'] = df['home_starter_sv_pct'] + df['away_starter_sv_pct']
# Recent form (last 5 starts, by start date)
df['home_starter_sv_pct_l5'] = rolling SV% over last 5 starts for starter
df['away_starter_sv_pct_l5'] = same for away starter
# Confirmed starter flag (known before game time)
df['home_starter_confirmed'] = 1 if starter announced, 0 if uncertain
If starter is unconfirmed: Use team backup SV% as a downside scenario. Weight predictions toward higher-scoring outcomes when starter is uncertain.
Back-to-back effect:
df['home_b2b'] = (df['home_rest_days'] == 0).astype(int)
df['away_b2b'] = (df['away_rest_days'] == 0).astype(int)
df['either_b2b'] = ((df['home_b2b'] == 1) | (df['away_b2b'] == 1)).astype(int)
Back-to-back games increase total goals by approximately 0.2-0.4 goals. Tired defense and a fatigued backup goalie are the mechanisms.
Time of season:
df['games_into_season'] = game number (1-82) within the season
df['early_season'] = (df['games_into_season'] <= 20).astype(int)
Early-season games produce more goals: goalies aren't sharp, defensive systems aren't set. This effect diminishes after ~game 20.
Head-to-head scoring history: Use get_head_to_head for last 5 meetings. High-scoring rivalry vs defensive rivalry carries predictive signal, though it's weaker than pace and goalie matchup.
Use XGBoost or LightGBM. Regression target preferred over binary classification: regression gives you the full probability distribution.
from xgboost import XGBRegressor
model = XGBRegressor(
n_estimators=400,
max_depth=4,
learning_rate=0.04,
subsample=0.8,
colsample_bytree=0.8,
random_state=42
)
model.fit(X_train, y_train) # y_train = total_goals
To get over/under probabilities from the regression output, assume a Poisson or normal distribution around the predicted mean:
from scipy.stats import poisson
predicted_total = model.predict(X_game)[0]
prob_over_5_5 = 1 - poisson.cdf(5, mu=predicted_total) # P(goals >= 6)
Hypothesis to test, not assume: games with the total set at 5.5 may go under more often than the market-implied probability says. Its persistence varies by season, so test it in your data and report it by season:
line_55_games = df[abs(df['market_line'] - 5.5) < 0.1]
actual_over_rate = line_55_games['over_5_5'].mean()
implied_over_rate = 1 - line_55_games['implied_under_prob'].mean()
gap = actual_over_rate - implied_over_rate # negative = unders happened more than the market probability implied
Use the fair (no-margin) probability from get_game_probabilities for the implied rate. Report the sample size and an interval for each season. If the pattern holds across seasons in walk-forward validation, it is a real signal about the market. If it only shows up in-sample, it is noise.
Calibration check: Bin predicted probabilities into deciles. Check that games in the "60-70% over" bucket actually go over 60-70% of the time. Use isotonic regression or Platt scaling if calibration is off.
Use the walk-forward fold design in the backtesting skill. Train on seasons 1-N, test on season N+1. Never use k-fold on time series.
For totals, the key metric is RMSE on total goals and calibrated Brier score on over/under binary targets at each line (5, 5.5, 6, 6.5).
| Operation | Credits | Notes |
|---|---|---|
get_games per season | 5 | Full season game log |
get_team_stats per team | 5 | 32 teams = 160 credits |
get_goalie_stats per goalie | 5 | ~60 starters per season = 300 credits |
get_odds per game | 10 | Only needed for the market comparison |
| Full training dataset (3 seasons, no odds) | ~1,395 | Games + team stats + goalies |
| Adding odds for the market comparison (3 seasons) | ~3,936 | ~1,312 games/season * 10 |
get_games for totals, get_odds or get_game_probabilities for market figures).20252026 = 2025-26).| Rationalization | Why It's Wrong | Do This Instead |
|---|---|---|
| "I'll use the same features as my moneyline model" | Pace metrics matter here; team quality metrics matter there. Overlap exists but the feature importance ranking is different | Build totals features explicitly; validate feature importance separately |
| "Goalie data is annoying: I'll skip it" | Goalie matchup is the highest-leverage feature in totals prediction; skipping it caps your ceiling | Pull get_goalie_stats and derive starter feature even if it requires extra calls |
| "k-fold cross-validation is standard" | NHL game totals are time-series data; k-fold leaks future seasons into training | Walk-forward by season only |
| "Calibration doesn't matter for totals" | Miscalibrated totals probabilities produce a misleading model vs market gap | Calibrate separately from moneyline; binomial confidence intervals on each line |
| "One model handles all lines" | 5.0 vs 6.5 totals markets have different over rates and different patterns | Validate at each line separately; consider line-specific adjustments |
| "The 5.5 pattern is permanent" | Market patterns fade when prices adjust | Re-test every season; treat it as a signal with decay |
The totals model produces:
predicted_total_goals (float), prob_over_5 (float), prob_over_5_5 (float), prob_over_6 (float), prob_over_6_5 (float).| What You Found | Next Action | Skill |
|---|---|---|
| Totals model built, want to compare with the market | Model vs market gap | market-vs-model |
| Need better features: goalie data is weak | Pull and clean goalie starter data | feature-engineering |
| Want totals in the daily workflow | Add totals to the daily slate | nhl-daily-slate |
| Calibration is off | Recalibrate using isotonic regression | probability-calibration |
| Want to backtest the totals model | Score predictions by season with sample sizes and intervals | backtesting |
| Suspect under bias is real: want to validate | Test the pattern in walk-forward | backtesting |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub sports-data-hq/sportsdatahq-skills --plugin nhl-data15 skills in this plugin
/nhl-advanced-statsUse when the user asks what a hockey advanced stat means or how to read it, in fan or analyst wording: 'what is PDO', 'explain Corsi', 'what does high danger mean', 'what is Fenwick', 'how do I read RAPM', 'what does zone entry data tell you', 'what is the difference between xG and Corsi', 'what is a good Corsi percentage', 'how stable is shooting percentage'. Use this whenever a metric name, its definition or how to interpret a number comes up. Load it for short fragments and follow-ups too, instead of answering from memory or going straight to the raw tools. Explains the metric, its limits and what it tells you, and pulls real numbers with sample sizes when asked. Not for whether a team is lucky or deserved a result, or got outshot but won (see nhl-xg-report), building an xG model (see nhl-xg-model), odds terms (see market-vs-model) or value decomposition (see nhl-war-gar)./nhl-daily-slateUse when the user wants every NHL game on a given day at once, in fan wording: 'what's on tonight', 'tonight's slate', 'anything interesting on the board', 'every game today', 'all the matchups tomorrow with win chances', 'sort today's games by the gap to the market', 'morning rundown'. Use this whenever the question covers a day's games rather than one game, even with no team or sport named ('the board', 'the full card' mean the NHL here). Load this skill first, before calling any data tool; it says which tools to call. Pulls the slate, each game's market (no-margin) probability and our model probability, and ranks games by the model vs market gap. Odds are information only: no stakes, picks or wagering advice. Not for one game in depth (use nhl-game-preview), a past score or plain schedule lookup (call get_games or get_schedule), one game's odds (use nhl-odds-explorer) or historical testing (use backtesting).Other plugins' skills for the same job