AI-powered chess coaching system with memory, pattern analysis, and personalized learning paths.
- ๐ Automatic game updates every day via GitHub Actions
- ๐ Statistics: rating, win rate, time control results
- ๐ฒ Opening analysis: repertoire, win percentages, problematic lines
- ๐ Weakness identification: error patterns, time management issues
- โก Fast execution: < 1 minute for full cycle
- ๐ฅ๏ธ Computer analysis with Stockfish (accuracy, mistakes, blunders)
- ๐ฏ Tactical patterns: forks, pins, discovered attacks
- ๐ Lichess opening database: comparison with master statistics
- ๐ Interactive Studies: automatic creation of training materials
- ๐ Improvement plan: personalized recommendations based on analysis
- ๐ฌ AI chat commands: "Analyze my game from November 29"
- ๐ Smart search: by date, opponent, opening
- ๐ฎ Interactive chess board: Lichess-style viewer embedded in chat
- ๐ค Stockfish analysis: detailed move-by-move breakdown
- ๐ Visual analysis: Move classifications, accuracy, evaluation
- ๐ฏ Full interactivity: Navigate moves, explore variations, all in TypingMind!
git clone https://github.com/sergi039/sschess.git chess-knowledge
cd chess-knowledgepip install requests python-chess
brew install stockfish # for macOS (optional, for full analysis)Create a .env file:
CHESS_USERNAME=sergioquesadas # your Chess.com username
LICHESS_TOKEN=lip_YourToken # Lichess token (optional)# Basic analysis (fast, ~30 sec)
python scripts/main.py
# With Lichess computer analysis (slower, ~5 min)
python scripts/main.py --enable-lichess
# Analyze specific game
python scripts/analyze_game_on_demand.py "2025-11-29"python scripts/main.pypython scripts/main.py --username YourChessUsernamepython scripts/main.py --months 6python scripts/main.py --skip-fetchsummary.md- Overall statistics and ratingsopenings.md- Opening repertoire analysisweaknesses.md- Identified weaknesses and recommendationsrecent_games.md- Last 20 games with detailstypingmind_commands.md- Commands for AI chat
lichess_accuracy.md- Game accuracy and computer evaluationlichess_mistakes.md- Detailed analysis of mistakes and blunderslichess_tactics.md- Found tactical patternslichess_openings.md- Comparison with Lichess opening databaselichess_improvement.md- Personalized training planlichess_studies.md- Links to interactive lessons
games_cache.json- All downloaded gamesanalysis_results.json- Basic analysis resultslichess_analysis_cache.json- Computer analysis cachedetailed_analysis_cache.json- On-demand analysis cache
- Settings โ Secrets and variables โ Actions
- Add secrets:
CHESS_USERNAME- your Chess.com usernameLICHESS_TOKEN- Lichess token (optional)
- Workflow runs automatically every day at 6:00 UTC
- Actions โ Update Chess Knowledge Base โ Run workflow
- Parameters:
- months - number of months to fetch
- skip_fetch - skip fetching new games
- enable_lichess - enable Lichess analysis โ
- Go to Agents in TypingMind
- Create new agent or edit existing "Chess Master & Coach" agent
- Copy the System Prompt from
ULTRA_ENHANCED_PROMPT.md - Paste into agent's System Instructions
- Enable plugins: Web Search, Simple Calculator
- Save the agent
- In TypingMind: Data Sources โ Add New
- Choose GitHub as source
- Repository:
sergi039/sschess - Folder:
knowledge/ - TypingMind will sync files including:
chess_canvas_instructions.md(CDN links and setup)- Game analysis data
- PGN files
Basic statistics (always up-to-date):
- "Show my current rating"
- "What are my weak openings?"
- "Show recent games"
- "What are my main problems?"
Specific game analysis (requires scripts):
- "Analyze my game from November 29"
- "Find mistakes in game against [opponent]"
- "Show computer evaluation of last game"
Improvement recommendations:
- "What should I practice?"
- "Which tactical patterns am I missing?"
- "Training plan for the week"
chess-knowledge/
โโโ scripts/
โ โโโ main.py # Main orchestrator
โ โโโ fetch_games.py # Chess.com game fetching
โ โโโ analyze.py # Basic analysis
โ โโโ generate_markdown.py # Report generator
โ โโโ lichess_analyzer.py # Computer analysis
โ โโโ tactical_detector.py # Tactical pattern search
โ โโโ opening_database.py # Opening database handling
โ โโโ study_generator.py # Lichess Studies creation
โ โโโ generate_lichess_markdown.py # Lichess reports
โ โโโ analyze_game_on_demand.py # On-demand analysis
โโโ knowledge/ # Markdown files for TypingMind
โ โโโ summary.md # Overall statistics
โ โโโ openings.md # Openings
โ โโโ weaknesses.md # Weaknesses
โ โโโ recent_games.md # Recent games
โ โโโ lichess_*.md # Lichess reports (6 files)
โ โโโ typingmind_commands.md # Command reference
โโโ data/ # Cached data
โ โโโ games_cache.json # All games
โ โโโ analysis_results.json # Analysis results
โ โโโ *_cache.json # Various caches
โโโ .github/
โโโ workflows/
โโโ update.yml # GitHub Actions automation
-
Fetching: Uses Chess.com's public API to download games
- Incremental updates (only fetches new games)
- Caches all games locally
- Rate-limited to respect API guidelines
-
Analysis: Processes games to find:
- Opening repertoire and success rates
- Performance by time control
- Time management issues
- Rating progression
- Common patterns and weaknesses
-
Generation: Creates readable Markdown with:
- Tables and statistics
- Specific recommendations
- Visual indicators (๐ข๐ก๐ด)
- Links to actual games
- Chess.com API - game fetching (public, no token required)
- Lichess API - computer analysis (requires token)
- Stockfish - local engine for deep analysis
- Chess.com API has rate limits (0.5 sec between requests)
- Lichess analysis limited to 5 games at a time
- Stockfish requires local installation for full analysis
- Basic game analysis
- Lichess integration
- On-demand analysis from TypingMind
- Tactical patterns
- Opening database
- Graphs and visualization
- Opponent analysis
- Puzzle rating correlation
- Tournament statistics
- LICHESS_README.md - Detailed Lichess integration documentation
- CONTRIBUTING.md - Contribution guidelines
- knowledge/typingmind_commands.md - TypingMind command reference
Issues and pull requests are welcome! Please read CONTRIBUTING.md first.
MIT
- GitHub: @sergi039
- Chess.com: sergioquesadas
- Repository: github.com/sergi039/sschess
๐ Automated chess game analysis system with AI integration
Built with Claude Code & โค๏ธ for chess improvement