realtime

Migrates Express and React synchronization from polling to Socket.io WebSocket events.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/levori119/skyboard --skill realtime-levori119
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: realtime
Source: https://github.com/levori119/skyboard/tree/main/.claude/skills/realtime
Command: npx skills add https://github.com/levori119/skyboard --skill realtime-levori119

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires socket.io, socket.io-client.

What problem does it solve? The SKY-KING air traffic control system currently relies on polling, where each workstation queries the server every ~5 seconds for strips, transfers, zone assignments, and activity logs. This causes up to 5 seconds of delay between workstations and unnecessary database load. ## Core Features & Use Cases - Socket.io Architecture Blueprint: Provides a complete client-server event flow with rooms per workstation preset, covering strip updates, transfers, and zone assignments. - Event Catalog: Defines concrete Server-to-Client events (strip_updated, strip_created, transfer_incoming, zone_updated) and Client-to-Server events (join_workstation, leave_workstation) ready to implement. - Phased Migration Plan: Guides a gradual rollout—add WebSocket first, extend polling interval to 30s, then remove polling only after a week of stable operation. - Use Case: Before implementing real-time sync between control tower (TWR) and flight controller (CTRL) positions, activate this playbook to get the recommended Socket.io setup, code snippets for server.js and App.tsx, and safety rules. ## Quick Start Activate the realtime playbook before starting any work on cross-workstation synchronization to get the Socket.io migration plan and event definitions.

Frequently Asked Questions about realtime

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

FAQPage Schema
How do I replace polling with WebSocket in an Express and React app?▼

Add Socket.io to the Express server by wrapping it with createServer, emit events after each database save, and connect from React using socket.io-client. Keep polling active initially, then extend the interval and remove it once WebSocket proves stable.

Why use Socket.io instead of native WebSocket?▼

Socket.io provides automatic fallback to long-polling when WebSocket is unavailable, built-in rooms and namespaces for routing events to specific workstations, automatic reconnection, and easy integration with an existing Express server.

How do I send real-time updates to specific workstations with Socket.io?▼

Use Socket.io rooms: have each client emit join_workstation with its presetId, then call socket.join with a room name like preset_<id>. The server targets updates with io.to(room).emit so only affected workstations receive events.

When is it safe to remove polling after adding WebSocket?▼

Remove polling only after the WebSocket layer runs stable for about a week. First add WebSocket alongside polling, then extend the polling interval to 30 seconds, and finally remove it once reliability is confirmed.

What happens if the WebSocket connection drops during operation?▼

Every WebSocket event must have a fallback path when the socket is disconnected, which is why polling is retained during migration. Socket.io also reconnects automatically, and clients re-emit join_workstation on reconnect or refresh.