No description
  • TypeScript 54.7%
  • Rust 30.9%
  • CSS 10.8%
  • JavaScript 1.8%
  • HTML 1.2%
  • Other 0.6%
Find a file
Harald Hoyer 179da5665c Test opening a game from the server, and guard the open against hangs and repeat clicks
openMyGame is tested with a stubbed server; the review-cache save decision
is a pure function; the review request is aborted on timeout and its timer
cleared; the page is marked busy while a game opens and ignores repeat
clicks. The saved depth is the review's own.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-28 22:30:50 +01:00
blog What's new: the new Home from 23 October 2026-10-23 01:00:36 +00:00
docs Plan full-game analysis (plan 7) 2026-10-28 21:13:57 +01:00
functions/engine Settings page and Full Stockfish 2026-10-20 06:26:28 +00:00
public Review on the browser engine alone, without Lichess cloud evals 2026-10-26 10:28:34 +01:00
scripts Offer Lichess's named opening lines to the book 2026-10-27 13:41:31 +01:00
server Never replace a deeper evaluation with a shallower one, and skip the rest of skipped games 2026-10-28 22:30:50 +01:00
shared Pin the loss bands in the shared vectors 2026-10-26 16:34:52 +01:00
src Test opening a game from the server, and guard the open against hangs and repeat clicks 2026-10-28 22:30:50 +01:00
supabase Verdicts in side lines, and Report this verdict 2026-10-20 17:42:06 +00:00
.env Accounts: sign up with Google or email, and sync 2026-10-18 15:41:28 +00:00
.env.server Run the app against the private server in server mode 2026-10-26 10:59:09 +01:00
.env.web Settings page and Full Stockfish 2026-10-20 06:26:28 +00:00
.envrc Start the private server crate 2026-10-26 10:31:33 +01:00
.gitignore Ignore .direnv 2026-10-26 16:34:52 +01:00
.nvmrc Rookahead: chess game review with Stockfish 19 in the browser 2026-10-18 03:45:12 +00:00
.oxlintrc.json Rookahead: chess game review with Stockfish 19 in the browser 2026-10-18 03:45:12 +00:00
AGENTS.md Link AGENTS.md to CLAUDE.md for other coding agents 2026-10-28 21:38:28 +01:00
CLAUDE.md Add CLAUDE.md: builds, commands, server architecture and workflow 2026-10-28 21:37:24 +01:00
embed.html Share games as links, images, GIFs and embeds 2026-10-18 05:22:05 +00:00
flake.lock Start the private server crate 2026-10-26 10:31:33 +01:00
flake.nix Compress the engine once per Stockfish version, and skip tests in Nix 2026-10-28 20:45:30 +01:00
index.html Redesign the desktop Home 2026-10-24 12:50:15 +00:00
LICENSE Rookahead: chess game review with Stockfish 19 in the browser 2026-10-18 03:45:12 +00:00
package-lock.json Blog at rookahead.com/blog, with its first five posts 2026-10-22 06:18:59 +00:00
package.json Run the app against the private server in server mode 2026-10-26 10:59:09 +01:00
README.md The verdict rulebook, and the classifier following it 2026-10-20 16:51:18 +00:00
tsconfig.app.json Rookahead: chess game review with Stockfish 19 in the browser 2026-10-18 03:45:12 +00:00
tsconfig.json Rookahead: chess game review with Stockfish 19 in the browser 2026-10-18 03:45:12 +00:00
tsconfig.node.json Rookahead: chess game review with Stockfish 19 in the browser 2026-10-18 03:45:12 +00:00
vite.config.ts Run the app against the private server in server mode 2026-10-26 10:59:09 +01:00

Rookahead

A chess analysis board running Stockfish 19 in the browser, multi-threaded, with the full NNUE network.

  • Live analysis of any position: up to 5 engine lines, best-move arrows, eval bar
  • Game review: every move graded with Rookahead's verdicts (Legendary, Clutch, Best, Strong, Solid, Theory, Slip, Mistake, Oversight, Blunder, Forced), accuracy per player, an eval graph marking the key moments, and a step-through mode with commentary
  • Paste a PGN / FEN, or import recent games by username
  • Play your own moves on the board to explore side variations (promote or delete them later)
  • Clocks from the PGN, keyboard navigation, board themes, and the session survives a refresh
  • Move sounds (synthesised in the browser, no audio files) and animated pieces, verdicts and summary

Running it

npm install     # also copies the Stockfish builds into public/engine/
npm run dev     # http://localhost:5173

Requires Node 20+. It starts on the Lite engine, a 2 MB network that loads instantly (still far stronger than any human). Pick Full in Settings for the strongest analysis: that downloads the ~100 MB network once, and the browser caches it after that.

Multi-threading

Multi-threaded WASM needs SharedArrayBuffer, which browsers only allow on cross-origin isolated pages. The dev and preview servers send the required headers (see vite.config.ts):

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

If you host the built dist/ elsewhere, send those two headers too, or the app falls back to a single thread.

How moves are classified

Rookahead's own rules for every verdict live in docs/rulebook.md; src/lib/classify.ts follows them. The opening book is Lichess's CC0 opening list (src/data/openings.json).

  • Accuracy — Lichess's open formula (volatility-weighted and harmonic means of per-move accuracy)

To rebuild the opening book: node scripts/build-openings.mjs <dir with a.tsv … e.tsv> from https://github.com/lichess-org/chess-openings.

Keyboard

Key Action
← / → Previous / next move
↑ / Home Start of the game
↓ / End End of the current line
F Flip the board
L Toggle the engine
Space Play through the moves

Scripts

Command
npm run dev Dev server
npm run build Type-check and build to dist/
npm run preview Serve the build (with isolation headers)
npm test Unit tests (Vitest)
npm run lint Lint (oxlint)

Set localStorage.setItem('rookahead.debug', '1') in the browser console to log all UCI traffic.

Layout

src/
  engine/Engine.ts        Stockfish worker wrapper: UCI, one-search-at-a-time queue, cancellation
  hooks/useAnalysis.ts    Live analysis (with per-position cache) and full-game review
  hooks/useEngine.ts      Engine lifecycle
  lib/tree.ts             Game tree (main line + variations), PGN import/export
  lib/uci.ts              UCI "info" line parser
  lib/evaluation.ts       Score conversion, win %, formatting
  lib/chesscom.ts         Chess.com public API client
  components/             Board (Chessground), eval bar & graph, move list, engine lines, dialogs

Licences

Rookahead is free software under the GNU General Public License v3.0 or later (see LICENSE).

It builds on Stockfish.js (GPL-3.0) and Chessground (GPL-3.0-or-later), so anyone serving the app must also offer its source under the GPL. The opening book comes from Lichess's chess-openings (CC0) and the Geist fonts are under the SIL Open Font License.