mlb-league-state-reader
Parses Yahoo Fantasy Baseball league state (roster, standings, current matchup, FAAB remaining, free agents) from authenticated Yahoo team pages via Claude-in-Chrome browser automation, then grounds it against league-config.md and team-profile.md to emit a normalized league-state bundle every other agent can consume without re-scraping. Use when the coach or any downstream agent needs to read Yahoo roster, refresh team profile, pull league state, get current matchup, check FAAB remaining, list free agents, or when user mentions "what's on my roster", "who am I playing this week", "how much FAAB do I have left", or "refresh my team".
What this skill does
# MLB League State Reader
## Table of Contents
- [Example](#example)
- [Workflow](#workflow)
- [Degraded Mode](#degraded-mode)
- [Guardrails](#guardrails)
- [Quick Reference](#quick-reference)
## Example
**Scenario**: Morning brief run on 2026-04-17. Coach needs current roster, matchup, FAAB, and standings before launching lineup-optimizer.
**Inputs read first**:
- `~/Documents/Projects/yahoo-mlb/context/league-config.md` (league ID 23756, team 5, 12 teams, 5x5 cats)
- `~/Documents/Projects/yahoo-mlb/context/team-profile.md` (prior known roster skeleton)
**Chrome navigation sequence** (authenticated):
1. `https://baseball.fantasysports.yahoo.com/b1/23756/5` — roster with today's opponents per player
2. `https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand` — standings + category ranks
3. `https://baseball.fantasysports.yahoo.com/b1/23756/matchup` — this week's head-to-head vs Los Doyers
4. `https://baseball.fantasysports.yahoo.com/b1/23756/transactions` — FAAB spent to date → remaining
5. `https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A` — top free agents (page 1)
**Extracted bundle**:
| Field | Value |
|---|---|
| Record | 8-6-1 |
| Rank | 5 of 12 |
| FAAB spent | $14 |
| FAAB remaining | **$86** |
| This week opp | Los Doyers |
| Live matchup score | 4-3-3 (us leading R, HR, K; losing OBP, ERA, WHIP) |
| Roster returned | 26 of 26 slots populated |
| Free agents top-20 | captured for waiver-analyst |
**Outputs written**:
- `context/team-profile.md` — roster snapshot updated in place (slot, player, MLB team, today's opp, status)
- `signals/2026-04-17-league-state.md` — signal file with YAML frontmatter, source_urls, confidence
Every downstream agent (lineup-optimizer, waiver-analyst, category-strategist) now reads this signal file and team-profile.md rather than re-scraping Yahoo.
## Workflow
Copy this checklist and track progress:
```
League State Reader Progress:
- [ ] Step 1: Read context files (league-config.md + team-profile.md)
- [ ] Step 2: Pull Yahoo pages via Claude-in-Chrome (5 URLs)
- [ ] Step 3: Parse roster, standings, matchup, FAAB, free agents
- [ ] Step 4: Update team-profile.md in place
- [ ] Step 5: Emit signal file with frontmatter + source_urls
```
**Step 1: Read context files**
Load the authoritative contract and the last known state before touching Yahoo. This both verifies the league ID/URL and provides the skeleton to diff against.
- [ ] Read `~/Documents/Projects/yahoo-mlb/context/league-config.md` — confirm league ID 23756, team 5, roster shape (C/1B/2B/3B/SS/3OF/2UTIL/3SP/2RP/5P/3BN/3IL = 26), FAAB budget $100
- [ ] Read `~/Documents/Projects/yahoo-mlb/context/team-profile.md` — capture prior FAAB remaining, prior roster for diff
- [ ] Read `~/Documents/Projects/yahoo-mlb/context/frameworks/signal-framework.md` — confirm signal file format
- [ ] Read `~/Documents/Projects/yahoo-mlb/context/frameworks/data-sources.md` — confirm the 5 Yahoo URLs
**Step 2: Pull Yahoo pages via Claude-in-Chrome**
The user is already authenticated in the browser. Navigate in order; parse page text; if any step fails, jump to [Degraded Mode](#degraded-mode) for that specific URL only (do not abort the whole run). See [resources/methodology.md](resources/methodology.md#yahoo-navigation-sequence) for the exact tool-call sequence and page-parsing patterns.
- [ ] Team page: `https://baseball.fantasysports.yahoo.com/b1/23756/5`
- [ ] Standings: `https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand`
- [ ] Matchup: `https://baseball.fantasysports.yahoo.com/b1/23756/matchup`
- [ ] Transactions (for FAAB): `https://baseball.fantasysports.yahoo.com/b1/23756/transactions`
- [ ] Free agents: `https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A`
**Step 3: Parse and normalize**
Extract structured data from each page. See [resources/methodology.md](resources/methodology.md#parsing-patterns) for row-level parsing logic, and [resources/methodology.md](resources/methodology.md#faab-remaining-computation) for how to reconstruct FAAB remaining from the transactions log.
- [ ] Roster: for each of 26 slots, capture `{slot, player, mlb_team, opp_today, status: active|IL|DTD|NA|BN}`
- [ ] Standings: W-L-T record, rank, per-category rank (10 cats)
- [ ] Matchup: opponent name, live scoreline by category (W-L-T across the 10 cats so far this week)
- [ ] FAAB: sum all `-$N` entries from transactions history this season; remaining = $100 - total spent
- [ ] Free agents: capture top 25 by rostered% — enough for waiver-analyst to start ranking
**Step 4: Update team-profile.md in place**
See [resources/template.md](resources/template.md#team-profile-output-format) for the exact output shape. Overwrite the existing file (not append); this file is meant to always reflect "as of the latest run."
- [ ] Header: `## As of YYYY-MM-DD`
- [ ] State table: record, rank, FAAB remaining, current opponent, acquisitions used, IL slots used
- [ ] Roster snapshot: full 26-slot YAML block
- [ ] Open questions: empty unless a page failed
**Step 5: Emit signal file**
Write `~/Documents/Projects/yahoo-mlb/signals/YYYY-MM-DD-league-state.md` with YAML frontmatter per the signal framework. Every URL navigated must appear in `source_urls`. Degraded fetches drop `confidence` to 0.5; full-failure fields drop to 0.3 and are flagged. See [resources/template.md](resources/template.md#signal-file-output-format).
- [ ] Frontmatter: `type: league-state`, `date`, `emitted_by: mlb-league-state-reader`, `confidence`, `source_urls[]`
- [ ] Body: roster table, standings table, matchup table, FAAB ledger, top-25 free agents
- [ ] Validate via `mlb-signal-emitter` before writing (if that skill is available in this run); otherwise write directly
## Degraded Mode
Chrome can fail for several reasons: tab not open, session expired, Yahoo rate-limiting, 500 error, unreadable DOM. **Never abort the whole run.** Fail gracefully per-URL.
**Per-URL fallback decision tree:**
| Failure | Fallback |
|---|---|
| Navigation error / timeout | Retry once. If still failing, ask user: "Paste the contents of `{URL}` and I'll parse from that." |
| Session expired (login page returned) | Ask user: "Please log into Yahoo in your Chrome tab, then say 'retry'." Do not attempt to re-authenticate. |
| Page loads but parse fails (unknown layout) | Dump the first ~4000 chars of `get_page_text` into the signal file under `raw_capture:` and drop confidence to 0.4 for that field. |
| Free-agents page gated / empty | Mark `free_agents: []` and flag in the signal. The waiver-analyst can still run on roster + standings. |
| Transactions page gated | Ask user: "What's your FAAB remaining right now? Visible at the top of the transactions page." Accept user value; mark `faab_confidence: 0.6`. |
**User-paste template** (reuse for any Yahoo page):
> "I couldn't reach `{URL}`. Please copy the visible table on that page (select all, paste into chat) and I'll extract the fields I need from your paste."
Parse the pasted text with the same regex/row patterns as the live page. See [resources/methodology.md](resources/methodology.md#paste-parsing).
## Guardrails
1. **Never assume the roster is still what it was yesterday.** Waivers clear daily and trades can fire any time. Always re-read the Yahoo team page at the start of every run, even if `team-profile.md` looks fresh.
2. **FAAB remaining is derived, not displayed.** Yahoo's UI sometimes shows "FAAB Balance" and sometimes doesn't. The authoritative computation is: `$100 minus sum of all winning bids on the transactions page this season`. Do not trust a single visible number over the ledger.
3. **Cite every URL.** The signal file's `source_urls:` list must contain every Yahoo page actually visited. If a page was skipped because of degradation, note it in the signal body, not silently.
4. **Do not re-scrape downstream.** Once this skill has emitted today's league-state signal, lineup-optimizer / waiver-analyst / categRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.