一键导入
sdv-add-cbs-league
Add a CBS Sports (NAPI) league/resource — capture + catalog in sdv-internal-refs/cbs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a CBS Sports (NAPI) league/resource — capture + catalog in sdv-internal-refs/cbs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | sdv-add-cbs-league |
| description | Add a CBS Sports (NAPI) league/resource — capture + catalog in sdv-internal-refs/cbs. |
| disable-model-invocation | true |
Adds a new sport or league to the CBS Sports NAPI catalog in sdv-internal-refs. The NAPI is a REST API with a self-describing registry. Data-backed endpoints are auth-free; live scoring and recruiting resources are gated or id-restricted.
| Property | Value |
|---|---|
| Primary base | https://api.cbssports.com/napi |
| Cloud mirror | https://sdf-api.cbssports.cloud/napi |
| Auth | None for data resources; torq-token for live/recruiting |
| Self-docs | GET /resource/endpoint/registry |
| OpenAPI | c:\Users\saiem\Documents\GitHub-Data\sdv-dev\sdv-swagger\cbssports-napi.openapi.yaml |
| Body captures | c:\Users\saiem\Documents\sdv-internal-refs\cbs\captures\_sample\ |
| OpenAPI gen | c:\Users\saiem\Documents\sdv-internal-refs\cbs\gen_napi_openapi.py |
| Resource | Path | Notes |
|---|---|---|
| League info | /resource/league/{leagueId} | League metadata |
| Season teams | /resource/season/teams/{seasonId} | All teams in a season |
| Team players | /resource/team/players/{teamId} | Current roster |
| Team standings | /resource/team/standings/{teamId} | Team standings block |
Discover IDs by querying the registry endpoint first:
curl -s "https://api.cbssports.com/napi/resource/endpoint/registry" \
| python -m json.tool | grep -i "<sport>"
This lists all registered endpoints with their parameter shapes — use it to identify leagueId / seasonId values before capturing.
curl -s "https://api.cbssports.com/napi/resource/endpoint/registry" \
> cbs/captures/_sample/endpoint_registry.json
# Find league IDs
python -c "
import json
reg = json.load(open('cbs/captures/_sample/endpoint_registry.json'))
# inspect reg for your sport
"
cbs/captures/_sample/<sport>/<league>/league.json
cbs/captures/_sample/<sport>/<league>/season_teams_<seasonId>.json
cbs/captures/_sample/<sport>/<league>/team_players_<teamId>.json
cbs/captures/_sample/<sport>/<league>/team_standings_<teamId>.json
SPORT="<sport>"
LEAGUE_ID="<leagueId>"
SEASON_ID="<seasonId>"
TEAM_ID="<teamId>"
BASE="https://api.cbssports.com/napi"
curl -s "$BASE/resource/league/$LEAGUE_ID" \
| python -m json.tool > cbs/captures/_sample/$SPORT/$LEAGUE_ID/league.json
curl -s "$BASE/resource/season/teams/$SEASON_ID" \
| python -m json.tool > cbs/captures/_sample/$SPORT/$LEAGUE_ID/season_teams_$SEASON_ID.json
curl -s "$BASE/resource/team/players/$TEAM_ID" \
| python -m json.tool > cbs/captures/_sample/$SPORT/$LEAGUE_ID/team_players_$TEAM_ID.json
curl -s "$BASE/resource/team/standings/$TEAM_ID" \
| python -m json.tool > cbs/captures/_sample/$SPORT/$LEAGUE_ID/team_standings_$TEAM_ID.json
After adding new captures, regenerate the OpenAPI spec from the live registry:
cd c:\Users\saiem\Documents\sdv-internal-refs
python cbs/gen_napi_openapi.py
# output: sdv-swagger/cbssports-napi.openapi.yaml (via symlink or copy)
Create cbs/catalogs/<sport>_returns.md:
# CBS Sports NAPI — <Sport> Returns
Captured: YYYY-MM-DD
League ID: `<leagueId>`
Season ID: `<seasonId>`
## /resource/league/{leagueId}
**URL:** `https://api.cbssports.com/napi/resource/league/<leagueId>`
**Top-level keys:** `["league", "conferences", "divisions"]`
| Field | Type | Notes |
|---|---|---|
| league.id | string | |
...
## Divergence notes
- <shape differences vs other CBS leagues>
Open cbs/cbs_catalog.yaml and add:
- sport: <sport>
league_id: <leagueId>
season_id: <seasonId>
resources_captured:
- league
- season_teams
- team_players
- team_standings
capture_date: YYYY-MM-DD
returns_doc: catalogs/<sport>_returns.md
auth: torq for those resources.sdf-api.cbssports.cloud) is functionally identical to the primary. Use the primary for captures; note the mirror in the catalog for redundancy.seasonId values are not always predictable. Derive them from the registry or from an existing known-good league response before running bulk captures./resource/game/...) require a game ID that is only meaningful during the season. Do not attempt off-season bulk captures of live resources.Use when porting R logic into the Python SportsDataverse package (sdv-py) — e.g. translating an nflfastR / cfbfastR / cfbscrapR / baseballr / hoopR R function, reconciling a fix from the pandas `0.36-live` branch into polars `main`, or re-implementing a modeling recipe (EP/WP/QBR/CPOE) from R. Enforces a parity-test-first workflow (golden fixture from the R output → failing parity test → port → green) and the polars-1x + ID-dtype + no-lookaround conventions. Also covers R numeric fidelity when outputs must match R bit-for-bit (R>=4.0 fround, 80-bit long-double sum, non-na.rm null-poisoning, dplyr group order), stale-fork sibling packages (wbigballR-style), and oracle integrity (a browser/rvest-captured oracle can be corrupt — fix the bug, don't match it). Invoke for "port this R function to polars", "port from nflfastR/bigballR", "reconcile 0.36-live into main", "translate this dplyr/np.select to polars", "re-implement the R model recipe in Python", or when a parity test fails on a handful of rounding-boundar
Use when shipping a change in sportsdataverse-py (sdv-py) — opening, pushing, or merging a PR. Runs the steps in the correct order (regenerate codegen docs, update changelog/docs/tutorials, lint, full pytest, commit + verify it landed, push, triage bot reviews CodeRabbit/Sourcery/Copilot immediately — in parallel with CI, not after it — wait for CI green, confirm merge, write a session note) and never cleans up a branch before the merge is confirmed. Invoke for "ship this", "open/merge the PR", "land this change", or any end-of-change release flow.
Use when executing a model-spine implementation plan (the ClaudeCowork specs/plans backlog — prediction stacks, ratings engines, projection/impact models) or building any oracle-gated analytics module in an SDV repo. Covers the full loop — isolated worktree + baseline, Phase-0 oracle harness (metrics/constants/leakage split/fixtures), per-task TDD with verified commits, oracle gates with the never-lower rule, league-shim parity, mypy/codegen close-out, reviewer pass, and the session restart prompt. Invoke for "implement T<x>", "start the <sport> model spine", "continue the prediction stack", or any multi-phase model build.
Use when capturing an external oracle/validation corpus into committed test fixtures — Torvik/KenPom ratings, ESPN BPI/predictor/odds, market closing lines, MoneyPuck, published RAPM/EPM, or any third-party reference a model gate will assert against. Covers column contracts, Utf8-id discipline, the team/player name-crosswalk recipe (contracting normalizer + candidate keys + alias table + match-rate reporting), rate-limit-aware sampling, and the mandatory provenance README. Invoke for "capture the oracle corpus", "commit the <source> fixtures", or any Task-0-style fixture capture in a model plan.
Use when porting Python logic from the SportsDataverse Python package (sdv-py) into a SportsDataverse R package — cfbfastR, hoopR, wehoop, baseballr, fastRhockey, softballR, etc. Enforces a parity-test-first workflow (golden fixture from the Python output → failing testthat test → port → green) plus the tidyverse/data.table idiom map and R package conventions (roxygen2 docs, snake_case, tibble returns, pkgdown reference coverage). Invoke for "port this to cfbfastR", "translate this polars logic to dplyr", "re-implement the sdv-py parser in R", or "bring this Python fix back to the R package".
Register a new ESPN league family in sdv-py — leagues.yaml row, pre-create package dir + __init__, regenerate, gated live test, verify the drift gate.