FastAPI-Redis SDK Development
redis/fastapi-redis-sdk
Guides development on the fastapi-redis-sdk library itself - its connection lifecycle, dependency-injected caching, and async/sync bridging.
A skill your agent uses when building real-time features with WebSockets or SSE — choosing between the two, implementing connection management and heartbeats, scaling broadcasts across workers with…
$ npx skills add kid-sid/claude-spellbook --skill websockets-sse -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install kid-sid/claude-spellbook websockets-sse --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/kid-sid/claude-spellbook.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/websockets-sse .claude/skills/websockets-sse && rm -rf skills-srcUse ~/.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/
Install the "websockets-sse" agent skill from https://github.com/kid-sid/claude-spellbook/tree/main/skills/websockets-sse into .claude/skills/websockets-sse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "websockets-sse", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/kid-sid/claude-spellbook/tree/main/skills/websockets-sseType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add kid-sid/claude-spellbook --skill websockets-sse -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install kid-sid/claude-spellbook websockets-sse --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kid-sid/claude-spellbook.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/websockets-sse .agents/skills/websockets-sse && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "websockets-sse" agent skill from https://github.com/kid-sid/claude-spellbook/tree/main/skills/websockets-sse into .agents/skills/websockets-sse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "websockets-sse", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add kid-sid/claude-spellbook --skill websockets-sse -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install kid-sid/claude-spellbook websockets-sse --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kid-sid/claude-spellbook.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/websockets-sse .cursor/skills/websockets-sse && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "websockets-sse" agent skill from https://github.com/kid-sid/claude-spellbook/tree/main/skills/websockets-sse into .cursor/skills/websockets-sse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "websockets-sse", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/kid-sid/claude-spellbook.git --path skills/websockets-sse--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add kid-sid/claude-spellbook --skill websockets-sse -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install kid-sid/claude-spellbook websockets-sse --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kid-sid/claude-spellbook.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/websockets-sse .gemini/skills/websockets-sse && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "websockets-sse" agent skill from https://github.com/kid-sid/claude-spellbook/tree/main/skills/websockets-sse into .gemini/skills/websockets-sse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "websockets-sse", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install kid-sid/claude-spellbook websockets-sseInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add kid-sid/claude-spellbook --skill websockets-sse -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/kid-sid/claude-spellbook.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/websockets-sse .github/skills/websockets-sse && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "websockets-sse" agent skill from https://github.com/kid-sid/claude-spellbook/tree/main/skills/websockets-sse into .github/skills/websockets-sse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "websockets-sse", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add kid-sid/claude-spellbook --skill websockets-sse -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install kid-sid/claude-spellbook websockets-sse --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kid-sid/claude-spellbook.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/websockets-sse .opencode/skills/websockets-sse && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "websockets-sse" agent skill from https://github.com/kid-sid/claude-spellbook/tree/main/skills/websockets-sse into .opencode/skills/websockets-sse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "websockets-sse", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
websockets-sseA skill your agent uses when building real-time features with WebSockets or SSE — choosing between the two, implementing connection management and heartbeats, scaling broadcasts across workers with…
Websockets Sse is an agent skill from kid-sid/claude-spellbook. Use when building real-time features with WebSockets or SSE — choosing between the two, implementing connection management and heartbeats, scaling broadcasts across workers with Redis, handling backpressure, writing tests for streaming endpoints, or debugging connection drops and missed events.
Its SKILL.md is about 5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering Realtime and WebSockets. It works with Redis and FastAPI. The repository describes itself as: A curated collection of skills, prompts, and workflows that extend Claude's capabilities — your personal grimoire for AI-powered development. The licence is MIT.
Read from SKILL.md and the folder at commit a7c2ac9. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python and typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Websockets Sse loads about 5k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 766 words of instructions outside code blocks.
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.
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.
The full file from kid-sid/claude-spellbook at commit a7c2ac9, republished under its MIT licence (© kid-sid). 766 words, ~5,016 tokens.
.claude/skills/websockets-sse/SKILL.md (or your agent's skills folder).Real-time communication patterns for FastAPI: WebSockets for bidirectional, SSE for server-push.
| WebSocket | SSE | |
|---|---|---|
| Direction | Bidirectional | Server → client only |
| Protocol | ws:// / wss:// | Plain HTTP |
| Browser reconnect | Manual | Automatic (EventSource) |
| Proxy / CDN support | Needs config | Works everywhere |
| Use case | Chat, collaborative editing, games | Notifications, live feeds, LLM streaming |
| Load balancer sticky sessions | Required (or Redis) | Required (or Redis) |
Rule of thumb: use SSE unless the client needs to send frequent messages (more than form submit). LLM token streaming → SSE. Chat → WebSocket.
import asyncio
from fastapi import APIRouter
from fastapi.responses import StreamingResponse
router = APIRouter()
async def event_generator(task_id: str):
"""Yield SSE-formatted strings."""
while True:
data = await get_next_update(task_id) # your async data source
if data is None:
break
yield f"data: {data}\n\n" # SSE format: "data: ...\n\n"
await asyncio.sleep(0) # yield control to event loop
@router.get("/tasks/{task_id}/stream")
async def stream_task(task_id: str):
return StreamingResponse(
event_generator(task_id),
media_type="text/event-stream",
headers={
"Cache-Control": "no-cache",
"X-Accel-Buffering": "no", # disable nginx buffering
},
)import json
import redis.asyncio as redis
from fastapi import APIRouter, Depends
from fastapi.responses import StreamingResponse
router = APIRouter()
async def stream_from_redis(task_id: str, client: redis.Redis):
"""Read Redis Stream and forward as SSE."""
stream_key = f"task:{task_id}:stream"
last_id = "0-0"
while True:
messages = await client.xread({stream_key: last_id}, count=10, block=5000)
if not messages:
# Heartbeat — keeps connection alive through proxies
yield ": heartbeat\n\n"
continue
for _, entries in messages:
for msg_id, fields in entries:
last_id = msg_id
event_type = fields.get("type", "message")
data = fields.get("data", "")
if event_type == "done":
yield f"event: done\ndata: {{}}\n\n"
return
yield f"event: {event_type}\ndata: {data}\n\n"
@router.get("/tasks/{task_id}/events")
async def task_events(task_id: str, redis_client=Depends(get_redis)):
return StreamingResponse(
stream_from_redis(task_id, redis_client),
media_type="text/event-stream",
headers={"Cache-Control": "no-cache", "X-Accel-Buffering": "no"},
)# Standard event
data: {"status": "running", "progress": 42}\n\n
# Named event (client listens with addEventListener)
event: progress\n
data: {"percent": 42}\n\n
# Event with ID (browser remembers for reconnect)
id: 123\n
event: update\n
data: hello\n\n
# Heartbeat / comment (keeps connection alive, ignored by client)
: ping\n\nfrom fastapi import WebSocket, WebSocketDisconnect, APIRouter
import json
router = APIRouter()
@router.websocket("/ws/{client_id}")
async def websocket_endpoint(websocket: WebSocket, client_id: str):
await websocket.accept()
try:
while True:
# Receive text or JSON
raw = await websocket.receive_text()
message = json.loads(raw)
# Send response
await websocket.send_text(json.dumps({"echo": message, "from": client_id}))
# or: await websocket.send_json({"echo": message})
except WebSocketDisconnect:
print(f"Client {client_id} disconnected")from fastapi import WebSocket
import asyncio
class ConnectionManager:
def __init__(self):
self.active: dict[str, WebSocket] = {}
async def connect(self, client_id: str, ws: WebSocket):
await ws.accept()
self.active[client_id] = ws
def disconnect(self, client_id: str):
self.active.pop(client_id, None)
async def send(self, client_id: str, message: dict):
ws = self.active.get(client_id)
if ws:
try:
await ws.send_json(message)
except Exception:
self.disconnect(client_id)
async def broadcast(self, message: dict, exclude: str | None = None):
dead = []
for cid, ws in self.active.items():
if cid == exclude:
continue
try:
await ws.send_json(message)
except Exception:
dead.append(cid)
for cid in dead:
self.disconnect(cid)
manager = ConnectionManager()
@router.websocket("/ws/{client_id}")
async def ws_endpoint(websocket: WebSocket, client_id: str):
await manager.connect(client_id, websocket)
try:
while True:
data = await websocket.receive_json()
await manager.broadcast(
{"from": client_id, "message": data["text"]},
exclude=client_id,
)
except WebSocketDisconnect:
manager.disconnect(client_id)
await manager.broadcast({"system": f"{client_id} left"})import asyncio
from fastapi import WebSocket
async def keep_alive(ws: WebSocket, interval: int = 30):
"""Send ping every N seconds to detect dead connections."""
while True:
await asyncio.sleep(interval)
try:
await ws.send_json({"type": "ping"})
except Exception:
break
@router.websocket("/ws/{client_id}")
async def ws_with_heartbeat(websocket: WebSocket, client_id: str):
await websocket.accept()
heartbeat = asyncio.create_task(keep_alive(websocket))
try:
while True:
data = await websocket.receive_json()
if data.get("type") == "pong":
continue
await handle_message(data)
except WebSocketDisconnect:
pass
finally:
heartbeat.cancel()Without Redis, broadcast only reaches clients on the same worker process. Redis pub/sub fans out across all workers.
import asyncio
import redis.asyncio as redis
from fastapi import WebSocket
class RedisConnectionManager:
def __init__(self, redis_client: redis.Redis):
self.redis = redis_client
self.local: dict[str, WebSocket] = {}
async def connect(self, client_id: str, ws: WebSocket, room: str):
await ws.accept()
self.local[client_id] = ws
# Subscribe to room channel and forward to this WS
asyncio.create_task(self._subscribe_and_forward(client_id, room, ws))
async def _subscribe_and_forward(self, client_id: str, room: str, ws: WebSocket):
async with self.redis.pubsub() as pubsub:
await pubsub.subscribe(f"room:{room}")
try:
async for msg in pubsub.listen():
if msg["type"] == "message":
await ws.send_text(msg["data"])
except Exception:
pass
async def publish(self, room: str, message: str):
"""Send to all clients in room across all workers."""
await self.redis.publish(f"room:{room}", message)
def disconnect(self, client_id: str):
self.local.pop(client_id, None)const source = new EventSource(`/tasks/${taskId}/events`);
// Default event
source.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data);
};
// Named events
source.addEventListener("progress", (event) => {
const data = JSON.parse(event.data);
setProgress(data.percent);
});
source.addEventListener("done", () => {
source.close();
});
source.onerror = (error) => {
// EventSource auto-reconnects after 3s by default
console.error("SSE error", error);
};
// Manual close
source.close();const ws = new WebSocket(`wss://api.example.com/ws/${clientId}`);
ws.onopen = () => {
ws.send(JSON.stringify({ type: "join", room: "general" }));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.type === "ping") {
ws.send(JSON.stringify({ type: "pong" }));
return;
}
handleMessage(msg);
};
ws.onclose = (event) => {
console.log("Closed:", event.code, event.reason);
// Reconnect with backoff
setTimeout(() => reconnect(), Math.min(1000 * 2 ** attempts, 30000));
};
ws.onerror = (error) => console.error("WS error", error);
// Send
ws.send(JSON.stringify({ type: "message", text: "Hello" }));
ws.close();function useSSE(url: string | null) {
const [data, setData] = useState<string[]>([]);
const [done, setDone] = useState(false);
useEffect(() => {
if (!url) return;
const source = new EventSource(url);
source.onmessage = (e) => setData(prev => [...prev, e.data]);
source.addEventListener("done", () => { setDone(true); source.close(); });
source.onerror = () => source.close();
return () => source.close();
}, [url]);
return { data, done };
}# WebSocket auth via query param (token in URL — use wss:// only)
@router.websocket("/ws")
async def ws_auth(websocket: WebSocket, token: str = Query(...)):
user = decode_jwt(token)
if not user:
await websocket.close(code=1008) # policy violation
return
await websocket.accept()
...
# SSE auth via cookie or Authorization header (handled by FastAPI Depends)
@router.get("/stream")
async def sse_auth(
request: Request,
current_user: User = Depends(get_current_user), # reads Authorization header
):
return StreamingResponse(generator(current_user), media_type="text/event-stream")| Strategy | Broadcast scope | Durability | Reconnect replay | Use when |
|---|---|---|---|---|
| In-process dict | Same worker only | None | No | Single-process dev/test only |
| Sticky sessions (LB) | Same worker only | None | No | < 5k connections, stateful protocol |
| Redis Pub/Sub | All workers | None | No | Chat rooms, live dashboards, fan-out |
| Redis Streams | All workers | Yes (log) | Yes (by ID) | Task streaming, clients that rejoin mid-stream |
Choosing between Pub/Sub and Streams: use Streams when a reconnecting client must replay messages it missed. Pub/Sub messages are fire-and-forget — a client that disconnects for 2 seconds loses everything in that window.
For non-FastAPI stacks. Uses the ws package.
import { WebSocketServer, WebSocket } from 'ws';
import { createServer } from 'http';
import express from 'express';
const app = express();
const server = createServer(app);
const wss = new WebSocketServer({ server });
const clients = new Map<string, WebSocket>();
wss.on('connection', (ws, req) => {
const clientId = new URL(req.url!, 'http://x').searchParams.get('id') ?? crypto.randomUUID();
clients.set(clientId, ws);
// Heartbeat
const ping = setInterval(() => {
if (ws.readyState === WebSocket.OPEN) ws.ping();
}, 30_000);
ws.on('message', (raw) => {
const msg = JSON.parse(raw.toString());
for (const [id, client] of clients) {
if (id !== clientId && client.readyState === WebSocket.OPEN) {
client.send(JSON.stringify({ from: clientId, ...msg }));
}
}
});
ws.on('close', () => {
clients.delete(clientId);
clearInterval(ping);
});
});
server.listen(3000);import express from 'express';
const app = express();
app.get('/stream/:id', (req, res) => {
res.setHeader('Content-Type', 'text/event-stream');
res.setHeader('Cache-Control', 'no-cache');
res.setHeader('X-Accel-Buffering', 'no');
res.flushHeaders();
const send = (event: string, data: unknown) => {
res.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);
};
const heartbeat = setInterval(() => res.write(': ping\n\n'), 30_000);
// Subscribe to your event emitter / Redis channel here
const unsub = eventBus.on(req.params.id, (payload) => send('update', payload));
req.on('close', () => {
clearInterval(heartbeat);
unsub();
});
});A slow client that can't drain its send buffer blocks await ws.send_json() indefinitely, stalling the broadcast loop and starving other clients.
FastAPI — timeout on send:
import asyncio
from fastapi import WebSocket, WebSocketDisconnect
async def safe_send(ws: WebSocket, message: dict, timeout: float = 5.0) -> bool:
"""Returns False and disconnects if client cannot receive within timeout."""
try:
await asyncio.wait_for(ws.send_json(message), timeout=timeout)
return True
except (asyncio.TimeoutError, Exception):
await ws.close(code=1001) # going away
return False
async def broadcast(manager: ConnectionManager, message: dict):
dead = []
for cid, ws in manager.active.items():
ok = await safe_send(ws, message)
if not ok:
dead.append(cid)
for cid in dead:
manager.disconnect(cid)Node.js — check bufferedAmount before sending:
function safeSend(ws: WebSocket, data: string, maxBuffer = 64 * 1024): boolean {
if (ws.bufferedAmount > maxBuffer) {
ws.terminate(); // hard close — don't wait
return false;
}
ws.send(data);
return true;
}from fastapi.testclient import TestClient
from app.main import app
def test_websocket_echo():
client = TestClient(app)
with client.websocket_connect("/ws/user1") as ws:
ws.send_json({"type": "message", "text": "hello"})
data = ws.receive_json()
assert data["from"] == "user1"
assert data["text"] == "hello"
def test_websocket_broadcast():
client = TestClient(app)
with client.websocket_connect("/ws/a") as ws_a, \
client.websocket_connect("/ws/b") as ws_b:
ws_a.send_json({"type": "message", "text": "hi"})
data = ws_b.receive_json()
assert data["from"] == "a"import json
import pytest
from httpx import AsyncClient, ASGITransport
from app.main import app
@pytest.mark.asyncio
async def test_sse_stream():
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
events = []
async with client.stream("GET", "/tasks/task-1/stream") as resp:
assert resp.status_code == 200
async for line in resp.aiter_lines():
if line.startswith("data:"):
events.append(json.loads(line[5:].strip()))
if any(e.get("type") == "done" for e in events):
break
assert len(events) > 0import { WebSocketServer } from 'ws';
import WebSocket from 'ws';
test('broadcasts to other clients', (done) => {
const wss = new WebSocketServer({ port: 0 });
const { port } = wss.address() as { port: number };
setupHandlers(wss); // your connection logic
const a = new WebSocket(`ws://localhost:${port}?id=a`);
const b = new WebSocket(`ws://localhost:${port}?id=b`);
b.on('message', (raw) => {
const msg = JSON.parse(raw.toString());
expect(msg.from).toBe('a');
expect(msg.text).toBe('hello');
wss.close(done);
});
a.on('open', () => a.send(JSON.stringify({ text: 'hello' })));
});dict[str, WebSocket] in memory only contains clients connected to the current worker; workers on different processes or machines never see each other's clients; use Redis pub/sub or Streams to fan out across all workersX-Accel-Buffering: no header on SSE — nginx buffers upstream responses by default and holds SSE data until its internal buffer fills; the client sees bursts instead of real-time events; always set this header on SSE endpointsEventSource after a done event — EventSource auto-reconnects after any close; if the server ends the stream without the client calling source.close(), the browser reconnects and restarts the stream indefinitelytime.sleep() or synchronous DB call inside an async generator blocks the entire event loop and freezes all other SSE connections on that worker; always use await asyncio.sleep(0) to yield controlxread with block=0 — blocking forever (block=0) holds the Redis connection open indefinitely and prevents graceful shutdown; use block=5000 (5-second timeout) and loop, so the generator can detect disconnects and clean upCache-Control: no-cache and X-Accel-Buffering: no headers on SSE responsesawait asyncio.sleep(0) inside SSE generators to yield to event loopevent: done so client knows to close and stop reconnectingxread uses block=5000 (5s timeout) not block=0 (blocks forever)send_json wrapped with timeout; timed-out clients disconnectedTestClient.websocket_connect or an in-process ws server (no real network)AsyncClient.stream + aiter_lines to consume events line-by-linews.bufferedAmount checked before send to detect slow consumers© kid-sid, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/websockets-sse of kid-sid/claude-spellbook.
Open the folder on GitHubat commit a7c2ac9
Websockets Sse 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Websockets Sse this skillkid-sid/claude-spellbook | 189 | — | ~5k | Automated safety check: Pass | MIT | |
| FastAPI-Redis SDK Developmentredis/fastapi-redis-sdk | 404 | — | ~2.5k | Automated safety check: Notes | MIT | |
| Starlettesimonw/research | 783 | — | ~8.6k | Automated safety check: Notes | None | |
| Cb Realtime APIBlkLeg/CircuitBreaker | 201 | — | ~1.7k | Automated safety check: Pass | MIT | |
| Mas API ContractAUTO-MAS-Project/AUTO-MAS | 708 | — | ~1.9k | Automated safety check: Pass | AGPL-3.0 | |
| Fastapi Prodavila7/claude-code-templates | 32k | 8 repos | ~1.6k | Automated safety check: Pass | MIT |
redis/fastapi-redis-sdk
Guides development on the fastapi-redis-sdk library itself - its connection lifecycle, dependency-injected caching, and async/sync bridging.
simonw/research
Build async web applications and APIs with Starlette 1.0, the lightweight ASGI framework for Python.
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…
AUTO-MAS-Project/AUTO-MAS
Define backend API contract standards for FastAPI services. An agent skill from AUTO-MAS-Project/AUTO-MAS.
davila7/claude-code-templates
Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2.
Jeffallan/claude-skills
Builds async Python APIs with FastAPI and Pydantic V2, covering endpoints, JWT authentication, async SQLAlchemy, WebSockets and pytest checks against the OpenAPI docs.
kid-sid/claude-spellbook
A skill your agent uses when building or reviewing UI components for keyboard and screen reader compatibility, adding ARIA to custom widgets, auditing a page for WCAG AA conformance, or preparing…
kid-sid/claude-spellbook
A skill your agent uses when building, wiring, or debugging an Agentex agent — choosing agent type, configuring acp.py and manifest.yaml, using adk.messages or adk.state, or resolving…
kid-sid/claude-spellbook
A skill your agent uses when building production LLM applications — designing RAG pipelines, choosing vector databases, implementing agent orchestration, optimizing cost, or adding AI safety…
kid-sid/claude-spellbook
A skill your agent uses when building or refactoring Angular applications — choosing between signals, RxJS, and NgRx for state, configuring routing with guards and lazy loading, optimizing change…
kid-sid/claude-spellbook
A skill your agent uses when designing new REST endpoints, reviewing an existing API contract, adding pagination or filtering, planning a versioning strategy, or building a public or partner-facing…
kid-sid/claude-spellbook
A skill your agent uses when implementing login flows, issuing or validating JWTs, setting up OAuth2/OIDC with a provider, designing role-based or attribute-based access control, securing API…
Categories
A skill your agent uses when building real-time features with WebSockets or SSE — choosing between the two, implementing connection management and heartbeats, scaling broadcasts across workers with…. Websockets Sse is an agent skill from kid-sid/claude-spellbook. Use when building real-time features with WebSockets or SSE — choosing between the two, implementing connection management and heartbeats, scaling broadcasts across workers with Redis, handling backpressure, writing tests for streaming endpoints, or debugging connection drops and missed events.
Websockets Sse fits situations like: building real-time features with WebSockets; SSE — choosing between the two; implementing connection management and heartbeats; scaling broadcasts across workers with Redis.
Run `npx skills add kid-sid/claude-spellbook --skill websockets-sse -a claude-code`. Or copy the skill folder (skills/websockets-sse in kid-sid/claude-spellbook) into .claude/skills/websockets-sse in your project. Claude Code loads it when a task matches its description.
Run `npx skills add kid-sid/claude-spellbook --skill websockets-sse -a codex`. Or copy the skill folder (skills/websockets-sse in kid-sid/claude-spellbook) into .agents/skills/websockets-sse in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kid-sid/claude-spellbook --skill websockets-sse -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/websockets-sse, .gemini/skills/websockets-sse, .github/skills/websockets-sse and .opencode/skills/websockets-sse in your project.
SKILL.md names no scripts, command-line tools or credentials: Websockets Sse is instructions for the agent only. Our summary lists: Python 3; Node.js.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Websockets Sse is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 5k tokens (SKILL.md is roughly 20k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Websockets Sse: FastAPI-Redis SDK Development (redis/fastapi-redis-sdk, 404 stars), Starlette (simonw/research, 783 stars), Cb Realtime API (BlkLeg/CircuitBreaker, 201 stars) and Mas API Contract (AUTO-MAS-Project/AUTO-MAS, 708 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
kid-sid (a GitHub user) maintains it in kid-sid/claude-spellbook, which has 189 GitHub stars. The repository holds 52 skills in this directory. The repository was last updated on August 5, 2026.
Source: kid-sid/claude-spellbook on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.