skills/development-skills/multiplayer-game-builder/SKILL.md
Build multiplayer turn-based games using template-based rapid development, TDD, and real-time Socket.IO integration. Use when creating card games, board games, or any turn-based multiplayer game with real-time synchronization.
npx skillsauth add abcnuts/manus-skills multiplayer-game-builderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build multiplayer turn-based games from scratch using a proven workflow that combines template-based rapid development, Test-Driven Development (TDD), and real-time Socket.IO integration.
Use this skill when building:
Research Game Rules
Deeply understand and document the complete rules. Create a rulebook that covers:
Find Similar Templates
Use the find_game_templates.py script to search GitHub:
python /home/ubuntu/skills/multiplayer-game-builder/scripts/find_game_templates.py "hearts card game"
Evaluate Templates
Use criteria from references/github-template-evaluation.md:
Create Implementation Plan
Use templates/implementation-plan-template.md to structure the project.
Follow strict Test-Driven Development. See references/tdd-workflow.md for detailed workflow.
Setup Test Infrastructure
Generate boilerplate test files:
python /home/ubuntu/skills/multiplayer-game-builder/scripts/generate_test_suite.py "my-game"
TDD Cycle for Each Module
For each game logic module (deck, bidding, playing, scoring):
Example: Deck Creation
// test/deck.test.js
it("should create a deck of 52 cards", () => {
const deck = createDeck();
assert.strictEqual(deck.length, 52);
});
// game-logic/deck.js
function createDeck() {
// Implementation here
}
Validate Game State
During development, validate game state structure:
python /home/ubuntu/skills/multiplayer-game-builder/scripts/validate_game_state.py "game_state.json"
Key Modules to Implement
Integrate game logic with Socket.IO. See references/socketio-patterns.md for patterns.
Setup Socket Handlers
Start with templates/socket-handler-template.js:
const games = {}; // In-memory game store
module.exports = function(io, socket) {
socket.on("create_game", (data, ack) => {
const gameId = generateId();
games[gameId] = createGame();
ack({ gameId });
});
socket.on("join_game", (data, ack) => {
// Join logic
});
socket.on("play_card", (data) => {
try {
const game = games[data.gameId];
const updatedGame = playCard(game, data.card, data.player);
games[data.gameId] = updatedGame;
io.to(data.gameId).emit("card_played", updatedGame);
} catch (error) {
socket.emit("error", { message: error.message });
}
});
};
Key Patterns
io.to(gameId).emit() for public state changessocket.emit() for player-specific data (hands)setTimeout() for delays (e.g., trick collection)Build client-side interface that connects to Socket.IO.
UI Components
Client-Side Socket Integration
const socket = io();
socket.emit("join_game", { gameId, userId });
socket.on("card_played", (data) => {
renderGameState(data);
});
$("#play-card-btn").click(() => {
socket.emit("play_card", { gameId, card, player });
});
State Rendering
Update UI in real-time as server broadcasts state changes.
Game-Over Condition
Implement logic to end game and declare winner.
Persistence (Optional)
Integrate database (PostgreSQL, Redis) to save game state.
UI/UX Polish
Deployment
Deploy to production server with proper monitoring.
Immutable State Management
See references/game-state-management.md for patterns:
// Bad: Mutation
game.currentPlayer = nextPlayer;
// Good: Immutable
return { ...game, currentPlayer: nextPlayer };
Error Handling
Always wrap game logic in try/catch and emit errors to specific players.
Logging
Use templates/execution-log-template.md to track:
See references/common-game-patterns.md for reusable patterns:
Scripts (scripts/):
find_game_templates.py: Search GitHub for similar gamesgenerate_test_suite.py: Create boilerplate test filesvalidate_game_state.py: Validate game state structureTemplates (templates/):
implementation-plan-template.md: Project planning structureexecution-log-template.md: Track implementation progressgame-logic-template.js: Starter code for game modulessocket-handler-template.js: Socket.IO boilerplatetest-suite-template.js: Test structureReferences (references/):
tdd-workflow.md: Detailed TDD processsocketio-patterns.md: Real-time multiplayer patternsgame-state-management.md: State management best practicesgithub-template-evaluation.md: Template selection criteriacommon-game-patterns.md: Reusable game mechanicstools
Generate comprehensive demonstrations showing how to access projects and work across different environments (Manus terminals, personal computers, team collaboration). Use when users ask "how do I access this from another terminal/computer", "how do I share this with my team", "how do I get this on my Mac", or need clarification on Manus persistence vs GitHub usage.
development
Use when you have a spec or requirements for a multi-step task, before touching code
data-ai
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
development
Use when implementing any feature or bugfix, before writing implementation code