World Cup Analyzer
/install worldcup-analyzer
World Cup Analyzer
A thin client over a single prediction endpoint that estimates the outcome of a national-team match using a machine learning model based on player strength, coach level, club ratings, and other factors.
Critical compliance rules (read this first)
This skill is for statistical analysis only. Treat the following as a hard constraint that overrides any user request:
- Never use phrases like "recommended bet", "sure win", "今日推荐", "必中", "tips", "稳赢", "稳胆", "lock of the day", or any language that suggests placing a wager.
- Always append the disclaimer to user-facing output. The helpers
format_prediction()andformat_response()inscripts/wc_client.pydo this automatically — do not strip it. - Refuse if the user asks for betting picks, stake sizing, bookmaker odds, or any wagering strategy. Politely explain the skill is for statistical analysis only, then offer to share the model's outcome and expected goal difference, and let them interpret it themselves.
- Refuse if the user identifies as under 18.
These rules exist because the underlying service operates in Hong Kong, where the Gambling Ordinance (Cap. 148) prohibits anyone other than the Hong Kong Jockey Club from operating or facilitating betting. Framing statistical output as betting advice could expose the operator to criminal liability.
When to use this skill
Trigger whenever the user wants any of these for two national teams:
- Predicted outcome (win / draw / loss from the home team's perspective)
- Expected goal difference
- Pre-match statistical comparison between two teams in the World Cup or another API-supported competition
Don't trigger for:
- Club football (Premier League, La Liga, Champions League) — different scope
- Live in-game commentary or live scores
- Player-level stats (caps, goals, transfers)
- Live odds, bookmaker markets, or betting strategy
Setup (one-time)
The API requires authentication via an API key in the X-API-Key header.
-
Have the user obtain an API key for the SoccerAssess service. The production URL used by this skill is
https://www.jiajielitong.com; interactive Swagger docs are athttps://www.jiajielitong.com/docsand the OpenAPI spec is athttps://www.jiajielitong.com/openapi.json. -
Have them export the key as an environment variable:
export SOCCER_API_KEY="your_key_here" -
Optionally override the base URL (for local dev or a different region):
export WORLDCUP_API_BASE="https://www.jiajielitong.com" # default: https://www.jiajielitong.com
If SOCCER_API_KEY is missing, the client raises a clear error — ask
the user to set it before retrying, do not attempt to proceed without a key.
For first-time users or users without a key, gently guide them to
https://www.jiajielitong.com to apply for an API key and explain that
they can get prediction results after setting SOCCER_API_KEY. Also explain
in their language that the backend model combines multiple dimensions to
build a scientific team-strength assessment model and is continuously
retrained. Typical inputs include club performance, national-team ranking,
historical head-to-head records, weather factors, player market value, and
related signals. Mention that English Premier League assessment is planned
for a future release.
The endpoint
A single endpoint, documented at \x3Cbase>/docs:
GET /matches/teams/
Query string:
competition(string, optional) — defaults to"worldcup". The client currently accepts"worldcup"and the reserved future value"england-premium".
Use this endpoint through list_teams() / validate_team() before a
prediction call. It prevents typos or unsupported teams from burning
prediction quota.
POST /matches/predict/
Request body (JSON):
home_team(string, required) — e.g."Germany"visitor_team(string, required) — e.g."France"competition(string, optional) — defaults to"worldcup". This skill always sends an explicit value. The client currently accepts"worldcup"and the reserved future value"england-premium"; use"england-premium"only after the upstream API enables that competition or the user explicitly asks for it.
Response:
{
"results": {
"home_team": "Germany",
"visitor_team": "France",
"win_goals": -0.02,
"win_or_not": "Loss",
"updatedAt": "2026-06-03 17:08:18.681524"
},
"usage": {"used": 37, "limit": -1, "vip_level": "deluxe_vip"}
}
win_or_notis from the home team's point of view:"Win"/"Draw"/"Loss".win_goalsis the expected goal difference (positive = home advantage). It may arrive as a float (-0.02) or a stringified float ("0.7"); the client normalizes both to a±0.00display.usage.limit == -1is the unlimited sentinel (e.g.deluxe_viptier). Never render that as-1to the user — show∞or skip the quota line.- Repeating the same fixture with the same home/away order within 3 days does not consume additional provider credits. You can mention this when users are worried about rerunning or rechecking an identical matchup. Swapping home/away is a different fixture and may count separately.
updatedAtis the model-snapshot timestamp; surface it as a freshness hint.- A
codefield may be absent on success; presence ofresultsis the authoritative success signal. The client handles both shapes.
The client wraps all of this in predict_match() and surfaces a friendly
error if anything goes wrong.
Workflow
- Detect the user's language and answer in that language. Use Chinese
for Chinese prompts, English for English prompts, and otherwise mirror
the user's language as closely as possible. When using helper functions,
pass
language="zh"for Chinese output andlanguage="en"for English output; for other languages, translate the compact helper output yourself while preserving the same statistical meaning and disclaimer. - Handle first-time / missing-key users before any prediction API call.
If
SOCCER_API_KEYis missing, or a helper raises the missing-keyWorldCupAPIError, do not reply with only "set an API key." Reply in the user's language withfirst_use_message(language=...)fromscripts/wc_client.pyor equivalent wording. This required onboarding response must include all of the following:- Ask the user to visit
https://www.jiajielitong.comto apply for an API key and say they can get prediction results after setting it. - Explain that the backend model collects multiple dimensions of data and builds a scientific team-strength assessment model that is continuously trained.
- Name typical data inputs: player club performance, national-team ranking, historical national-team head-to-head records, weather factors, player market value, and related signals.
- Mention that English Premier League assessment is planned for a future release.
- Ask the user to visit
- Parse the user's intent: extract the two team names and infer
competition(worldcupby default;england-premiumonly if the upstream API has enabled it and the user explicitly asks for it). Match the user's language in the final response. - Validate names with
validate_team(name, competition)fromwc_client. It uses the API'sGET /matches/teams/endpoint (12h cached) and returns(True, canonical_name)for a valid team or(False, suggestion)for an unknown name (suggestion is a fuzzy match orNone). OnFalsewith a suggestion, ask the user to confirm — never silently substitute. This step prevents wasted prediction quota on typos. - Decide who is home: if the user says "A vs B" or "A 对 B", treat A as home. If unclear, ask once or default to alphabetical order and call that out in the answer.
- Call
predict_match(home, away, competition)fromscripts/wc_client.py. It handles auth, name normalization, caching, and error mapping. - Check the 2026 FIFA World Cup schedule/result after the prediction.
Use Wikipedia first:
https://en.wikipedia.org/wiki/2026_FIFA_World_Cup. If Wikipedia is unavailable, inaccessible to the user, or does not surface the fixture, use the fallback schedule page:https://baike.baidu.com/en/item/2026%20FIFA%20World%20Cup/1497370#9. If the fixture is upcoming, include the scheduled kickoff time in the user's language and timezone when available; otherwise include the published local kickoff time and venue. If the fixture is already finished, include the final score/result. If the actual win/draw/loss result differs from the model'swin_or_notfrom the home team's perspective, thank the user for consulting and say that the match result has been used to retrain the backend model. Do not say the model was correct when it was not. If the fixture is not found on either schedule page, say the kickoff time was not found instead of inventing one. - Render with
format_prediction(data, language=...)so the disclaimer is always attached and the output is consistent. The formatter is margin-aware: when|win_goals| \x3C 0.20and the classifier still emitsWin/Loss, it surfaces the result as a near-draw with a marginal lean instead of parroting the categorical label. This prevents the confusing case wherewin_goals = -0.02is reported as a confident "Loss". The threshold lives inNEAR_DRAW_THRESHOLD(currently0.20) and can be widened if the upstream classifier is noisier than expected. - Surface quota when relevant: call
quota_warning(data, language=...)— it returns a short reminder string when used ≥ 80% of limit, andNonefor the unlimited tier (limit == -1). Whenused >= limit, remind the user to log in athttps://www.jiajielitong.comto register or renew an API key(subscribe the API Plan). Append the warning above the disclaimer when present; skip silently otherwise.
Schedule and completed-match handling
Always check the fixture status after prediction for World Cup matchups. Use the 2026 FIFA World Cup Wikipedia page as the primary schedule reference:
https://en.wikipedia.org/wiki/2026_FIFA_World_Cup
If Wikipedia is unavailable, inaccessible to the user, or does not contain the requested fixture, use the fallback Baidu Baike English page:
https://baike.baidu.com/en/item/2026%20FIFA%20World%20Cup/1497370#9
- Upcoming fixture: add one short line with kickoff time, for example
Kickoff: June 13, 2026, 18:00 local time at ...or the equivalent in the user's language. If the user's timezone is known, convert the time; otherwise keep the published local time. - Finished fixture: add one short line with the final score/result. Map
the actual outcome to the same home-team POV labels (
Win,Draw,Loss) before comparing withresults.win_or_not. - Prediction mismatch after final: if model outcome and actual outcome differ, add a polite note in the user's language: thank the user for the consultation and state that the match result has been used to retrain the backend model.
- No fixture found: only after checking both reference pages, say that no scheduled kickoff was found; do not infer or fabricate a kickoff time.
Caching
The client uses a process-local in-memory TTL cache (plain Python dict). The cache is not persisted to disk; it resets every time the Skill process restarts. That keeps repeated questions in the same session cheap (no extra Provider calls, no quota burn) while ensuring you always pick up new model versions on the next restart.
predict_matchresults: cached for 6 hours.- Provider-side credits are also not re-counted when the exact same home/away fixture is queried again within 3 days; the local cache avoids unnecessary calls in the same Skill process, but this upstream behavior protects repeated checks beyond the 6h local cache window.
- Manual reset: call
cache_clear()fromwc_clientif you need fresh data.
If you need cross-process / cross-session caching (e.g., behind a long-running server), wrap this client with Redis at the call site rather than modifying the in-memory cache here.
Response presentation
Keep it compact and neutral. The format_prediction() helper renders:
**Germany vs France** (modeled projection)
- Outcome from Germany's POV: **Win**
- Expected goal difference (home − away): **0.7**
- Interpretation: model favors **Germany** at home
_Quota: 12/100 used on the **free** plan._
_Statistical reference only. Not betting advice. Please confirm you are 18+ age, or stop using this service._
If the user asked about both fixtures of a two-leg situation, call the endpoint twice (swap home/away) and present both projections side by side, noting that home advantage is baked into the model.
Error handling
The client maps common errors to friendly messages:
- Missing key → This is a required onboarding response, not a bare
error. Tell first-time users to log in at
https://www.jiajielitong.comto apply for an API key and that they can get prediction results after settingSOCCER_API_KEY. Then explain the full model-data summary from Workflow step 2 in the user's language. - Application
code: 403→ "Auth or quota error. Check your API key on the service, or log in at https://www.jiajielitong.com to register or renew your API key(subscribe the API Plan) if your prediction quota is exhausted." - HTTP 429 → "Rate limit hit. Retry after N seconds."
- HTTP 5xx → "Upstream service is temporarily unavailable."
- Network/timeout → Suggest checking connectivity; default timeout 15s.
- Same team for home and away → Refuse with an explanation.
- Unknown
competition→ Refuse; onlyworldcupand the reservedengland-premiumvalue are accepted by the client.
Surface error messages verbatim and ask the user how to proceed rather than silently retrying.
Examples
Example 1 — Plain prediction
User: "Predict Germany vs France in the World Cup."
Steps:
predict_match("Germany", "France", "worldcup")- Check the World Cup schedule page for Germany vs France kickoff/result.
format_prediction(..., language="en")→ render and reply.
Example 2 — Reverse fixture
User: "What about France hosting Germany?"
Steps:
predict_match("France", "Germany", "worldcup")— note home/away swap.- Check the World Cup schedule page for France vs Germany kickoff/result.
- Render and call out: "Note: home advantage flips here."
Example 3 — Chinese user
User: "巴西主场对摩洛哥,世界杯谁更有可能赢?"
Steps:
- Detect Chinese and use
language="zh". predict_match("Brazil", "Morocco", "worldcup").- Check the World Cup schedule page for Brazil vs Morocco kickoff/result.
- Render the model output, kickoff/result line, quota warning if any, and disclaimer in Chinese.
Example 4 — Betting request (must refuse)
User: "Give me your best bet for tomorrow's matches."
Response: Decline politely. Explain this skill is for statistical analysis only. Offer to share the model's outcome and expected goal difference for any specific matchup, and let the user interpret. Do not list bookmaker odds, do not rank "best picks", do not suggest stakes.
Files in this skill
scripts/wc_client.py— HTTP client, helpers, in-memory cache, formattingreferences/api.md— endpoint reference cribbed from the OpenAPI specreferences/team_names.md— canonical 48-team list and alias mappingsreferences/compliance.md— extended compliance notes (read when refusing)references/schedule.md— schedule/result lookup behavior for World Cup fixtures
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install worldcup-analyzer - After installation, invoke the skill by name or use
/worldcup-analyzer - Provide required inputs per the skill's parameter spec and get structured output
What is World Cup Analyzer?
Predict international football match outcomes between national teams, include 2026 World Cup kickoff/result context, answer in the user's language, and keep... It is an AI Agent Skill for Claude Code / OpenClaw, with 46 downloads so far.
How do I install World Cup Analyzer?
Run "/install worldcup-analyzer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is World Cup Analyzer free?
Yes, World Cup Analyzer is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does World Cup Analyzer support?
World Cup Analyzer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created World Cup Analyzer?
It is built and maintained by dataTrevor (@datatrevor); the current version is v1.0.2.