Comp data schema

From 2017YANR02/cuberoot.me · View interactive version

Comp data schema is an AI agent skill from the GitHub repository 2017YANR02/cuberoot.me. Use when touching WCA competition JSON (upcoming_comps/all_past_comps), their consumers, or any comp picker/search UI. Triggers: \"比赛 JSON\", \"upcoming_comps\", \"all_past_comps\", \"competition schema\", \"比赛数据源\", \"比赛搜索\", \"CompPicker\", \"comp picker\", \"搜比赛\".

How to use this skill

Skill file

Competition 数据源(预生成 JSON)

所有比赛相关静态 JSON 都在 /stats/ 下。生产由 GH Actions 发布到 wca-data-latest Release,并原子切换 static 数据指针;新 checkout 在 core/ 运行 pnpm stats:hydrate。不要手改生成数据。

| JSON | 生成器 | 触发 | 用途 |

|---|---|---|---|

| /stats/upcoming_comps.json | fetch_upcoming_comps.ts(stats-build) | .github/workflows/update_upcoming.yml(每天 20:00 UTC) | UpcomingComps Top 模式(只含有顶尖选手参赛的比赛 + cubing.com 中国比赛) |

| /stats/all_upcoming_comps.json | 同上脚本第二段 | 同上 | Globe upcoming 模式 + UpcomingComps All 模式(WCA 全球全量 upcoming) |

| /stats/all_past_comps.json | core/jobs/stats-build/src/bin/gen_all_comps.ts | .github/workflows/stats.yml(每周日 20:00 UTC) | Globe history 模式(WCA 历史所有已结束比赛) |

| /stats/comp_series.json、/stats/comp_city/<ISO2>.json | 同上脚本尾段(分组算法在 @cuberoot/shared/comp-series) | 同上 | 详情页「相似比赛」tab:同系列(名字/championship_type,整取)+ 同城市(一国一文件,只拉当前比赛所在国) |

`upcoming_comps.json`(Top 模式专用)

`all_upcoming_comps.json`(Globe + All 模式)

纯数组,每条:id、name、city、country(ISO alpha-2)、start_date、end_date、events(短名)、competitor_limit、latitude_degrees、longitude_degrees、url;H2H 项目写入可选 h2h_events(短名,WCIF rounds[].format = h)

`all_past_comps.json`(History 模式)

纯数组(~14k 条),每条:id、name、city、country、latitude_degrees、longitude_degrees、start_date、end_date、events(短名);H2H 项目写入可选 h2h_events(短名,developer dump rounds.format_id = h)。无 url — 前端从 id 反推 https://www.worldcubeassociation.org/competitions/{id}。

UI 比赛搜索(任何"输入比赛"的地方都用它)

通用规则

已知坑

比赛目录的持久化与恢复

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.