Agent skill

WebSocket Engineer

by Jeffallan in Jeffallan/claude-skills

Builds real-time servers with WebSockets or Socket.IO: authentication, rooms, reconnection, Redis-backed horizontal scaling, sticky sessions and monitoring.

MITAuto-check passedBackend & APIs

Install WebSocket Engineer

skills CLI
$ npx skills add Jeffallan/claude-skills --skill websocket-engineer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Jeffallan/claude-skills websocket-engineer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Jeffallan/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/websocket-engineer .claude/skills/websocket-engineer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
websocket-engineer
GitHub stars
12k
Token cost
~1.6k tokens
SKILL.md length
348 words
Files
6 (incl. references)
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

Builds real-time servers with WebSockets or Socket.IO: authentication, rooms, reconnection, Redis-backed horizontal scaling, sticky sessions and monitoring.

  • Works in 6 steps: Analyze requirements — Identify… → Design architecture — Plan clustering,… → Implement — Build WebSocket server with… → …
  • Building a chat or live-notification feature with Socket.IO
  • SKILL.md covers Core Workflow, Reference Guide, Code Examples and Constraints, plus 2 more sections
  • Calls npx; needs JWT_SECRET

What it does

The agent sizes connection scale, message volume and latency needs, plans clustering, pub/sub, state and failover, then builds a server with authentication, rooms and events. Local checks come first, such as connecting with npx wscat, confirming that missing or invalid tokens are rejected and that room join and leave events and message delivery work. Before scaling it verifies a Redis pub/sub round trip, configures sticky sessions, tests across several instances and sets up load balancing, then monitors connections, latency, throughput and error rates.

The rules include sticky sessions, heartbeat ping-pong to detect dead connections, rooms and namespaces instead of filtering in application code, queuing messages during disconnects and planning per-instance connection limits. Reference files cover the protocol, scaling with Redis pub/sub, rooms and broadcasting patterns, security including rate limiting and CORS, and alternatives such as SSE and long polling. Examples show a Socket.IO server with auth, rooms and the Redis adapter, and a client that reconnects with exponential backoff.

When your agent uses it

  • Building a chat or live-notification feature with Socket.IO
  • Scaling a WebSocket server across instances with the Redis adapter
  • Adding authentication and rooms to a real-time server
  • Making clients reconnect cleanly with backoff
  • Deciding between WebSockets, SSE and long polling

Example prompts

  • “Add a Socket.IO server with token authentication and per-project rooms to our Node API.”
  • “Scale the chat service to several instances with the Redis adapter and sticky sessions.”
  • “Write the client reconnection logic with exponential backoff and queued messages.”
  • “Compare WebSockets with server-sent events for our live dashboard.”

Requirements

  • Redis for multi-instance scaling

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Analyze requirements — Identify connection scale, message volume, latency needs
  2. Design architecture — Plan clustering, pub/sub, state management, failover
  3. Implement — Build WebSocket server with authentication, rooms, events
  4. Validate locally — Test connection handling, auth, and room behavior before scaling (e.g., npx wscat -c ws://localhost:3000); confirm auth…
  5. Scale — Verify Redis connection and pub/sub round-trip before enabling the adapter; configure sticky sessions and confirm with test…
  6. Monitor — Track connections, latency, throughput, error rates; add alerts for connection-count spikes and error-rate thresholds

What it can do on your machine

Read from SKILL.md and the folder at commit 1be15d8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • synergetic.solutions
    • jeffallan.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • JWT_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

WebSocket Engineer loads about 1.6k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 50 tokens; SKILL.md has 348 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Jeffallan/claude-skills at commit 1be15d8, republished under its MIT licence (© Jeffallan). 348 words, ~1,642 tokens.

Download SKILL.mdSave it as .claude/skills/websocket-engineer/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
websocket-engineer
description
Use when building real-time communication systems with WebSockets or Socket.IO. Invoke for bidirectional messaging, horizontal scaling with Redis, presence tracking, room management.
license
MIT
metadata.author
https://github.com/Jeffallan
metadata.company
https://synergetic.solutions
metadata.version
1.1.0
metadata.domain
api-architecture
metadata.triggers
WebSocket, Socket.IO, real-time communication, bidirectional messaging, pub/sub, server push, live updates, chat systems, presence tracking
metadata.role
specialist
metadata.scope
implementation
metadata.output-format
code
metadata.related-skills
fastapi-expert, nestjs-expert, devops-engineer, monitoring-expert, security-reviewer

WebSocket Engineer

Core Workflow

  1. Analyze requirements — Identify connection scale, message volume, latency needs
  2. Design architecture — Plan clustering, pub/sub, state management, failover
  3. Implement — Build WebSocket server with authentication, rooms, events
  4. Validate locally — Test connection handling, auth, and room behavior before scaling (e.g., npx wscat -c ws://localhost:3000); confirm auth rejection on missing/invalid tokens, room join/leave events, and message delivery
  5. Scale — Verify Redis connection and pub/sub round-trip before enabling the adapter; configure sticky sessions and confirm with test connections across multiple instances; set up load balancing
  6. Monitor — Track connections, latency, throughput, error rates; add alerts for connection-count spikes and error-rate thresholds

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Protocolreferences/protocol.mdWebSocket handshake, frames, ping/pong, close codes
Scalingreferences/scaling.mdHorizontal scaling, Redis pub/sub, sticky sessions
Patternsreferences/patterns.mdRooms, namespaces, broadcasting, acknowledgments
Securityreferences/security.mdAuthentication, authorization, rate limiting, CORS
Alternativesreferences/alternatives.mdSSE, long polling, when to choose WebSockets

Code Examples

Server Setup (Socket.IO with Auth and Room Management)
js
import { createServer } from "http";
import { Server } from "socket.io";
import { createAdapter } from "@socket.io/redis-adapter";
import { createClient } from "redis";
import jwt from "jsonwebtoken";

const httpServer = createServer();
const io = new Server(httpServer, {
  cors: { origin: process.env.ALLOWED_ORIGIN, credentials: true },
  pingTimeout: 20000,
  pingInterval: 25000,
});

// Authentication middleware — runs before connection is established
io.use((socket, next) => {
  const token = socket.handshake.auth.token;
  if (!token) return next(new Error("Authentication required"));
  try {
    socket.data.user = jwt.verify(token, process.env.JWT_SECRET);
    next();
  } catch {
    next(new Error("Invalid token"));
  }
});

// Redis adapter for horizontal scaling
const pubClient = createClient({ url: process.env.REDIS_URL });
const subClient = pubClient.duplicate();
await Promise.all([pubClient.connect(), subClient.connect()]);
io.adapter(createAdapter(pubClient, subClient));

io.on("connection", (socket) => {
  const { userId } = socket.data.user;
  console.log(`connected: ${userId} (${socket.id})`);

  // Presence: mark user online
  pubClient.hSet("presence", userId, socket.id);

  socket.on("join-room", (roomId) => {
    socket.join(roomId);
    socket.to(roomId).emit("user-joined", { userId });
  });

  socket.on("message", ({ roomId, text }) => {
    io.to(roomId).emit("message", { userId, text, ts: Date.now() });
  });

  socket.on("disconnect", () => {
    pubClient.hDel("presence", userId);
    console.log(`disconnected: ${userId}`);
  });
});

httpServer.listen(3000);
Client-Side Reconnection with Exponential Backoff
js
import { io } from "socket.io-client";

const socket = io("wss://api.example.com", {
  auth: { token: getAuthToken() },
  reconnection: true,
  reconnectionAttempts: 10,
  reconnectionDelay: 1000,       // initial delay (ms)
  reconnectionDelayMax: 30000,   // cap at 30 s
  randomizationFactor: 0.5,      // jitter to avoid thundering herd
});

// Queue messages while disconnected
let messageQueue = [];

socket.on("connect", () => {
  console.log("connected:", socket.id);
  // Flush queued messages
  messageQueue.forEach((msg) => socket.emit("message", msg));
  messageQueue = [];
});

socket.on("disconnect", (reason) => {
  console.warn("disconnected:", reason);
  if (reason === "io server disconnect") socket.connect(); // manual reconnect
});

socket.on("connect_error", (err) => {
  console.error("connection error:", err.message);
});

function sendMessage(roomId, text) {
  const msg = { roomId, text };
  if (socket.connected) {
    socket.emit("message", msg);
  } else {
    messageQueue.push(msg); // buffer until reconnected
  }
}

Constraints

MUST DO
  • Use sticky sessions for load balancing (WebSocket connections are stateful — requests must route to the same server instance)
  • Implement heartbeat/ping-pong to detect dead connections (TCP keepalive alone is insufficient)
  • Use rooms/namespaces for message scoping rather than filtering in application logic
  • Queue messages during disconnection windows to avoid silent data loss
  • Plan connection limits per instance before scaling horizontally
MUST NOT DO
  • Store large state in memory without a clustering strategy (use Redis or an external store)
  • Mix WebSocket and HTTP on the same port without explicit upgrade handling
  • Forget to handle connection cleanup (presence records, room membership, in-flight timers)
  • Skip load testing before production — connection-count spikes behave differently from HTTP traffic spikes

Output Templates

When implementing WebSocket features, provide:

  1. Server setup (Socket.IO/ws configuration)
  2. Event handlers (connection, message, disconnect)
  3. Client library (connection, events, reconnection)
  4. Brief explanation of scaling strategy

Knowledge Reference

Socket.IO, ws, uWebSockets.js, Redis adapter, sticky sessions, nginx WebSocket proxy, JWT over WebSocket, rooms/namespaces, acknowledgments, binary data, compression, heartbeat, backpressure, horizontal pod autoscaling

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

© Jeffallan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/websocket-engineer of Jeffallan/claude-skills.

  • SKILL.md
  • references/alternatives.md
  • references/patterns.md
  • references/protocol.md
  • references/scaling.md
  • references/security.md

Open the folder on GitHubat commit 1be15d8

Compare with similar skills

WebSocket Engineer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

WebSocket Engineer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
WebSocket Engineer this skillJeffallan/claude-skills12k—~1.6kAutomated safety check: PassMIT
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Backendredis/RedisInsight8.9k—~1.6kAutomated safety check: PassCustom licence
FastAPI-Redis SDK Developmentredis/fastapi-redis-sdk404—~2.5kAutomated safety check: NotesMIT
Pulse DevelopmentMineTrax/minetrax1151 repos~1.7kAutomated safety check: PassMIT
Starlettesimonw/research781—~8.6kAutomated safety check: NotesNone

Similar skills

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Backend

    redis/RedisInsight

    Official

    NestJS backend development patterns for the RedisInsight API: module structure, services, controllers, DTOs, dependency injection, and error handling.

    8.9k GitHub stars~1.6k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • FastAPI-Redis SDK Development

    redis/fastapi-redis-sdk

    Official

    Guides development on the fastapi-redis-sdk library itself - its connection lifecycle, dependency-injected caching, and async/sync bridging.

    404 GitHub stars~2.5k tokensUpdated 6 days ago
    Backend & APIsAuto-check: notes
  • Pulse Development

    MineTrax/minetrax

    Handles Laravel Pulse setup, configuration, and custom card development.

    115 GitHub starsUsed in 1 repo~1.7k tokens
    Backend & APIsAuto-check passed
  • Starlette

    simonw/research

    Build async web applications and APIs with Starlette 1.0, the lightweight ASGI framework for Python.

    781 GitHub stars~8.6k tokensUpdated 2 days ago
    Backend & APIsAuto-check: notes
  • Reference for Nitro v3, the server toolkit behind Nuxt: file routing, route rules, caching, storage, tasks, websockets and deployment presets.

    5.9k GitHub stars~948 tokensUpdated 7 days ago
    Backend & APIsAuto-check passed

More from Jeffallan/claude-skills

All 58 skills in this repo
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Auto-check passed
  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Fine-Tuning Expert

    Jeffallan/claude-skills

    Guides LLM fine-tuning with LoRA and QLoRA through Hugging Face PEFT, from dataset validation and training checks to adapter merging, quantization and deployment.

    12k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • GraphQL Architect

    Jeffallan/claude-skills

    Designs GraphQL schemas and Apollo Federation graphs, with DataLoader resolvers, subscriptions, query complexity limits and caching.

    12k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Kubernetes Specialist

    Jeffallan/claude-skills

    Creates and checks Kubernetes manifests, Helm charts, RBAC and network policies, and helps debug pod problems, with kubectl checks and rollback steps.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Laravel Specialist

    Jeffallan/claude-skills

    Builds Laravel 10+ applications with Eloquent models, Sanctum authentication, Horizon queues, API resources and Livewire components, tested with Pest or PHPUnit.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed

Works with

Categories

Questions about WebSocket Engineer

What does WebSocket Engineer do?

Builds real-time servers with WebSockets or Socket.IO: authentication, rooms, reconnection, Redis-backed horizontal scaling, sticky sessions and monitoring. The agent sizes connection scale, message volume and latency needs, plans clustering, pub/sub, state and failover, then builds a server with authentication, rooms and events. Local checks come first, such as connecting with npx wscat, confirming that missing or invalid tokens are rejected and that room join and leave events and message delivery work.

When should I use WebSocket Engineer?

WebSocket Engineer fits situations like: building a chat or live-notification feature with Socket.IO; scaling a WebSocket server across instances with the Redis adapter; adding authentication and rooms to a real-time server; making clients reconnect cleanly with backoff.

How do I install WebSocket Engineer in Claude Code?

Run `npx skills add Jeffallan/claude-skills --skill websocket-engineer -a claude-code`. Or copy the skill folder (skills/websocket-engineer in Jeffallan/claude-skills) into .claude/skills/websocket-engineer in your project. Claude Code loads it when a task matches its description.

How do I install WebSocket Engineer in Codex?

Run `npx skills add Jeffallan/claude-skills --skill websocket-engineer -a codex`. Or copy the skill folder (skills/websocket-engineer in Jeffallan/claude-skills) into .agents/skills/websocket-engineer in your project. Codex loads it when a task matches its description.

Can I use WebSocket Engineer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Jeffallan/claude-skills --skill websocket-engineer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/websocket-engineer, .gemini/skills/websocket-engineer, .github/skills/websocket-engineer and .opencode/skills/websocket-engineer in your project.

What does WebSocket Engineer need to run?

Going by SKILL.md and its folder, WebSocket Engineer needs the command-line tools its instructions call (npx) and credentials named JWT_SECRET. Our summary lists: Redis for multi-instance scaling.

Does WebSocket Engineer access the network?

SKILL.md names 3 domains. As links in the text: github.com, synergetic.solutions and jeffallan.github.io. This is read from the text; nothing was executed.

Is WebSocket Engineer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does WebSocket Engineer use?

WebSocket Engineer is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does WebSocket Engineer use?

About 1.6k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 10k tokens, read only when the agent opens those files.

What are the alternatives to WebSocket Engineer?

Skills that share tags, products or a category with WebSocket Engineer: Configuring Horizon (coollabsio/coolify, 63k stars), Backend (redis/RedisInsight, 8.9k stars), FastAPI-Redis SDK Development (redis/fastapi-redis-sdk, 404 stars) and Pulse Development (MineTrax/minetrax, 115 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains WebSocket Engineer?

Jeffallan (a GitHub user) maintains it in Jeffallan/claude-skills, which has 11,754 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on October 3, 2026.

Source: Jeffallan/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.