group-chat

Group chat skill: includes a zero-dependency WebSocket relay server and client to enable real-time, open-join group chat. Any users who connect to the same relay address and enter the same room name can chat instantly in the group. Suitable for multi-session/multi-user collaboration and AI-avatar group scenarios.

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 "group-chat" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-c30ec89458a1cb1f7c015d34221be799cdd9d087827d14e0ed65e6f3932fa9b8. Verify the upstream source and version against https://skillhub.cn/skills/user_09123be9/group-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

Group chat skill: includes a zero-dependency WebSocket relay server and client to enable real-time, open-join group chat. Any users who connect to the same relay address and enter the same room name can chat instantly in the group. Suitable for multi-session/multi-user collaboration and AI-avatar group scenarios.

0 Downloads

Introduction source: third_party · user_09123be9 · 1.0.0 Reference

SkillPi interpretation

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

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: group-chat
description: 群聊技能。当用户想要「加入一个群组 / 在群里聊天 / 建个群聊 / 多人一起聊」时加载。本技能自带一个零依赖的 WebSocket 消息中继服务器和客户端,任何加载了本技能的人只要连到同一个中继地址、进同一个房间名,就能实时群聊(开放式加入,无需密码)。适用于 WorkBuddy 多会话/多人协同聊天、AI 分身群组等场景。
version: 1.0.0

群聊技能(group-chat)

让加载本技能的人加入一个群组并实时聊天。底层是一个自带的纯 Node WebSocket 中继服务器(零第三方依赖),所有客户端连到同一个 relay 地址、进入同一个 room 名,即进入同一群组。开放式加入:知道地址+房间名即可进,无需密码。

自带文件

  • server/relay.js —— 中继服务器(WebSocket 广播 + 历史消息 + 系统通知 + 网页聊天页)
  • client/chat.js —— 群聊客户端(Node 22+ 全局 WebSocket,零依赖;支持后台 agent 驱动与终端手动两种模式)
  • client/chat.html —— 浏览器聊天页(访问 http://<host>:<port>/ 即可网页加群)
  • render.yaml —— Render 平台一键部署配置

技能目录即本文件所在目录。客户端默认路径:<技能目录>/client/chat.js。若不确定,用 Glob 搜 **/group-chat/client/chat.js 定位。

一、配置中继地址(relay URL)

群组要"多人互通",必须有一个大家都能访问的中继服务器。地址解析优先顺序:

  1. 启动参数 --url <地址>。
  2. 环境变量 GROUP_CHAT_RELAY(如 wss://your-host:3000)。
  3. 技能目录下的 config.json 里的 relayUrl(见下,「一键加入默认群」就用它)。
  4. 都没有 → 问用户要地址。不要自己瞎编。

一键加入默认群(推荐分发方式)

技能目录放一个 config.json(参考 config.json.example),写入公网中继地址和默认房间:

{ "relayUrl": "wss://your-public-host:3000", "defaultRoom": "demo", "defaultName": "", "token": "chat2026" }

这样加载技能的人只需说一句 「加入默认群」/「一键进群」,你就直接用 config 里的 relayUrl + defaultRoom 拉起客户端,无需再问任何参数,直接进入群组。把 config.json 随技能一起分发,就是"安装即连你的群"。

入群口令(轻量门槛,推荐开启):在 config.json 填 token,并在部署中继时设环境变量 GROUP_TOKEN 为同一个值。这样:拿到口令的人照样随便进/退;但只翻到 skill、没有口令的陌生人进不来(返回"口令错误")。口令只是群通行码,不是你的账号密码,可随群分发,泄露了换一个即可。

注意:config.json 里不要写任何密钥;relayUrl 只是 ws/wss 地址、token 只是群通行码。开放式/带口令下,知道地址+房间名(+口令)即可进群。

二、agent 操作流程(核心)

加群前先确定两件事,不确定就问用户:

  • 昵称 name:默认用 USER.md 里的「杰」,或让用户指定。
  • 房间名 room:用户想进哪个群(如 demo、team)。开放式,任意字符串。

加入群组

用 Bash 在后台拉起客户端(把日志/outbox 放到当前 workspace 下,便于读取):

node <技能目录>/client/chat.js \
  --url <relay> --room <room> --name <name> \
  --log <workspace>/.groupchat/<room>.log \
  --outbox <workspace>/.groupchat/<room>.outbox
  • 该进程常驻后台;务必记录它的 task_id / pid 和当前 room(写进本次会话的 memory 笔记)。
  • 客户端连上后会把「✓ 已加入」「历史消息」「在线名单」等写进 --log 文件。

在群里发言(用户说:"在群里说:…" / "发到群里:…")

把要发的内容按行追加到 --outbox 文件,客户端每 0.4s 轮询并自动发出、清空:

# 用 Edit/Write 把整条消息作为一行写入 outbox;多行就多行

也可用 Bash printf '%s\n' '消息内容' >> <outbox>。注意每条消息一行。

读取群消息(用户说:"群里有什么新消息?" / "刷新一下")

直接 Read --log 文件,把最近若干行展示给用户。后台进程持续把新消息追加进去,所以随时读都是最新的。

离开群组

结束后台客户端进程(用对应 task_id 结束 / kill <pid>)。下次想聊再重新 join 即可。

转发的实时性说明

agent 是"按轮次"工作的:用户每发一条消息(任何内容),你就主动 Read 一次 --log,把群里的新消息先汇报给用户,再处理他的请求。这样在不改架构的前提下实现"准实时"群聊体验。

三、用户可能说的指令 → 你的动作

用户意图 你的动作
加入/进入群组 X 后台启动客户端 join X
加入默认群 / 一键进群 用 config.json 的 relayUrl+defaultRoom 直接后台启动客户端(无需问参数)
在群里说:… 追加一行到 outbox
群里新消息 / 刷新 Read log 并汇报
谁在线 / 成员 Read log 顶部的 welcome 行,或让用户看历史
离开 / 退群 结束后台进程
帮我起一个中继 按第四节部署,并回传 ws://<host>:<port>

四、部署中继(让多人能连)

中继需要一台常驻运行 Node 的机器/容器,所有人连它。

本地最快验证:

cd <技能目录>
PORT=3000 node server/relay.js
# 网页端:浏览器打开 http://localhost:3000/

然后告诉用户中继地址 ws://localhost:3000(仅本机/同网可连)。

Cloudflare Tunnel 免费公网暴露(零注册、支持 WebSocket):

# 本机先跑 relay,再用 cloudflared 打隧道(官网下载单二进制即可)
cloudflared tunnel --url http://localhost:3000
# 输出形如 https://xxx.trycloudflare.com,客户端用 wss://xxx.trycloudflare.com
# 注意:临时域名,隧道重启后地址会变

Render 一键部署(免费,需绑卡验证): 技能根目录已带 render.yaml。把它和 server/ 推到一个 GitHub 仓库,在 Render 里 New → Blueprint → 连仓库,即自动部署成 Web 服务(监听 3000)。部署后地址形如 https://<service>.onrender.com,客户端用 wss://<service>.onrender.com 即可(Render 会把 443 转发到 3000)。如需入群口令,在 Render 控制台 Environment 里加 GROUP_TOKEN=<你的口令>(不要写进仓库/render.yaml,否则公开仓库会泄露口令)。

部署到 Railway / Fly.io / 任意 Node 平台同理:上传目录,启动命令 node server/relay.js,暴露 PORT(默认 3000)。拿到公网地址后,写进 config.json 的 relayUrl 并分发给要加群的人即可。

CloudStudio 沙箱若只提供静态托管,无法常驻 Node 进程跑 WebSocket;请用上面的容器/Node 平台方式托管中继,再把地址分给加载了本技能的人。

五、注意

  • 开放式加入=无鉴权:不要把敏感内容发进公共房间。
  • 中继重启会清空内存里的房间与历史(未做持久化,按需可后续加)。
  • 客户端进程断了会自动退出;重连只需重新跑 join 命令。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决多人实时协同聊天刚需,适用于WorkBuddy多会话、AI分身群组等明确场景
  • 自带零依赖WebSocket中继与客户端,开箱即用
  • 支持一键加入默认群与口令轻量门槛,兼顾易用性与轻量安全
Trigger Precision95/100

Highlights

  • 触发词精准覆盖'加入群组/群聊/建群/多人聊天'等核心意图
  • 边界清晰,不易与其他技能混淆
Structure and Standards90/100

Highlights

  • Phase划分清晰:配置→操作流程→指令映射→部署
  • 提供完整端到端示例与命令模板
  • frontmatter完整,单文件结构合理
Execution Reliability88/100

Highlights

  • 工具来源明确(自带relay.js/chat.js),参数说明完整
  • 覆盖主要异常场景(断连重连、口令验证、后台进程管理)
  • 不可逆操作有明确记录与确认机制
Evidence Verifiability (mean of the first four)90/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.

  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 35
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • localhost

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.