feature-engineering
Skill0 starsChanged 28 days agoMITView on GitHub
Builds leak-free predictive features for NFL games and players: rolling EPA, opponent-adjusted rates, rest and travel, quarterback changes, Elo, and market-derived inputs. Use when user asks to build features, wants rolling averages, asks what to feed a model, asks about data leakage, or has a model that looks too good. Do not use for model training, evaluation or calibration, see walk-forward-validation and probability-calibration. Do not use for a single descriptive stat, see epa-analysis.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- SSameer20/data-analyst-toolkittheir own version, first seen Nov 8, 2026
- Lu1sDV/skillsmdtheir own version, first seen Nov 4, 2026
- Harrypatria/data-mining-mltheir own version, first seen Nov 1, 2026
- noahowsh/birdieapi-mcptheir own version, first seen Oct 25, 2026
- berriosb/data-analytics-agentstheir own version, first seen Oct 20, 2026
- PuckAPI/claude-sports-analyticstheir own version, first seen Oct 14, 2026
Used with
Projects with it also use mean-reversion and position-sizing.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
agiprolabsSkillmean-reversion
Mean-reversion strategy tools including Hurst exponent, half-life estimation, z-score signals, ADF testing, and Ornstein-Uhlenbeck modeling
Also in 3 projects that use this
Bhala-SrinivashSkillposition-sizing
Calculate optimal position sizes for NSE/BSE equity trades using fixed fractional, ATR-based, and Kelly criterion methods. Includes portfolio constraints and leverage adjustments.
Also in 3 projects that use this
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- skforecast/skforecast★ 1.5ksame name
- agiprolabs/claude-trading-skills★ 366same name
- brainbytes-dev/everything-claude-trading★ 16same name
- SSameer20/data-analyst-toolkit★ 4same name
- PuckAPI/claude-sports-analytics★ 3same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- gmanch94/claude-code-aidlc-template★ 2same name
- Harrypatria/data-mining-ml★ 2same name
- Lu1sDV/skillsmd★ 2same name
- noahowsh/acesapi-mcp★ 1same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- backtestingSkill
- college-footballSkill
- dispatchSkill
- edge-detectionSkill
- endzoneapi-toolSkill
- epa-analysisSkill
- game-lookupSkill
- game-previewSkill
- next-gen-statsSkill
- odds-analysisSkill
- odds-explorerSkill
- player-scoutingSkill
- probability-calibrationSkill
- prop-modelingSkill
- walk-forward-validationSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 106
Keep push rows in a separate column rather than dropping or mislabeling them.
“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Feature Engineering
Default data tool: EndzoneAPI (
endzoneapi-tool).get_games(5 credits) gives a whole season of results, rest days, starting QBs and consensus lines.get_team_stats(5 credits per team-season) gives weekly team lines with EPA.get_plays(10 credits per page) gives play-level data when you need your own aggregation. For your own CSV: skip the tools, no credits used.
You are an expert in turning football data into model inputs without letting the future into the past. Your goal is a feature table where every row uses only information available before kickoff of that game.
When to Use
- "What features should I use to predict NFL games?"
- "Build rolling EPA for each team"
- "My model hits 70% against the spread, is that real?"
- "How do I handle the quarterback changing?"
- "How do I use the closing line as a feature?"
When NOT to Use
- Fitting and tuning a model, evaluating by time, see
walk-forward-validation - Checking probabilities, see
probability-calibration - Just exploring a team, see
epa-analysis
Commands Available
| Command | Feature Use | Credits |
get_games | Target (result, total), rest, QBs, line, div_game, roof, surface | 5 per query |
get_team_stats | Weekly team lines in weeks[] (passing EPA, rushing EPA, sacks, penalties, kicking) | 5 per team-season |
get_plays | Play-level EPA, success, CPOE, down, distance, win probability, charting | 10 per page |
get_injuries | Out/doubtful flags by week (2009+) | 2 |
get_snap_counts | Usage and availability | 5 |
get_advanced_stats | Tracking and pressure by week | 5 |
get_odds | Opening line vs closing line, per book (2020+) | 10 per game |
Commands That Do NOT Exist
| Not Available | Use Instead |
get_features | Build from the calls above |
get_power_ratings | Compute your own Elo from get_games results |
get_strength_of_schedule | Derive from opponents' rolling rates |
get_travel_distance | Use list_teams for division and your own stadium table |
The One Rule: Information Cutoff
For a game at week W of season S, a feature may use only games with kickoff earlier than this game's kickoff, in a strictly earlier week. In pandas, sort by team and date, compute the statistic, then shift(1).
g = team_weeks.sort_values(["team", "season", "week"]).copy()
g["epa_l5"] = (g.groupby(["team"])["epa_per_play"]
.transform(lambda s: s.shift(1).rolling(5, min_periods=3).mean()))Forgetting shift(1) includes the game being predicted in its own feature. That is the most common reason a model beats the market in testing and fails in use.
Feature Families
1. Team efficiency (rolling). Offensive and defensive EPA per play, pass and run separately, early-down success rate. Windows of 5 and 10 games plus an expanding season mean. An NFL season has 17 games, so a 10 game window spans over half of it; shrink toward last season or league mean early (see Shrinkage).
2. Opponent adjustment. A rolling mean is biased by who the team played. A simple fix: subtract the opponent's rolling defensive EPA allowed relative to league average, or fit a ridge regression of game EPA on offense and defense dummies using only prior games. Adjustment on 5 games is noise; use 8 or more or shrink.
3. Quarterback. The starting QB is the largest single driver. get_games returns away_qb_name and home_qb_name. Build features at the QB level (rolling EPA per dropback of the starter, with a prior for rookies and a backup's prior for an unknown) rather than only team level. Flag a QB change from the prior week.
4. Situation. home_rest, away_rest, rest difference, Thursday game, bye last week, div_game, roof, surface, game temperature when present (get_game_detail for weather detail). Treat missing weather as missing, not zero.
5. Ratings. Elo from results: start every team at 1500, update with margin of victory, revert part of the way to the mean each offseason.
expected_home = 1 / (1 + 10 ** (-(elo_home - elo_away + home_adv) / 400))
elo_home += K * mov_mult * (actual_home - expected_home)Tune K, home_adv and the offseason carryover (typically keep two thirds to three quarters, verify on your data) by walk-forward validation, not by eye.
6. Market features. The closing spread is the best single predictor of the margin in public data. Whether to include it depends on the question. A model that is allowed to see the closing line is a model of residuals; it can only tell you where the market is wrong, which is the right framing for betting but not for "predict the game". Never use a closing line as a feature for a bet placed before it exists. Use the opening line if you simulate betting earlier in the week (per-book opening is available 2020 onward).
7. Availability. Starters out (QB, left tackle, top two receivers, top pass rusher) from get_injuries. Injury reports are published during the week, so only use reports dated before your decision time.
Shrinkage and Small Samples
Early-season rolling stats are mostly noise. A standard fix is a weighted blend of prior-season rate and current rate:
rate = (n * current + k * prior) / (n + k)with n games played and k a prior weight (start near 6 to 10 games for EPA, tune it in validation). Regress the prior toward the league mean as well; rosters change.
Targets
| Target | Definition | Note |
| Margin | result (home minus away) | Regression, then convert to a win probability |
| Cover | result > spread_line | Pushes need handling; 3 and 7 are common margins |
| Total | total > total_line | Weather and pace features matter |
| Residual | result - spread_line | Needs the line known before the bet |
Keep push rows in a separate column rather than dropping or mislabeling them.
Leakage Checklist
| Leak | How It Hides |
| Game's own stats in its rolling feature | Missing shift(1) |
| Final season stats used for in-season rows | get_team_stats season totals include later weeks. Use weeks[] instead |
| Closing line as input for an earlier bet | Closing is the last pre-kickoff snapshot |
| Season-end Elo or rankings applied to earlier weeks | Recompute by week |
| Injury status taken after the game | Date-stamp reports |
| Random train/test split | Time order is the point, see walk-forward-validation |
| Same game appearing from both team views in train and test | Split by game, not by team-week |
Credit Usage
| Operation | Credits |
| One season of games and lines | 5 |
| All 32 teams, one season of weekly team lines | 160 |
| One season of plays for one team (about 1,100 plays, paged) | 10 to 20 |
| Whole-league plays for a season | thousands, plan before pulling |
Cheapest useful set: get_games for 5 or 6 seasons (25 to 30 credits) gives results, rest, QBs and consensus lines for a first model.
Anti-patterns
| Rationalization | Why It's Wrong | Do This Instead |
| "More features will help" | 272 regular season games a year, few hundred per many windows | Start under 15 features and add one family at a time |
"Use season totals from get_team_stats" | They include games after the one you predict | Use weeks[] with a cutoff |
| "Drop pushes" | Skews the cover rate | Keep them as a third class |
| "Fill missing weather with 0" | Indoor and missing are different | Use a missing flag |
| "Last year's EPA predicts this year" | Only partially, QB and rosters change | Blend with shrinkage |
Output Format
Feature table: one row per game, keys (season, week, game_id)
Columns: home/away rolling EPA (5, 10), pass/run split, QB flag,
rest, Elo diff, line (opening only if betting early)
Cutoff rule: all inputs from games before kickoff, shift(1) applied
Rows: N games, seasons YYYY-YYYY, missing handled by [rule]What to Do Next
| What You Built | Next Action | Skill |
| A feature table | Evaluate by time | walk-forward-validation |
| Probabilities | Check calibration | probability-calibration |
| A model beating the line | Test against closing odds | backtesting |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

