Skip to content

feat(chess): add Chess.com adapter for game history and analysis#1447

Open
wldandan wants to merge 2 commits into
jackwener:mainfrom
wldandan:chess-com-adapter-v2
Open

feat(chess): add Chess.com adapter for game history and analysis#1447
wldandan wants to merge 2 commits into
jackwener:mainfrom
wldandan:chess-com-adapter-v2

Conversation

@wldandan
Copy link
Copy Markdown

Summary

Add a Chess.com adapter to OpenCLI enabling CLI access to player game history, statistics, and analysis.

Commands Added

Command Description
opencli chess stats <username> Player profile and ratings (bullet/blitz/rapid/daily)
opencli chess games <username> List games by month
opencli chess game <gameId> Game details with optional PGN
opencli chess pgn <gameId> Browser-based PGN extraction (reliable)
opencli chess analyze <gameId> Open in browser for visual analysis
opencli chess snapshot <gameId> Structured game state for AI agents

Technical Approach

  • Public API (stats, games, game): Uses api.chess.com/pub/ endpoints
  • Browser fallback (pgn, analyze, snapshot): Uses Chrome session via OpenCLI browser bridge — solves the 20-30% PGN corruption issue

Files Changed

  • clis/chess/utils.js - Shared helpers
  • clis/chess/games.js - Game archives
  • clis/chess/game.js - Game details + PGN commands
  • clis/chess/stats.js - Player statistics
  • clis/chess/analyze.js - Browser analysis commands
  • clis/chess/chess.test.js - Unit tests
  • clis/chess/README.md - CLI documentation
  • docs/adapters/browser/chess.md - Full docs

Testing

opencli chess stats GMHikaru
opencli chess games aaronwang2026 --year 2026 --month 4
opencli chess pgn 167564728910

Closes #1430

Add chess/ adapter with commands:
- chess stats <username>: player profile and ratings
- chess games <username>: list games by month
- chess game <gameId>: game details + optional PGN
- chess pgn <gameId>: browser-based PGN extraction
- chess analyze <gameId>: open in browser for visual analysis
- chess snapshot <gameId>: structured game state for AI agents

Chess.com API PGN has 20-30% corruption rate; browser-based
fallback via Share → Copy PGN flow ensures reliable extraction.

Also add docs/adapters/browser/chess.md documentation.

Closes jackwener#1430
@wldandan wldandan force-pushed the chess-com-adapter-v2 branch from 6e122e6 to 23db46d Compare May 10, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Chess.com adapter for game history and analysis

1 participant