Build and maintain a fullstack multiplayer worm game with React frontend and Node.js/Express/WS backend following PRD specifications
Instructions for building and maintaining a fullstack multiplayer worm game backend and frontend.
This is a fullstack multiplayer worm game with a React/TypeScript/Vite frontend and Node.js/Express/WS backend.
**Frontend:**
**Backend:**
1. **Frontend Development**
- Use React with TypeScript for all UI components
- Build with Vite for fast development and optimized production builds
- Implement WebSocket communication using the native WebSocket API only
- Style all components with vanilla CSS - no preprocessors or frameworks
- Maintain type safety throughout the codebase
2. **Backend Development**
- Use Express for HTTP server and routing
- Implement WebSocket server using the WS library
- Handle real-time multiplayer game state synchronization
- Manage player connections, disconnections, and reconnections
- Implement game loop and physics calculations server-side
3. **Game Architecture**
- Follow all feature and gameplay requirements defined in PRD.md
- Implement authoritative server architecture (server validates all moves)
- Use WebSockets for bidirectional real-time communication
- Handle latency compensation and prediction on the client side
- Implement collision detection and game state updates server-side
4. **Code Organization**
- Separate client and server code into distinct directories
- Share TypeScript types/interfaces between frontend and backend
- Use environment variables for configuration
- Implement proper error handling on both client and server
5. **Development Workflow**
- Reference PRD.md for all feature specifications before implementing
- Write clean, maintainable code with clear naming conventions
- Add comments for complex game logic or algorithms
- Test multiplayer scenarios thoroughly
When asked to add a feature:
1. First check PRD.md for relevant specifications
2. Implement server-side logic with Express/WS
3. Add corresponding client-side logic with React/TypeScript
4. Use raw WebSocket API for real-time communication
5. Style with vanilla CSS
When debugging multiplayer issues:
1. Verify server-side game state is authoritative
2. Check WebSocket message format and handling
3. Ensure client prediction reconciles with server state
4. Test edge cases like disconnections and lag
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/worm-game-multiplayer-backend/raw