| name | match-result-updater |
| description | Updates match results for Shanghai Port FC teams. Invoke when user says 'update match result' or '更新比赛结果' with team name, opponent, and score. |
Match Result Updater
This skill automates the process of updating match results for Shanghai Port FC teams (first team and B team), including match report localization and standardization.
Features
-
Update Schedule Files
- Updates
schedule.json for first team matches
- Updates
schedule_b.json for B team matches
- Sets result and status fields
-
Match Report Validation
- Checks corresponding JSON data file exists
- Validates player names against official player lists
- Verifies Chinese localization completeness
-
Player Name Standardization
- Uses
players.json for first team player names
- Uses
players_b.json for B team player names
- Handles alias mapping (e.g., 莱奥 → 莱昂纳多, 布朗宁 → 蒋光太)
- Processes starting players, substitutes, substitutions, and match events
-
Match Report Localization
- Venue name localization
- Competition name standardization
- Timeline description standardization
- Player name standardization in all sections
-
Update Schedule Details
- Extracts referee from match report (
officials.referee)
- Extracts home and away coaches (
lineups.home.manager, lineups.away.manager)
- Extracts attendance numbers (
match.attendance)
- Extracts scorers from
highlights or matchTimeline
- Adds special markers for penalty goals (PK) and own goals (OG)
-
Update Statistics
- Runs incremental update by default (based on file date prefix)
- Supports full update when needed
- Handles penalty goal marking in statistics
Usage
Trigger Phrases
- "更新XX队比赛结果"
- "update match result for XX team"
- "更新上海海港比赛结果"
Required Information
- Team: "一线队" or "B队"
- Home Team: Full team name
- Away Team: Full team name
- Result: Score in "X-Y" format (home-away)
Example Inputs
更新一线队比赛结果,上海海港vs武汉三镇 4:0
更新B队比赛结果,山西崇德荣海vs上海海港富盛经开 0:3
Workflow
- Identify Team - Determines whether to update first team or B team
- Locate Match - Searches schedule file for matching teams
- Update Schedule - Sets result and status fields
- Validate Match Report - Checks JSON file exists
- Match Report Localization & Standardization - Runs
normalize_match_report.py
- Player name standardization
- Venue name localization
- Competition name standardization
- Timeline player name updates
- Extract Schedule Details - Extracts referee, coaches, attendance, and scorers
- Add Special Markers - Adds (PK) for penalty goals and (OG) for own goals based on
goal_type field
- Verify Scorers Count - Ensures number of scorers matches the score
- Update Statistics - Runs incremental update by default
Files Modified
| File | Description |
|---|
public/data/schedule.json | First team schedule |
public/data/schedule_b.json | B team schedule |
public/data/current_stats.json | Season statistics |
public/data/YYYY-MM-DD-赛事类型-第X轮.json | Match report data |
Supporting Scripts
| Script | Description |
|---|
scripts/normalize_match_report.py | Match report localization and player name standardization |
scripts/update_schedule_details_v2.py | Extracts match details from match reports |
scripts/update_stats.py | Updates season statistics (supports incremental and full update) |
Player Name Standardization
Supported Alias Mappings
| Alias | Official Name |
|---|
| 莱奥 | 莱昂纳多 |
| 莱昂纳多·席尔瓦 | 莱昂纳多 |
| 布朗宁 | 蒋光太 |
| Tyias Browning | 蒋光太 |
| 马修·奥尔 | 安永佳 |
| Matthew Orr | 安永佳 |
| 乌米提江·玉素甫 | 吾米提江 |
| 乌米提江 | 吾米提江 |
Processing Fields
lineups.home.players[].name
lineups.home.substitutes[].name / lineups.home.bench[].name
lineups.away.players[].name
lineups.away.substitutes[].name / lineups.away.bench[].name
matchTimeline[].player
matchTimeline[].playerIn / matchTimeline[].playerOut
matchTimeline[].player2
Validation Checks
- Team Names must match existing names in schedule files
- Score Format must be "X-Y"
- Match must exist in schedule file
- JSON File must exist for the match report
- Player names must match official player lists
Notes
- Reports player name discrepancies if found
- Uses incremental update for performance (processes files with date prefix later than last update)
- Automatically handles penalty goals and own goals with special markers
- Supports both camelCase (
playerIn, playerOut) and snake_case (player_in, player_out) field formats
- Prompts for confirmation before changes
Example Workflow
User: 更新一线队比赛结果,上海海港vs武汉三镇 4:0
Skill Actions:
- Identify team: 一线队
- Find match in schedule.json
- Update result to "4-0", status to "已结束"
- Check match report JSON file exists
- Run match report normalization:
- Standardize player names against players.json
- Localize venue name
- Update matchTimeline player names
- Extract details from match report:
- Referee: 艾坤
- Home Coach: 凯文·穆斯卡特
- Away Coach: 待定
- Attendance: 20033
- Scorers: 魏震, 安佩姆, 蒋光太, 刘祝润
- Verify scorers count matches score (4 goals = 4 scorers)
- Update schedule.json with extracted details
- Run incremental stats update
Special Goal Markers
When extracting scorers, check the goal_type field in match report:
| goal_type | Marker | Example |
|---|
penalty_goal / penalty | (PK) | 温钧翔(PK) |
own_goal | (OG) | 邓嘉俊(OG) |
Example with special markers:
{
"scorers": {
"home": ["武磊", "武磊(PK)"],
"away": ["克雷桑", "邓嘉俊(OG)"]
}
}
Key Data Sources
| Data Source | Path | Description |
|---|
| First Team Players | public/data/players.json | Official first team player list |
| B Team Players | public/data/players_b.json | Official B team player list |
| First Team Schedule | public/data/schedule.json | First team match schedule |
| B Team Schedule | public/data/schedule_b.json | B team match schedule |
| Match Reports | public/data/YYYY-MM-DD-*.json | Individual match reports |