Borrowing it
Nothing to install: this file belongs to cohen-liel/hivemind. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/cohen-liel/hivemind/main/.claude/skills/websockets-realtime/SKILL.mdgit clone --depth 1 https://github.com/cohen-liel/hivemindWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/cohen-liel/hivemind/websockets-realtime)<a href="https://agentmods.dev/skills/cohen-liel/hivemind/websockets-realtime"><img src="https://agentmods.dev/badge/skills/cohen-liel/hivemind/websockets-realtime/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/cohen-liel/hivemind/websockets-realtime"><img src="https://agentmods.dev/badge/skills/cohen-liel/hivemind/websockets-realtime.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00037 | $0.01219 |
| Opus 5 | $0.00018 | $0.00609 |
| Sonnet 5 | $0.00007 | $0.00244 |
| Haiku 4.5 | $0.00004 | $0.00122 |
Grade A, and why
websockets-realtime scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.
WebSockets & Real-Time Patterns
FastAPI WebSocket
from fastapi import WebSocket, WebSocketDisconnect
from typing import Dict, Set
class ConnectionManager:
def __init__(self):
# room_id → set of connected websockets
self.rooms: Dict[str, Set[WebSocket]] = {}
async def connect(self, ws: WebSocket, room: str):
await ws.accept()
self.rooms.setdefault(room, set()).add(ws)
def disconnect(self, ws: WebSocket, room: str):
if room in self.rooms:
self.rooms[room].discard(ws)
async def broadcast(self, room: str, message: dict):
dead = set()
for ws in self.rooms.get(room, set()):
try:
await ws.send_json(message)
except Exception:
dead.add(ws)
for ws in dead:
self.disconnect(ws, room)
async def send_personal(self, ws: WebSocket, message: dict):
await ws.send_json(message)
manager = ConnectionManager()
@app.websocket("/ws/{room_id}")
async def websocket_endpoint(ws: WebSocket, room_id: str, token: str = Query(...)):
# Auth
user = await verify_token(token)
if not user:
await ws.close(code=4001, reason="Unauthorized")
return
await manager.connect(ws, room_id)
await manager.broadcast(room_id, {"type": "user_joined", "user": user.name})
try:
while True:
data = await ws.receive_json()
# Validate message
if data.get("type") == "message":
msg = {"type": "message", "user": user.name, "text": data["text"][:1000]}
await manager.broadcast(room_id, msg)
except WebSocketDisconnect:
manager.disconnect(ws, room_id)
await manager.broadcast(room_id, {"type": "user_left", "user": user.name})
Server-Sent Events (SSE) — simpler than WS for server→client
from fastapi.responses import StreamingResponse
import asyncio
@app.get("/events/{channel}")
async def event_stream(channel: str, request: Request):
async def generator():
queue: asyncio.Queue = asyncio.Queue()
subscribers[channel].add(queue)
try:
while True:
if await request.is_disconnected():
break
try:
event = await asyncio.wait_for(queue.get(), timeout=30)
yield f"data: {json.dumps(event)}\n\n"
except asyncio.TimeoutError:
yield ": heartbeat\n\n" # Keep connection alive
finally:
subscribers[channel].discard(queue)
return StreamingResponse(
generator(),
media_type="text/event-stream",
headers={"Cache-Control": "no-cache", "X-Accel-Buffering": "no"}
)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 163 lines · 37 tokens per session scan A 5fe2ddc620ab
websockets-realtime is a skill published in the GitHub repository cohen-liel/hivemind (108 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 1,219 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
build-teaql-app
Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…
om-system-extension
Extend installed Open Mercato modules through UMES enrichers, interceptors, mutation guards, widgets, menus, entity extensions, events, component/page replacements, and overrides. Use for "extend core", "add field/column/action", "hide page", "intercept API", "UMES", or "rozszerz moduł".
memstack-automation-webhook-designer
Use this skill when the user says 'webhook', 'webhook handler', 'webhook endpoint', 'receive events', 'HMAC verification', 'idempotency', or needs secure webhook handlers with signature verification, retry handling, and dead letter queues. Do NOT use for full n8n workflows or scheduled tasks.
api-contract
A guide for defining and reviewing an API contract: the agreed shape of requests, responses, authentication, errors, and compatibility rules between services. It can also guide OpenAPI checks and contract testing, which verifies that systems follow those agreements.
ring:migrating-to-lib-observability
Migrating a Lerian Go app off lib-commons observability imports (deprecated shims or removed APIs) to lib-observability via a fixed mapping table, then bumps go.mod and validates the build; ring:backend-go applies the edits. Covers log/zap/runtime/assert, opentelemetry/tracing, HTTP middleware, context helpers, and…
ring:mapping-streaming-events
Mapping the eventable points in a Lerian Go service where lib-streaming should emit past-tense, durable, tenant-scoped business events, producing a PM-validated event catalog and instrumentation-map.json for ring:instrumenting-streaming-events. Three-pass discovery (Survey, Slice, Mark) with a scope fence and delivery…