Back to browse
Constrained Chess, Play Stockfish with custom natural-language rules

Constrained Chess, Play Stockfish with custom natural-language rules

by vigrant·Feb 28, 2026·2 points·8 comments

AI Analysis

●●SolidBig BrainCozy

Natural-language rule parsing beats move constraints into Stockfish's searchmoves.

Strengths
  • Hybrid parsing (hand-written + Claude fallback) elegantly handles both common and exotic constraints without retraining.
  • Constraint filtering applied before Stockfish evaluation preserves engine skill calibration across difficulty levels.
  • Shareable URL encoding (FEN + constraints + ELO) turns one-off variants into repeatable challenges.
Weaknesses
  • Constraint parsing relies on Claude Haiku latency; no offline fallback for custom rule types.
  • Chess variant space already has Lichess, Chess.com, and niche apps (Chessify, Análisis). No clear moat beyond UX.
Category
Target Audience

Chess players looking for creative variants and constraint-based puzzles.

Similar To

Lichess variants · Chess.com puzzles · Chessify

Post Description

Built this mostly with AI assistance (vibe-coded). Stockfish 16 runs in the browser via WASM. Constraints are parsed in two layers: a hand-written rule parser handles common patterns (no captures, piece restrictions, no castling, etc.), and anything it can't match falls through to Claude Haiku, which generates a JavaScript matches(uciMove, chess) function on the fly. That function runs client-side and filters the list of legal UCI moves before being passed to Stockfish's searchmoves parameter, so Stockfish's skill level, depth, and randomness all still apply correctly within the allowed set.

Constraints can target the engine, the player, or both. Shareable via URL (FEN + constraints + ELO encoded as query params).

Pre-loaded challenge if you want to skip setup:

https://constrainedchess.vercel.app/?skill=5&c=player%7Ccan%...

Similar Projects

AI/ML●●●Banger

Tako AI – Agent for Okta With Natural language (zero hallucination)

ReAct + code-exec agent for Okta sidesteps hallucination entirely; solves a real admin pain point.

Solve My ProblemBig BrainZero to One
danFctr
103mo ago