.claude/skills/ts-centrifugo/SKILL.md
You are an expert in Centrifugo, the scalable real-time messaging server. You help developers add WebSocket-based real-time features (chat, notifications, live updates, presence) to any application with a language-agnostic server that handles millions of concurrent connections — publishing from your backend via HTTP/gRPC API while clients subscribe via WebSocket, SSE, or HTTP streaming.
npx skillsauth add eliferjunior/Claude centrifugoInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert in Centrifugo, the scalable real-time messaging server. You help developers add WebSocket-based real-time features (chat, notifications, live updates, presence) to any application with a language-agnostic server that handles millions of concurrent connections — publishing from your backend via HTTP/gRPC API while clients subscribe via WebSocket, SSE, or HTTP streaming.
# Docker
docker run -d --name centrifugo -p 8000:8000 \
centrifugo/centrifugo:latest centrifugo \
--token_hmac_secret_key="your-secret" \
--api_key="your-api-key" \
--admin --admin_password="admin" \
--allowed_origins="*"
# Config file (config.json)
{
"token_hmac_secret_key": "your-256-bit-secret",
"api_key": "your-api-key",
"allowed_origins": ["https://myapp.com"],
"namespaces": [
{
"name": "chat",
"presence": true,
"join_leave": true,
"history_size": 100,
"history_ttl": "300s",
"force_recovery": true
},
{
"name": "notifications",
"presence": false,
"history_size": 50,
"history_ttl": "86400s"
}
]
}
import { Centrifuge } from "centrifuge";
const client = new Centrifuge("ws://localhost:8000/connection/websocket", {
token: userJwtToken, // JWT signed with your secret
});
// Subscribe to channel
const sub = client.newSubscription("chat:room-42");
sub.on("publication", (ctx) => {
console.log("New message:", ctx.data); // { user: "Alice", text: "Hello!" }
});
sub.on("join", (ctx) => {
console.log(`${ctx.info.user} joined`);
});
sub.on("leave", (ctx) => {
console.log(`${ctx.info.user} left`);
});
// Presence — who's online
const presence = await sub.presence();
console.log("Online users:", Object.values(presence.clients).map(c => c.user));
// History — missed messages (recovery)
const history = await sub.history({ limit: 50 });
history.publications.forEach(p => console.log(p.data));
sub.subscribe();
client.connect();
// Publish from your server via HTTP API
async function publishMessage(channel: string, data: any) {
await fetch("http://localhost:8000/api/publish", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "apikey your-api-key",
},
body: JSON.stringify({ channel, data }),
});
}
// Send chat message
await publishMessage("chat:room-42", {
user: "Alice",
text: "Hello everyone!",
timestamp: Date.now(),
});
// Send notification
await publishMessage("notifications:#user-123", {
type: "order_shipped",
title: "Your order has shipped!",
orderId: "ORD-456",
});
// JWT token generation (Node.js)
import jwt from "jsonwebtoken";
function generateToken(userId: string, channels: string[]) {
return jwt.sign(
{ sub: userId, channels },
process.env.CENTRIFUGO_SECRET!,
{ expiresIn: "24h" },
);
}
# Server
docker pull centrifugo/centrifugo
# Or binary: https://github.com/centrifugal/centrifugo/releases
# Client SDK
npm install centrifuge # JavaScript/TypeScript
chat: for chat, notifications: for alertsforce_recovery for chat; clients automatically catch up on reconnect#user-123 pattern for per-user notifications; only that user can subscribedevelopment
Expert guidance for Fireworks AI, the platform for running open-source LLMs (Llama, Mixtral, Qwen, etc.) with enterprise-grade speed and reliability. Helps developers integrate Fireworks' inference API, fine-tune models, and deploy custom model endpoints with function calling and structured output support.
development
Convert any website into clean, structured data with Firecrawl — API-first web scraping service. Use when someone asks to "turn a website into markdown", "scrape website for LLM", "Firecrawl", "extract website content as clean text", "crawl and convert to structured data", or "scrape website for RAG". Covers single-page scraping, full-site crawling, structured extraction, and LLM-ready output.
tools
Expert guidance for Firebase, Google's platform for building and scaling web and mobile applications. Helps developers set up authentication, Firestore/Realtime Database, Cloud Functions, hosting, storage, and analytics using Firebase's SDK and CLI.
development
When the user needs to build file upload functionality for a web application. Use when the user mentions "file upload," "image upload," "upload endpoint," "multipart upload," "presigned URL," "S3 upload," "file validation," "upload to cloud storage," or "accept user files." Handles upload endpoints, file validation (type, size, magic bytes), cloud storage integration, and upload status tracking. For image/video processing after upload, see media-transcoder.