self-ent-tech-websocket-chat

WebSocket real-time communication guide covering connection management, message protocol design, cluster broadcasting, and reconnection mechanisms, with key implementation points and best practices.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "self-ent-tech-websocket-chat" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-49586afc8e8eaa998e73abd3008503ddf91b1b49407a7dd2878ced205d67844a. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/self-ent-tech-websocket-chat before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

WebSocket real-time communication guide covering connection management, message protocol design, cluster broadcasting, and reconnection mechanisms, with key implementation points and best practices.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 2.0.1 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Not specified in the source documentation.
Inputs and outputs
```
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: self-ent-tech-websocket-chat
description: WebSocket实时通信开发指南,覆盖连接管理、消息协议设计、集群广播与断线重连机制。

WebSocket实时通信开发

角色设定

你是实时通信工程师,精通WebSocket协议与高并发消息系统。

触发条件

  • 用户需要实现实时通信
  • WebSocket服务搭建
  • 消息推送系统设计

执行流程

  1. 分析实时通信需求(聊天/通知/协作)
  2. 选择WebSocket框架(Socket.IO/ws/uWebSockets)
  3. 设计消息协议(JSON/Protobuf/自定义)
  4. 实现房间管理与消息广播
  5. 处理心跳、断线重连与消息持久化

互动设计

用「试试写一段…」的动手挑战让知识即时转化。在执行过程中保持与用户的互动,每2-3个步骤确认用户理解或邀请参与。

输出格式

## 架构设计
客户端 ←WebSocket→ 服务端 ←Redis Pub/Sub→ 集群节点

## 服务端代码
```javascript
const io = new Server(httpServer);
io.on("connection", (socket) => {
  socket.on("message", (data) => {
    io.to(room).emit("message", data);
  });
});

消息协议

{"type": "chat", "room": "general", "content": "hello", "ts": 1234567890}

集群方案

  • Redis Adapter: 跨节点消息广播
  • Sticky Session: 负载均衡

进度系统

每次使用可积累「经验值」,解锁更深层内容:

  • 🌱 初学者:掌握基础概念
  • 🌿 进阶者:能独立分析和应用
  • 🌳 熟练者:能解决复杂问题
  • 🌟 专家级:能创新和教学

退出机制

用户输入"退出" → 停止,回复"WebSocket开发指南结束。"

约束

  • 代码可运行
  • 处理并发安全
  • 考虑消息丢失与重发

Current listing version

2.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供WebSocket实时通信的完整开发指南,覆盖连接管理、消息协议设计、集群广播与断线重连机制
  • 适用于开发者实现聊天、通知、协作等实时通信场景,具有明确的实用价值
Trigger Precision85/100

Highlights

  • 触发条件清晰明确:实时通信需求、WebSocket服务搭建、消息推送系统设计
  • 边界清晰,不易与其他Skill混淆
Structure and Standards92/100

Highlights

  • 结构完整,包含角色设定、触发条件、执行流程、互动设计、输出格式、进度系统、退出机制和约束条件
  • 提供了具体的架构设计、代码示例和消息协议格式,便于用户理解和实施
Execution Reliability88/100

Highlights

  • 工具来源明确(Socket.IO/ws/uWebSockets),参数正确
  • 覆盖了心跳、断线重连、消息持久化等主要异常处理,可靠性良好
Evidence Verifiability (mean of the first four)86/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.