Learn from your own chess mistakes: Stockfish analysis + spaced repetition training
Project description
Chess Self-Coach
Learn from your own mistakes. Chess Self-Coach fetches your games from Lichess and chess.com, finds your blunders with Stockfish, and drills you on the correct moves with spaced repetition.
Try the training PWA | Documentation | Landing page
How It Works
YOUR GAMES STOCKFISH ANALYSIS TRAINING
┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐
│ Lichess + chess.com│ ───→ │ Parallel analysis │ ───→ │ Find the Better │
│ 20 recent games │ │ depth 18, 4 cores │ │ Move (PWA) │
└───────────────────┘ └───────────────────┘ └───────────────────┘
• Board position shown
• Context: phase, advantage
• Drag the better move
• Explanation + best line
• Spaced repetition (SM-2)
• Link to original game
One command to start
chess-self-coach train --prepare # fetch games + Stockfish analysis (~5 min)
chess-self-coach train --serve # open training in browser
What you see
For each mistake in your games, the trainer shows:
- Context: "Middlegame, you had a slight advantage. Your move lost significant material."
- The position with material balance (captured pieces)
- Your task: find the better move by dragging a piece
- After answering: explanation, best line (playable), link to the original game
- Spaced repetition: positions come back until mastered (intra-session + SM-2)
- Give up: permanently dismiss positions you don't want to review
Mistake categories
| Category | Centipawn loss | Example |
|---|---|---|
| Blunder | >= 200 cp | Hanging a piece, allowing checkmate |
| Mistake | 100-199 cp | Missing a tactic, losing material |
| Inaccuracy | 50-99 cp | Passive move when active was better |
Installation
# Recommended: install as isolated CLI tool
pipx install chess-self-coach
# Or with pip
pip install chess-self-coach
# From source (development)
git clone https://github.com/Bobain/chess-self-coach.git
cd chess-self-coach
uv venv && uv sync
Prerequisites
- Python >= 3.12
- Stockfish —
sudo apt install stockfish(or provide path via--engine) - Lichess API token — for fetching your games (create one here, scopes:
study:read+study:write)
Configuration
echo "LICHESS_API_TOKEN=lip_your_token_here" > .env
chess-self-coach setup # interactive setup: verifies auth, configures config.json
CLI Reference
Training (main feature)
# Fetch your games and analyze with Stockfish
chess-self-coach train --prepare # 20 games, depth 18, parallel
chess-self-coach train --prepare --games 50 # more games
chess-self-coach train --prepare --depth 12 # faster analysis
# Open the training interface
chess-self-coach train --serve
# Check your stats
chess-self-coach train --stats
Incremental by default: only new games are analyzed. Existing positions and your SRS progress are preserved.
# Developer options
chess-self-coach train --prepare --fresh # [dev] discard data, start from scratch
chess-self-coach train --refresh-explanations # [dev] regenerate texts without Stockfish
Repertoire management (secondary)
Also includes tools for managing opening repertoire PGN files synced with Lichess Studies:
chess-self-coach analyze <file.pgn> # Stockfish analysis with [%eval] annotations
chess-self-coach push <file.pgn> # push PGN to Lichess Study
chess-self-coach pull <file.pgn> # pull from Lichess Study
chess-self-coach cleanup [file.pgn] # remove empty default chapters
chess-self-coach status # sync status of all repertoire files
chess-self-coach setup # interactive configuration wizard
Data & Privacy
- Your games are fetched from public APIs (Lichess, chess.com)
training_data.jsonis stored locally (gitignored)- Drill progress is in your browser's localStorage
- No server, no account, no tracking
GitHub Pages
| URL | Content |
|---|---|
| /chess-self-coach/ | Landing page |
| /chess-self-coach/train/ | Training PWA |
| /chess-self-coach/docs/ | Documentation |
Contributing
See CONTRIBUTING.md for code guidelines.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chess_self_coach-0.1.12.tar.gz.
File metadata
- Download URL: chess_self_coach-0.1.12.tar.gz
- Upload date:
- Size: 175.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c4d73056c2eb8d3068d42b790a4a66217bb128910e88fb4d0dab826100437af
|
|
| MD5 |
74fd9ca3d4c1d012c4e888a78f2c5e76
|
|
| BLAKE2b-256 |
7948d94540203f09d878cb2c27d69135c97a9785ef5a968deec86311654ddfa1
|
Provenance
The following attestation bundles were made for chess_self_coach-0.1.12.tar.gz:
Publisher:
publish.yml on Bobain/chess-self-coach
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chess_self_coach-0.1.12.tar.gz -
Subject digest:
4c4d73056c2eb8d3068d42b790a4a66217bb128910e88fb4d0dab826100437af - Sigstore transparency entry: 1118159101
- Sigstore integration time:
-
Permalink:
Bobain/chess-self-coach@924222e3051970a199222ab360ba8a3643037b7c -
Branch / Tag:
refs/tags/v0.1.12 - Owner: https://github.com/Bobain
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@924222e3051970a199222ab360ba8a3643037b7c -
Trigger Event:
release
-
Statement type:
File details
Details for the file chess_self_coach-0.1.12-py3-none-any.whl.
File metadata
- Download URL: chess_self_coach-0.1.12-py3-none-any.whl
- Upload date:
- Size: 34.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f456c3743efaadc0706df0bfcd5149b7e3b533549e1e12d3b99e5efeb2bb8a78
|
|
| MD5 |
1ad4746c265e4251b66c85e3de4a9921
|
|
| BLAKE2b-256 |
85bb5101a269d3e70b0f21bc301c8f428612f294705ec6e625f036d618c8cbae
|
Provenance
The following attestation bundles were made for chess_self_coach-0.1.12-py3-none-any.whl:
Publisher:
publish.yml on Bobain/chess-self-coach
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chess_self_coach-0.1.12-py3-none-any.whl -
Subject digest:
f456c3743efaadc0706df0bfcd5149b7e3b533549e1e12d3b99e5efeb2bb8a78 - Sigstore transparency entry: 1118159705
- Sigstore integration time:
-
Permalink:
Bobain/chess-self-coach@924222e3051970a199222ab360ba8a3643037b7c -
Branch / Tag:
refs/tags/v0.1.12 - Owner: https://github.com/Bobain
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@924222e3051970a199222ab360ba8a3643037b7c -
Trigger Event:
release
-
Statement type: