Agent skill

Building Websocket Server

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Build scalable WebSocket servers for real-time bidirectional communication.

MITAuto-check passedBackend & APIs

Install Building Websocket Server

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-websocket-server -a claude-code

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

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace building-websocket-server --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/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/building-websocket-server .claude/skills/building-websocket-server && 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
building-websocket-server
GitHub stars
2.8k
Token cost
~1.3k tokens
SKILL.md length
531 words
Files
4 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Build scalable WebSocket servers for real-time bidirectional communication.

  • Works in 9 steps: Examine existing HTTP server… → Create a WebSocket server instance… → Implement connection authentication by… → …
  • Enabling real-time bidirectional communication
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Building Websocket Server is an agent skill from jeremylongshore/tons-of-skills-marketplace. Build scalable WebSocket servers for real-time bidirectional communication. Use when enabling real-time bidirectional communication. Trigger with phrases like "build WebSocket server", "add real-time API", or "implement WebSocket".

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/errors.md`, `references/examples.md` and `references/implementation.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Realtime and WebSockets. It works with Redis. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Enabling real-time bidirectional communication
  • With phrases like build WebSocket server
  • Add real-time API
  • Implement WebSocket

Example prompts

  • “build WebSocket server”
  • “add real-time API”
  • “implement WebSocket”
  • “/building-websocket-server”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(api:websocket-*)

Workflow steps

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

  1. Examine existing HTTP server configuration using Read and Grep to determine the framework and identify where WebSocket upgrade handling…
  2. Create a WebSocket server instance attached to the existing HTTP server, configuring the upgrade path (e.g., /ws, /socket.io) and allowed…
  3. Implement connection authentication by validating JWT tokens or session cookies during the WebSocket handshake upgrade event, rejecting…
  4. Build a connection registry that tracks active clients with metadata (user ID, subscribed channels, connection time) for targeted message…
  5. Define a message protocol using JSON envelopes with type, channel, payload, and correlationId fields for structured bidirectional…
  6. Implement room/channel subscription logic allowing clients to join and leave named channels with server-side membership tracking.
  7. Add heartbeat ping/pong mechanism with configurable interval (default 30s) and timeout detection to clean up stale connections.
  8. Configure Redis pub/sub adapter for horizontal scaling so messages broadcast from any server instance reach all connected clients across…
  9. Write connection lifecycle tests covering connect, authenticate, subscribe, message exchange, reconnect, and graceful disconnect scenarios.

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(api:websocket-*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    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):

    • socket.io
    • github.com

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Building Websocket Server loads about 1.3k tokens when it runs, and up to ~4.1k if it reads all its reference files. Until then it costs about 64 tokens; SKILL.md has 531 words of instructions outside code blocks.

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

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 jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 531 words, ~1,306 tokens.

Download SKILL.mdSave it as .claude/skills/building-websocket-server/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
building-websocket-server
description
Build scalable WebSocket servers for real-time bidirectional communication. Use when enabling real-time bidirectional communication. Trigger with phrases like "build WebSocket server", "add real-time API", or "implement WebSocket".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(api:websocket-*)
compatibility
Designed for Claude Code
version
1.25.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
api, scaling, websocket-server

Building WebSocket Server

Overview

Build scalable WebSocket servers for real-time bidirectional communication using the ws library, Socket.IO, or native framework WebSocket support. Handle connection lifecycle management, room/channel subscriptions, message broadcasting, heartbeat keepalive, and horizontal scaling with Redis pub/sub adapters.

Prerequisites

  • Node.js 18+ with ws or socket.io, or Python 3.10+ with websockets or FastAPI WebSocket, or Go with gorilla/websocket
  • Redis for horizontal scaling with pub/sub adapter (Socket.IO Redis adapter, or manual pub/sub)
  • Load balancer configured for WebSocket upgrade (sticky sessions or proper Upgrade header forwarding)
  • JWT or session-based authentication for connection handshake
  • Monitoring for active connection counts and message throughput

Instructions

  1. Examine existing HTTP server configuration using Read and Grep to determine the framework and identify where WebSocket upgrade handling integrates.
  2. Create a WebSocket server instance attached to the existing HTTP server, configuring the upgrade path (e.g., /ws, /socket.io) and allowed origins.
  3. Implement connection authentication by validating JWT tokens or session cookies during the WebSocket handshake upgrade event, rejecting unauthorized connections before protocol switch.
  4. Build a connection registry that tracks active clients with metadata (user ID, subscribed channels, connection time) for targeted message delivery.
  5. Define a message protocol using JSON envelopes with type, channel, payload, and correlationId fields for structured bidirectional communication.
  6. Implement room/channel subscription logic allowing clients to join and leave named channels with server-side membership tracking.
  7. Add heartbeat ping/pong mechanism with configurable interval (default 30s) and timeout detection to clean up stale connections.
  8. Configure Redis pub/sub adapter for horizontal scaling so messages broadcast from any server instance reach all connected clients across the cluster.
  9. Write connection lifecycle tests covering connect, authenticate, subscribe, message exchange, reconnect, and graceful disconnect scenarios.

See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full implementation guide.

Output

  • ${CLAUDE_SKILL_DIR}/src/ws/server.js - WebSocket server setup and upgrade handling
  • ${CLAUDE_SKILL_DIR}/src/ws/handlers/ - Per-message-type handler functions
  • ${CLAUDE_SKILL_DIR}/src/ws/rooms.js - Room/channel subscription management
  • ${CLAUDE_SKILL_DIR}/src/ws/registry.js - Active connection tracking registry
  • ${CLAUDE_SKILL_DIR}/src/ws/heartbeat.js - Ping/pong keepalive logic
  • ${CLAUDE_SKILL_DIR}/src/ws/adapters/redis.js - Redis pub/sub adapter for scaling
  • ${CLAUDE_SKILL_DIR}/tests/ws/ - WebSocket connection and messaging tests
Show full SKILL.md (208 more words)Show less

Error Handling

ErrorCauseSolution
401 during upgradeJWT token missing or expired in handshake query/headersReject upgrade with HTTP 401 before WebSocket protocol switch completes
1008 Policy ViolationClient sends malformed message or violates protocolSend close frame with code 1008 and human-readable reason; log violation
1006 Abnormal ClosureNetwork interruption without close handshakeDetect via heartbeat timeout; clean up connection registry; notify room members
Memory leakConnection registry grows unbounded from stale entriesImplement heartbeat-based cleanup sweep every 60s; enforce max connections per server
Message stormSingle client flooding messages beyond acceptable rateApply per-connection message rate limiting; disconnect abusive clients with 1008

Refer to ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error patterns.

Examples

Chat application: Multi-room chat server where clients join named rooms, receive member presence updates, and see real-time message delivery with typing indicators via separate message types.

Live dashboard: Server pushes metric updates to subscribed dashboard clients every second, with initial state snapshot on connection and incremental deltas thereafter.

Collaborative editing: Operational transformation relay server that receives edit operations from clients, transforms against concurrent operations, and broadcasts resolved changes to all document subscribers.

See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.

Resources

© jeremylongshore, 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 3 other files (references) in skills/.curated/building-websocket-server of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/errors.md
  • references/examples.md
  • references/implementation.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Building Websocket Server 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.

Building Websocket Server compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Building Websocket Server this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.3kAutomated safety check: PassMIT
Cb Realtime APIBlkLeg/CircuitBreaker201—~1.7kAutomated safety check: PassMIT
WebSocket EngineerJeffallan/claude-skills12k—~1.6kAutomated safety check: PassMIT
Centrifugopedronauck/skills634—~3.1kAutomated safety check: PassNone
Ak Cloud Deployyaalalabs/agent-kernel192—~14kAutomated safety check: PassApache-2.0
Nestjs Real TimeHoangNguyen0403/agent-skills-standard572—~893Automated safety check: PassMIT

Similar skills

  • Cb Realtime API

    BlkLeg/CircuitBreaker

    How Circuit Breaker moves data between backend and frontend — the NATS internal bus, Redis pub/sub, the WebSocket stream endpoints and their first-message JWT handshake, SSE log/event streams, and…

    201 GitHub stars~1.7k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • WebSocket Engineer

    Jeffallan/claude-skills

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

    12k GitHub stars~1.6k tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • Centrifugo

    pedronauck/skills

    Centrifugo real-time messaging server expert for WebSocket PUB/SUB, channel management, JWT authentication, event proxying, and horizontal scaling with Redis/NATS.

    634 GitHub stars~3.1k tokensUpdated 25 days ago
    Backend & APIsAuto-check passed
  • Ak Cloud Deploy

    yaalalabs/agent-kernel

    Deploy an Agent Kernel project to AWS, Azure, or GCP using Terraform modules, or to any Kubernetes cluster (on-prem, baremetal, EKS) using the official Helm chart.

    192 GitHub stars~14k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Nestjs Real Time

    HoangNguyen0403/agent-skills-standard

    Implement WebSocket gateways with Socket.io and Server-Sent Events endpoints in NestJS.

    572 GitHub stars~893 tokensUpdated today
    Backend & APIsAuto-check passed
  • Websocket Implementation

    secondsky/claude-skills

    Implements real-time WebSocket communication with connection management, room-based messaging, and horizontal scaling.

    227 GitHub stars~1.6k tokensUpdated 12 days ago
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Building Websocket Server

What does Building Websocket Server do?

Build scalable WebSocket servers for real-time bidirectional communication. Building Websocket Server is an agent skill from jeremylongshore/tons-of-skills-marketplace. Build scalable WebSocket servers for real-time bidirectional communication.

When should I use Building Websocket Server?

Building Websocket Server fits situations like: enabling real-time bidirectional communication; with phrases like build WebSocket server; add real-time API; implement WebSocket.

How do I install Building Websocket Server in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-websocket-server -a claude-code`. Or copy the skill folder (skills/.curated/building-websocket-server in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/building-websocket-server in your project. Claude Code loads it when a task matches its description.

How do I install Building Websocket Server in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-websocket-server -a codex`. Or copy the skill folder (skills/.curated/building-websocket-server in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/building-websocket-server in your project. Codex loads it when a task matches its description.

Can I use Building Websocket Server 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 jeremylongshore/tons-of-skills-marketplace --skill building-websocket-server -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/building-websocket-server, .gemini/skills/building-websocket-server, .github/skills/building-websocket-server and .opencode/skills/building-websocket-server in your project.

What does Building Websocket Server need to run?

SKILL.md names no scripts, command-line tools or credentials: Building Websocket Server is instructions for the agent only. Our summary lists: Python 3; Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(api:websocket-*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Building Websocket Server access the network?

SKILL.md names 2 domains. As links in the text: socket.io and github.com. This is read from the text; nothing was executed.

Is Building Websocket Server 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 Building Websocket Server use?

Building Websocket Server 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 Building Websocket Server use?

About 1.3k tokens (SKILL.md is roughly 5.2k 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 2.8k tokens, read only when the agent opens those files.

What are the alternatives to Building Websocket Server?

Skills that share tags, products or a category with Building Websocket Server: Cb Realtime API (BlkLeg/CircuitBreaker, 201 stars), WebSocket Engineer (Jeffallan/claude-skills, 12k stars), Centrifugo (pedronauck/skills, 634 stars) and Ak Cloud Deploy (yaalalabs/agent-kernel, 192 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Building Websocket Server?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

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