From aj-geddes-useful-ai-prompts-4
Implements real-time bidirectional communication using WebSockets, SSE, or long polling for chat apps, live dashboards, collaborative editing, notifications, and instant updates.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4This skill uses the workspace's default tool permissions.
- [Overview](#overview)
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Implement real-time bidirectional communication between clients and servers for instant data synchronization and live updates.
Minimal working example:
// server.ts
import WebSocket, { WebSocketServer } from "ws";
import { createServer } from "http";
interface Message {
type: "join" | "message" | "leave" | "typing";
userId: string;
username: string;
content?: string;
timestamp: number;
}
interface Client {
ws: WebSocket;
userId: string;
username: string;
roomId: string;
}
class ChatServer {
private wss: WebSocketServer;
private clients: Map<string, Client> = new Map();
private rooms: Map<string, Set<string>> = new Map();
constructor(port: number) {
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| WebSocket Server (Node.js) | WebSocket Server (Node.js) |
| WebSocket Client (React) | WebSocket Client (React) |
| Server-Sent Events (SSE) | Server-Sent Events (SSE) |
| Socket.IO (Production-Ready) | Socket.IO (Production-Ready) |