lab — bash — 120×36

yassine@portfolio:~$ls -la ./lab/

total 1 project
drwxr-xr-x chess-powers/ multiplayer chess · AI · real-time

Things built for fun — experiments, games, and tools that don't fit anywhere else.

01
Multiplayer AI Game
chess.stahp.co

Chess Powers

Real-time multiplayer chess with AI-generated custom piece rules

A multiplayer chess variant platform where players define custom piece behaviour in plain English. A GPT-4o agent interprets the description, generates JavaScript class overrides for each piece, and writes a human-readable summary. No coding required — just describe what you want ("the knight can teleport to any empty square once per game") and the agent handles the rest.

1 Player opens /create and chats with the AI agent in freeform — no structured prompts
2 Agent outputs structured JSON: lobby name + CustomPieceDefinition[] with JS code and plain-English summaries
3 Code is syntax-checked client-side, lobby saved to SQLite — reusable by anyone
4 On game start, piece definitions are sent to both players via WebSocket and evaluated in a sandboxed Function constructor
  • Piece logic runs entirely client-side in a restricted sandbox — no access to window, document, or network APIs
  • Server only syncs game state via WebSocket; it never executes user-generated code
  • Lobbies persist after games end and can be browsed and re-joined by other players
  • The agent is given the full Piece abstract interface in its system prompt to ensure generated code always conforms
Frontend React · TypeScript · Vite
Backend Node.js · Express · WebSockets
AI OpenAI GPT-4o
Database SQLite (better-sqlite3)
Infra Docker · Docker Compose