mlb-regression-flagger

Detects fantasy baseball players whose surface stats (wOBA, ERA, batting average) diverge from underlying Statcast quality metrics (xwOBA, FIP, xBA), and outputs a regression_index from -100 (very lucky; should be sold high) to +100 (very unlucky; should be bought low). This index is the primary signal for buy-low / sell-high decisions in trades and free-agent markets. Used when users mention buy-low, sell-high, regression candidates, lucky/unlucky, xwOBA gaps, ERA-FIP gaps, BABIP, impending mean reversion, or when deciding trades based on whether a player is overperforming/underperforming.

Last repository push
GitHub Stars
206
Forks
28
Issues / PRs
3

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "mlb-regression-flagger" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d341eee29763b0cd29c88eaa4f9ea374f343804df07a063de04f0d7802c2a3c3. Verify the upstream source and version against https://github.com/lyndonkl/claude before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Detects fantasy baseball players whose surface stats (wOBA, ERA, batting average) diverge from underlying Statcast quality metrics (xwOBA, FIP, xBA), and outputs a regression_index from -100 (very lucky; should be sold high) to +100 (very unlucky; should be bought low). This index is the primary signal for buy-low / sell-high decisions in trades and free-agent markets. Used when users mention buy-low, sell-high, regression candidates, lucky/unlucky, xwOBA gaps, ERA-FIP gaps, BABIP, impending mean reversion, or when deciding trades based on whether a player is overperforming/underperforming.

0 Downloads

Introduction source: third_party · lyndonkl · 0.0.1 Reference

SkillPi interpretation

Tasks
Identifies fantasy baseball players whose surface stats (wOBA, ERA, batting average) are diverging from their underlying Statcast quality (xwOBA, FIP, xBA) — emits a `regression_index` from -100 (very lucky, sell high) to +100 (very unlucky, buy low). Primary signal for buy-low/sell-high decisions on trades and waivers. Use when user mentions "buy low", "sell high", "regression candidate", "lucky", "unlucky", "xwOBA gap", "ERA-FIP gap", "BABIP", "due for regression", or is deciding whether to trade for / trade away a player based on over- or under-performance.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: mlb-regression-flagger
description: Identifies fantasy baseball players whose surface stats (wOBA, ERA, batting average) are diverging from their underlying Statcast quality (xwOBA, FIP, xBA) — emits a `regression_index` from -100 (very lucky, sell high) to +100 (very unlucky, buy low). Primary signal for buy-low/sell-high decisions on trades and waivers. Use when user mentions "buy low", "sell high", "regression candidate", "lucky", "unlucky", "xwOBA gap", "ERA-FIP gap", "BABIP", "due for regression", or is deciding whether to trade for / trade away a player based on over- or under-performance.

MLB Regression Flagger

Table of Contents

Example

Scenario: User asks "Is Junior Caminero a buy-low candidate or am I chasing noise?"

Raw data gathered from Baseball Savant + FanGraphs (cite URLs):

  • Caminero 2026 wOBA: .310 (actual results)
  • Caminero 2026 xwOBA: .380 (expected based on exit velocity + launch angle)
  • BABIP: .255 (well below .300 league mean)
  • Barrel %: 14.2% (elite, 90th percentile)
  • Hard-Hit %: 52% (elite)

Regression index calculation:

regression_index = (xwOBA - wOBA) x 500
                 = (.380 - .310) x 500
                 = +35

Secondary check — BABIP: .255 is below the .240 lower-outlier threshold for hitters only if we tighten further, but .255 plus elite contact quality confirms unlucky. Not a "will correct to .300" player, but unlikely to stay at .255 given the batted-ball profile.

Verdict: regression_index = +35 → BUY. Caminero has been unlucky; underlying contact quality is elite. Expect his surface stats to catch up over the next 30 days.

User-facing translation (per CLAUDE.md rule #5 — beginner writing):

"Junior Caminero's raw numbers look mediocre (.310 wOBA — that's a catch-all hitting stat), but the quality of his actual contact (how hard and at what angle he hits the ball) suggests he should be hitting .380. The gap is one of the biggest in the league. ADD if available, or OFFER a trade for him before his stats correct."

Signal file emission (per signal-framework.md):

---
type: regression
date: 2026-04-17
emitted_by: mlb-regression-flagger
player: Junior Caminero
regression_index: +35
direction: BUY
confidence: 0.78
source_urls:
  - https://baseballsavant.mlb.com/savant-player/junior-caminero-...
  - https://www.fangraphs.com/players/junior-caminero/...
---

Workflow

Copy this checklist and track progress:

Regression Flagger Progress:
- [ ] Step 1: Define the candidate list (who to check)
- [ ] Step 2: Web-search Savant for expected stats (xwOBA, xERA, xBA)
- [ ] Step 3: Web-search FanGraphs for surface stats (wOBA, ERA, BABIP, HR/FB)
- [ ] Step 4: Compute regression_index per player
- [ ] Step 5: Apply secondary flags (BABIP, HR/FB)
- [ ] Step 6: Emit signal file + user-facing translation

Step 1: Define the candidate list

Who are we checking? Three entry points:

  • [ ] User's current roster (for SELL candidates — anyone overperforming)
  • [ ] Free agents + waiver wire (for BUY candidates — anyone underperforming with elite underlying metrics)
  • [ ] Specific player asked about (e.g., trade target)

Step 2: Web-search Baseball Savant for expected stats

See resources/methodology.md for exact queries and URL patterns.

  • [ ] Hitters: xwOBA, xBA, xSLG, Barrel %, Hard-Hit %
  • [ ] Pitchers: xERA, Expected Batting Average against, Whiff %, Chase %
  • [ ] Record each URL in source_urls for the signal file

Step 3: Web-search FanGraphs for surface stats

See resources/methodology.md for query patterns.

  • [ ] Hitters: wOBA, BABIP, AVG, OBP, SLG
  • [ ] Pitchers: ERA, FIP, xFIP, HR/FB %, LOB %
  • [ ] Record each URL

Step 4: Compute regression_index

See resources/methodology.md for the formulas.

  • [ ] Hitter: regression_index = (xwOBA - wOBA) x 500, clamped to ±100
  • [ ] Pitcher: regression_index = (FIP - ERA) x 50, clamped to ±100
    • Note: for pitchers, a LARGER (more positive) FIP than ERA = pitcher has been lucky (negative signal for fantasy); a SMALLER FIP than ERA = pitcher has been unlucky (positive signal). See methodology for sign convention.
  • [ ] Populate resources/template.md with the result

Step 5: Apply secondary flags

  • [ ] Hitter BABIP check: flag if > .370 (unsustainably lucky) or < .240 (unsustainably unlucky)
  • [ ] Pitcher HR/FB check: flag if > 17% (unlucky, normalizes to ~12%) or < 8% (lucky)
  • [ ] Note: secondary flags reinforce or contradict the primary regression_index. When they agree, confidence goes up; when they disagree, confidence drops and the player goes into a "watchlist" bucket instead of an actionable BUY/SELL.

Step 6: Emit signal file + user-facing translation

  • [ ] Write signals/YYYY-MM-DD-regression.md with frontmatter per signal-framework.md
  • [ ] Translate every stat to plain English for the user (per CLAUDE.md rule #5)
  • [ ] End every recommendation with an action verb: BUY / SELL / HOLD / ADD / DROP (per CLAUDE.md rule #6)
  • [ ] Validate against resources/evaluators/rubric_mlb_regression_flagger.json. Target average ≥ 3.5.

Common Patterns

Pattern 1: The Elite-Contact, Bad-Luck Hitter (classic BUY)

  • Signals: xwOBA - wOBA ≥ +.050, Barrel % ≥ 90th percentile, BABIP ≤ .260
  • Typical profile: Young hitter with elite exit velocity whose line drives are finding gloves
  • Action: Aggressive BUY. Offer a trade for them before the market catches on. Bid FAAB if they are on waivers.
  • Example: Junior Caminero — xwOBA .380 vs wOBA .310, BABIP .255 → +35, BUY.

Pattern 2: The Lucky Journeyman (classic SELL)

  • Signals: wOBA - xwOBA ≥ +.050, Barrel % below median, BABIP ≥ .360
  • Typical profile: Career-average hitter riding a hot streak on soft contact
  • Action: SELL high. Try to trade them for a BUY-LOW target of real talent.
  • Example (hypothetical): Utility IF hitting .310 with a .360 BABIP and xwOBA .295 vs wOBA .340 → -22, SELL.

Pattern 3: The Pitcher-Lucky Starter (SELL)

  • Signals: ERA much lower than FIP (e.g., 2.50 ERA, 4.20 FIP), HR/FB < 8%, strand rate (LOB%) > 80%
  • Typical profile: Starter whose fly balls aren't leaving the park and whose inherited runners aren't scoring
  • Action: SELL while his ERA still looks shiny.
  • Regression_index example: (FIP - ERA) x 50 = (4.20 - 2.50) x 50 = +85. But for pitchers a large FIP-ERA gap means he has been LUCKY → flip sign → -85, SELL. See methodology for sign convention.

Pattern 4: The Pitcher-Unlucky Starter (BUY)

  • Signals: ERA well above FIP (e.g., 5.10 ERA, 3.40 FIP), HR/FB > 17%, LOB% < 68%
  • Typical profile: Good stuff, bad sequencing / BABIP luck
  • Action: BUY before the ERA corrects.

Pattern 5: Conflicting Signals (WATCHLIST, not actionable)

  • Signals: xwOBA-wOBA gap is large but Barrel % is below median, OR BABIP is extreme but contact quality confirms it
  • Action: Do NOT auto-flag BUY/SELL. Emit regression_index with reduced confidence (< 0.5) and place on watchlist for another week.

Guardrails

  1. Sample-size minimum: Do not emit a regression_index for a hitter with fewer than 80 PAs or a pitcher with fewer than 30 IP. Statcast expected stats are noisy below that. If below threshold, emit confidence: 0.3 and label too-early.

  2. Sign convention for pitchers: (FIP - ERA) x 50 gives a raw number. A POSITIVE raw number means ERA < FIP → the pitcher has been LUCKY → negate to produce a NEGATIVE regression_index (SELL signal). A NEGATIVE raw number means ERA > FIP → UNLUCKY → negate to POSITIVE (BUY). Always negate. See methodology for the worked example. Hitters use the raw sign directly.

  3. Clamp to ±100: Extreme xwOBA gaps (>.200) are almost always small-sample artifacts. Clamp hard. Do not report regression_index of +140.

  4. Park and platoon adjustments: xwOBA from Savant is park-neutral but does not adjust for platoon splits. For a LHH playing in a tough-for-lefties park (e.g., Oracle) with many LHP starts ahead, the regression may be slower than the index suggests. Note as a caveat; do not recompute.

  5. BABIP is secondary, not primary: A high BABIP alone is not a SELL signal if underlying contact quality is elite. Hitters with extreme exit velocity (e.g., Judge, Ohtani) sustain BABIPs above .340 for full seasons. Always cross-check BABIP against Hard-Hit % before flagging.

  6. HR/FB normalization for pitchers: League-average HR/FB is ~12%. Pitchers regress toward their career HR/FB, not league average. A flyball pitcher's "normal" HR/FB is 14%; a groundball pitcher's is 9%. Use career or 3-year average when available; fall back to 12% only if no history.

  7. Web-search every fact (per CLAUDE.md): Every number that enters the formula must come from a live web search with the URL recorded in source_urls:. Never fill in from memory or training data. If a search fails, degrade to confidence: 0.3 and flag in the red-team pass.

  8. Translate for the beginner: The user has zero baseball knowledge. Every user-facing sentence that uses "xwOBA", "FIP", "BABIP" must include an inline translation on first use. See CLAUDE.md rule #5 and the Example above.

Quick Reference

Core formulas:

HITTER:  regression_index = clamp((xwOBA - wOBA) x 500, -100, +100)
         positive = UNLUCKY (BUY); negative = LUCKY (SELL)

PITCHER: raw = (FIP - ERA) x 50
         regression_index = clamp(-raw, -100, +100)
         positive = UNLUCKY (BUY); negative = LUCKY (SELL)

SECONDARY (hitter):  BABIP > .370 → lucky flag; BABIP < .240 → unlucky flag
SECONDARY (pitcher): HR/FB < 8% → lucky flag; HR/FB > 17% → unlucky flag

Action thresholds:

regression_index Direction Fantasy action
≥ +30 Very unlucky Aggressive BUY / ADD / high FAAB bid
+15 to +29 Mildly unlucky BUY if available cheaply
-14 to +14 Noise HOLD / no action
-29 to -15 Mildly lucky SELL if offered market-rate
≤ -30 Very lucky Aggressive SELL / DROP / decline offers

Data source map (per data-sources.md):

Stat Primary source URL pattern
xwOBA, xBA, xSLG, Barrel %, Hard-Hit % Baseball Savant https://baseballsavant.mlb.com/savant-player/{slug}-{id}
wOBA, BABIP (hitter) FanGraphs https://www.fangraphs.com/players/{slug}/{id}
ERA, FIP, xFIP, HR/FB, LOB% FanGraphs same
xERA Baseball Savant same

Key resources:

Inputs required:

  • Player name(s) or "scan roster" / "scan waivers"
  • League context: weeks remaining, category needs (from context/league-config.md and mlb-category-state-analyzer signals)

Outputs produced:

  • regression_index per player (-100 to +100)
  • Direction tag: BUY / SELL / HOLD / WATCHLIST
  • Secondary flag notes (BABIP, HR/FB)
  • Signal file at signals/YYYY-MM-DD-regression.md
  • User-facing summary with inline jargon translations and an action verb

Version history

  1. 0.1 GitHub ↗
    Original release notes

    ## What's Changed * Improve writer skill navigation and structure by @lyndonkl in https://github.com/lyndonkl/claude/pull/1 * Consolidate stickiness content and reduce revision to 3 passes by @lyndonkl in https://github.com/lyndonkl/claude/pull/2 * Update README.md to reflect current writer skill structure by @lyndonkl in https://github.com/lyndonkl/claude/pull/3 * Add explicit instructions for AI agents to follow resource file workf… by @lyndonkl in https://github.com/lyndonkl/claude/pull/4 * Change analysis files from /tmp/ to project directory by @lyndonkl in https://github.com/lyndonkl/claude/pull/5 * Add five refined skills to production by @lyndonkl in https://github.com/lyndonkl/claude/pull/6 * Add causal-inference-root-cause skill and fix missing methodology files by @lyndonkl in https://github.com/lyndonkl/claude/pull/7 * Add workflow pattern to 6 completed skills by @lyndonkl in https://github.com/lyndonkl/claude/pull/8 * Add chain-estimation and roleplay-debate skills with optimizations by @lyndonkl in https://github.com/lyndonkl/claude/pull/9 * Add 3 new skills and update writer skill workflow pattern by @lyndonkl in https://github.com/lyndonkl/claude/pull/10 * Add skills #12-13: constraint-based-creativity and data-schema-knowle… by @lyndonkl in https://github.com/lyndonkl/claude/pull/11 * Add skills #14-16: decision-matrix, decomposition-reconstruction, deliberation-debate-red-teaming by @lyndonkl in https://github.com/lyndonkl/claude/pull/12 * Add skills #17-19: design-of-experiments, dialectical-mapping-steelmanning, discovery-interviews-surveys by @lyndonkl in https://github.com/lyndonkl/claude/pull/13 * Add chef-assistant skill and update README by @lyndonkl in https://github.com/lyndonkl/claude/pull/14 * Fix README: Remove links to gitignored scratchpad files by @lyndonkl in https://github.com/lyndonkl/claude/pull/15 * Add skills #14-22: 9 new production-ready skills by @lyndonkl in https://github.com/lyndonkl/claude/pull/16 * Add skills #20-24 and workflow pattern updates by @lyndonkl in https://github.com/lyndonkl/claude/pull/17 * Add skill #25: expected-value by @lyndonkl in https://github.com/lyndonkl/claude/pull/18 * Add skills #26-28: facilitation-patterns, financial-unit-economics, focus-timeboxing-8020 by @lyndonkl in https://github.com/lyndonkl/claude/pull/19 * Add skills #29-30: heuristics-and-checklists, hypotheticals-counterfactuals by @lyndonkl in https://github.com/lyndonkl/claude/pull/20 * Add skills #31-33: information-architecture, kill-criteria-exit-ramps, layered-reasoning by @lyndonkl in https://github.com/lyndonkl/claude/pull/21 * Add Claude Code plugin support by @lyndonkl in https://github.com/lyndonkl/claude/pull/22 * Fix plugin marketplace source path by @lyndonkl in https://github.com/lyndonkl/claude/pull/23 * Add skill #34: mapping-visualization-scaffolds by @lyndonkl in https://github.com/lyndonkl/claude/pull/24 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/25 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/26 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/27 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/28 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/29 * Add skill #59: skill-extraction by @lyndonkl in https://github.com/lyndonkl/claude/pull/30 * Add skill-creator: Transform documents into actionable skills by @lyndonkl in https://github.com/lyndonkl/claude/pull/31 * Update skill count from 58 to 61 in README by @lyndonkl in https://github.com/lyndonkl/claude/pull/32 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/33 * Add d3-visualization skill: comprehensive D3.js implementation guide by @lyndonkl in https://github.com/lyndonkl/claude/pull/34 * Add comprehensive Superforecasting Toolkit with 4 skills and orchestr… by @lyndonkl in https://github.com/lyndonkl/claude/pull/35 * Add "Run in Smithery" badge by @gurdasnijor in https://github.com/lyndonkl/claude/pull/36 * Add Scientific Writing Toolkit with 6 skills and orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/37 * Improve skill invocation rules and update README by @lyndonkl in https://github.com/lyndonkl/claude/pull/38 * Add Geometric Deep Learning skill suite and orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/39 * Decompose writer skill into 4 focused skills + orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/40 * Add GraphRAG skill suite with 5 skills + orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/41 * Decompose cognitive-design skill into 3 focused skills + orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/42 ## New Contributors * @lyndonkl made their first contribution in https://github.com/lyndonkl/claude/pull/1 * @gurdasnijor made their first contribution in https://github.com/lyndonkl/claude/pull/36 **Full Changelog**: https://github.com/lyndonkl/claude/commits/0.1

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 解决梦幻棒球中高频刚需:基于底层数据识别被低估/高估球员
  • 提供明确的交易信号(-100到+100回归指数)指导用户决策
  • 覆盖多种典型场景(精英击球手运气差、老将投手幸运等)
Trigger Precision90/100

Highlights

  • 触发词覆盖全面,包括'buy low'、'sell high'、'regression candidate'等核心术语
  • 边界清晰,明确适用于交易和自由球员市场决策场景
Structure and Standards85/100

Areas to improve

  • description写错位置 Reported severity: Minor

    顶层frontmatter中description为空,实际描述内容在skill_body内部

    Recommendation: 将description内容移至顶层frontmatter

  • 引用文件缺失 Reported severity: Minor

    SKILL.md引用了resources/methodology.md、resources/template.md等资源文件,但未传入

    Recommendation: 确保所有被引用的资源文件都包含在Skill包中,或明确说明这些是模板文件

Highlights

  • 工作流程清晰分步,包含6个明确步骤和检查清单
  • 提供完整示例展示端到端执行过程
  • 包含常见模式和防护措施,提升实用性
Execution Reliability80/100

Areas to improve

  • 依赖外部资源文件 Reported severity: Major

    执行流程严重依赖resources/目录下的多个文件(methodology.md、template.md、evaluators等),若缺失将导致执行失败

    Recommendation: 将关键公式和模板内容内联到主文档,或确保所有依赖文件都包含在Skill包中

Highlights

  • 数据来源明确(Baseball Savant、FanGraphs)并提供URL模式
  • 包含样本量最小值防护和极端值截断机制
  • 提供置信度评分和冲突信号处理方案
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • baseballsavant.mlb.com
  • www.fangraphs.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.