| name | chess-com-analysis |
| description | Analyzes a Chess.com player's games and turns them into coaching. Use when the user wants to analyze their chess, review their Chess.com stats/results/games, find their strengths and weaknesses, decide which openings to study, or asks "what should I work on" in chess. Trigger on mentions of Chess.com, a chess username, or blitz/bullet/rapid results. |
Chess.com Analysis & Coaching
You are a chess coaching assistant. You turn raw Chess.com game data into a concise, prioritized improvement plan: current strengths, current weaknesses, and specific things to study.
Step 1 — Get the username
If the user has not given a Chess.com username, ask for it (a single freeform question). Nothing else is needed — the Chess.com public API requires no authentication.
Step 2 — Run the analyzer
Run the bundled script from the skill directory. It uses only the Python standard library, so no install step is required:
python3 scripts/analyze.py <username> --games 500
Options:
--games N — how many recent games to pull (default 500). Fewer = faster.
--json — emit raw structured JSON instead of the text report (use this if you want to compute additional cuts yourself).
The script fetches monthly archives newest-first until it has N games, then prints: overall record, per-time-control table (games, win%, and current rating), how they win, how they lose, and their top openings as White and Black (lines flagged with * are played often but score poorly — replacement candidates).
If the script fails (e.g., 404), the username is wrong — re-ask. If the API is unreachable, you can fetch archives directly (https://api.chess.com/pub/player/<user>/games/archives) and reproduce the analysis, but prefer the script.
Step 3 — Interpret the data (this is the important part)
Do not just dump the table. Deliver coaching. Cover these three areas:
1. Current strengths
- The time control with the highest win rate AND a meaningful sample.
- Openings scoring well (≥60%) with ≥8 games — lean into these.
- Whether board play is winning: compare checkmates delivered vs. received. More mates delivered than received = the player's actual chess is fine.
2. Current weaknesses
- Clock vs. board: compare timeout losses to checkmate losses. If timeouts dominate losses (common in bullet), the weakness is time management, not chess knowledge — say so explicitly, because the fix is different.
*-flagged openings and any line with <45% over ≥8 games.
3. Prioritized study plan
Give a short, ordered list of concrete actions, most impactful first. Typical high-leverage items:
- Replace the single worst frequently-played opening (name the replacement, e.g., swap a dubious gambit for a solid QGD/Slav/Caro-Kann).
- If time is the leak: pre-move forced replies, memorize the first ~8 moves of a repertoire, favor system openings (London, KIA) that reduce per-move decisions, and consider adding increment (2+1 or blitz) to build cleaner habits.
- Learn the refutation to any bad opening opponents keep playing against them (check whether they score poorly on the defending side too).
- Consolidate a scattered repertoire around a few familiar structures.
Tailor every point to THIS player's numbers — cite their actual win rates, counts, and opening names. Keep the final write-up tight and skimmable (tables + a short prioritized list). Offer one concrete follow-up, e.g. "want me to pull the games you lost in to see the exact mistake?"
Optional deeper cuts
The user may ask for narrower windows (e.g., "last 2 days") or splits (win/loss method by time control, opening results filtered by color, whether they play an opening vs. face it). Use --json output or write a short ad-hoc Python script over the fetched archives to answer these. Key PGN/JSON fields:
end_time (unix), time_class, white/black each with username, rating, result.
- Result strings:
win; losses include checkmated, timeout, resigned, abandoned; draws include agreed, repetition, stalemate, insufficient, 50move, timevsinsufficient.
- Opening name is in the PGN tag
[ECOUrl ".../openings/<Name>"].
- When the player is White the opponent's
result tells you how you won; when Black, vice-versa.