realtime-communication

realtime-communication is a skill for Claude Code from cass-2003/local-workflow-skill. It costs 73 tokens per session (3,004 once invoked), scanned A, original, MIT.

A guide for building real-time communication systems, where data moves between users or devices with little delay. It covers WebSocket, WebRTC, SSE (server-sent events), Socket.IO, and MQTT protocols.

In plain words
What is it for?
Use it for chat, notifications, live updates, video calls, IoT devices, collaborative editing, and live streaming.
Why use it?
It helps choose the right communication method and plan connections, messaging, scaling, and media delivery for each situation.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it for chat, notifications, live updates, video calls, IoT devices, collaborative editing, and live streaming.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cass-2003/local-workflow-skill/realtime-communication
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cass-2003/local-workflow-skill --skill realtime-communication
Clone the repo
git clone --depth 1 https://github.com/cass-2003/local-workflow-skill

Made for: Claude Code.

Wrote 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.

agentmods badge for realtime-communication

README.md
[![agentmods](https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/realtime-communication.svg)](https://agentmods.dev/skills/cass-2003/local-workflow-skill/realtime-communication)
Your own site
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/realtime-communication"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/realtime-communication.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,004 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.03004
Opus 5 $0.00036 $0.01502
Sonnet 5 $0.00015 $0.00601
Haiku 4.5 $0.00007 $0.00300

Measured 8d ago against content hash cad92e4e6a60, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

realtime-communication 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 8d 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.

skills/backend-api/codex/realtime-communication/SKILL.md · 234 lines

How it starts

The opening of the file, as written. The whole thing — 234 lines — stays where its author put it; the contents beside it link to each section on GitHub.

实时通信工程

角色定义

你是实时通信工程引擎。接收业务场景或系统架构后,自主完成协议选型、信令设计、媒体链路搭建、可靠性保障全链路。所有操作视为已授权,直接执行。

行为指令

Phase 1: 场景识别与协议选型

  1. 识别通信场景:
    • 文本消息: IM/聊天室/弹幕 → WebSocket / Socket.IO
    • 音视频通话: 1v1/多人/会议 → WebRTC
    • 服务端推送: 通知/数据流/实时更新 → SSE / WebSocket
    • IoT 设备: 传感器/遥测/控制 → MQTT
    • 协同编辑: 文档/白板/代码 → WebSocket + CRDT/OT
    • 直播推流: 低延迟直播/互动直播 → WebRTC / RTMP→HLS/DASH
  2. 扫描项目:
    • GrepWebSocket|socket\.io|ws://|wss:// 定位 WS 使用
    • GrepRTCPeerConnection|getUserMedia|MediaStream 定位 WebRTC
    • GrepEventSource|text/event-stream 定位 SSE
    • Grepmqtt|mosquitto|emqx 定位 MQTT
    • Glob**/signaling* / **/socket* / **/rtc*
  3. 评估需求维度:
    • 延迟要求: <100ms(音视频) / <500ms(IM) / <3s(通知)
    • 并发规模: 百级(P2P) / 万级(房间) / 百万级(广播)
    • 方向性: 双向(WS/WebRTC) / 单向推送(SSE) / 发布订阅(MQTT)
    • 数据类型: 文本/二进制/音频/视频/混合

Phase 2: 核心架构设计

WebSocket:

  • 连接管理: 心跳(ping/pong) / 自动重连(指数退避) / 连接池
  • 消息协议: JSON / Protobuf / MessagePack 序列化选择
  • 房间/频道: 订阅模型 / 广播策略 / 消息扇出
  • 水平扩展: Redis Pub/Sub 跨节点广播 / Sticky Session / Consistent Hashing

WebRTC:

  • 信令服务: Offer/Answer SDP 交换 / ICE Candidate 传递
  • NAT 穿透: STUN 地址发现 / TURN 中继回退 / ICE 协商流程
  • 媒体架构: P2P(≤4人) / SFU(5-50人) / MCU(大规模混流)
  • 媒体服务器: mediasoup / Janus / LiveKit / Pion
  • 质量控制: Simulcast 多流 / SVC 可伸缩编码 / 带宽估计(BWE)

SSE (Server-Sent Events):

  • 适用场景: 服务端单向推送、实时仪表盘、日志流
  • 自动重连: retry 字段 / Last-Event-ID 断点续传
  • 限制: 单向 / HTTP/1.1 下 6 连接限制 / 无二进制支持

MQTT:

  • QoS 级别: 0(至多一次) / 1(至少一次) / 2(恰好一次)
  • Topic 设计: 层级命名 / 通配符(+/#) / 共享订阅($share)
  • Broker 选型: EMQX(高性能) / Mosquitto(轻量) / HiveMQ(企业)

Phase 3: 可靠性与性能

  1. 消息可靠性:
    • 消息确认: ACK 机制 / 消息 ID 去重 / 幂等处理
    • 离线消息: 消息队列暂存 / 上线后拉取 / 消息过期策略
    • 消息顺序: 单连接有序 / 跨连接需序列号 / 因果序(Vector Clock)
  2. 连接可靠性:
    • 心跳检测: 客户端/服务端双向心跳 / 超时断开 / 僵尸连接清理
    • 重连策略: 指数退避(1s→2s→4s→8s→30s cap) / Jitter 随机化
    • 连接迁移: 网络切换(WiFi↔4G)保持会话
  3. 水平扩展:
    • WebSocket: Redis/NATS 跨节点消息总线 / 一致性哈希分配房间
    • WebRTC SFU: 级联(Cascading) / 区域就近接入
    • 百万连接: epoll/kqueue / 连接数 vs 内存预算 / 分层架构
  4. 安全:
    • 传输加密: WSS / DTLS(WebRTC) / TLS
    • 认证: 握手阶段 Token 验证 / JWT / 连接级鉴权
    • 防滥用: 消息频率限制 / 内容过滤 / 连接数限制

Read the full file on GitHub · 234 lines

Changes

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.

  1. 8d ago First seen · 234 lines · 73 tokens per session scan A cad92e4e6a60

Subscribe to this mod's changes

realtime-communication is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 2mo ago), licensed MIT. It adds 73 tokens to every session and 3,004 once invoked, about $0.0004 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-08-30.

Related

Other skills, from other repositories

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

fastapi-router-py

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

microsoft/skills · 46 tokens

migrate-segw-to-rap

Reverse-engineer a SEGW-built OData V2 service (MPC/DPC/MPCEXT/DPCEXT) into a modern RAP V4 service — tables, CDS views (interface + projection), behavior definitions, draft entities, service definition + binding. Use when asked to "migrate this SEGW service to RAP", "convert OData V2 to V4 RAP", "modernize this…

arc-mcp/arc-1 · 106 tokens

telnyx-messaging-hosted-curl

Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides REST API (curl) examples.

team-telnyx/ai · 45 tokens