Skip to main content

Learn from your own chess mistakes: Stockfish analysis + spaced repetition training

Project description

Chess Self-Coach

License: MIT

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
  • Stockfishsudo 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.json is 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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chess_self_coach-0.1.12.tar.gz (175.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chess_self_coach-0.1.12-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

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

Hashes for chess_self_coach-0.1.12.tar.gz
Algorithm Hash digest
SHA256 4c4d73056c2eb8d3068d42b790a4a66217bb128910e88fb4d0dab826100437af
MD5 74fd9ca3d4c1d012c4e888a78f2c5e76
BLAKE2b-256 7948d94540203f09d878cb2c27d69135c97a9785ef5a968deec86311654ddfa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for chess_self_coach-0.1.12.tar.gz:

Publisher: publish.yml on Bobain/chess-self-coach

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chess_self_coach-0.1.12-py3-none-any.whl.

File metadata

File hashes

Hashes for chess_self_coach-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 f456c3743efaadc0706df0bfcd5149b7e3b533549e1e12d3b99e5efeb2bb8a78
MD5 1ad4746c265e4251b66c85e3de4a9921
BLAKE2b-256 85bb5101a269d3e70b0f21bc301c8f428612f294705ec6e625f036d618c8cbae

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page