tiki-topple-backend

Implement validated Socket.io multiplayer server logic for turn-based stacking games.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/divyadeepmishra/Board2Code --skill tiki-topple-backend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tiki-topple-backend
Source: https://github.com/divyadeepmishra/Board2Code/tree/main
Command: npx skills add https://github.com/divyadeepmishra/Board2Code --skill tiki-topple-backend

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides an end-to-end blueprint for implementing the validated real-time backend logic for a turn-based stacking board game, ensuring the server remains the single source of truth for game state.

Core Features & Use Cases

  • Authoritative Game Engine: Defines immutable GameState updates for MOVE and REORDER while enforcing turn order, stack rules (top-only), forward-only movement, and end conditions (finish line or max turns).
  • Strict Server-Side Validation: Specifies a validateAction() checklist with exact error codes and guardrails to prevent illegal moves and cheating from client input.
  • Socket.io Multiplayer + AI Turn Handling: Establishes a socket event contract, room broadcast flow, and server-only heuristic AI move generation with a human-feeling delay.

Quick Start

Implement the backend by first creating src/game/types.ts and the pure core functions in src/game/logic.ts, then implement src/game/validator.ts to enforce the non-negotiable rules, and finally wire src/socket/handlers.ts to accept game_action events and broadcast state_update and game_over using the required event names and error codes.

Frequently Asked Questions about tiki-topple-backend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a real-time game backend with Socket.io for turn-based multiplayer?

To build a real-time game backend with Socket.io, you establish a socket event contract for room-based gameplay, broadcast state updates to connected clients, and enforce server-side validation to maintain an authoritative game state as the single source of truth. The Skill specifies exact event payload contracts for this flow.

How do I validate turn-based game moves on an Express server to prevent cheating?

Validating turn-based game moves on an Express server requires a strict validateAction checklist that enforces turn order, top-only stack operations, and forward-only movement. This Skill defines exact error codes and guardrails to reject illegal client input and prevent cheating.

What is the best way to implement a server-side AI heuristic for a turn-based strategy game?

The best way to implement a server-side AI heuristic for a turn-based strategy game is to generate deterministic AI moves on the server with a human-feeling delay. This Skill specifies server-only heuristic AI move generation that applies immutable game state updates alongside multiplayer turn handling.

Can I use TypeScript and Vitest to unit test deterministic game logic and validation rules?

Yes, you can use TypeScript and Vitest to unit test deterministic game logic and validation rules. This Skill requires comprehensive unit testing for core logic and validation, specifying pure core functions in logic modules and exact validator checks to ensure immutable game state updates function correctly.

How does a server handle game termination for finish line or max turn limits in a stacking strategy game?

Handling game termination for finish line or max turn limits requires the server to evaluate end conditions after each deterministic move application. This Skill specifies finish and max-turn game termination rules, broadcasting a game over event with the exact required payload when conditions are met.

Why does my multiplayer game state desync between client and server during move reordering?

Multiplayer game state desyncs during move reordering when the client applies state changes before server validation. This Skill prevents desync by defining immutable GameState updates for MOVE and REORDER actions, keeping the server as the single source of truth and broadcasting validated state updates.