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.
npx skills add cass-2003/local-workflow-skill --skill websocket-implgit clone --depth 1 https://github.com/cass-2003/local-workflow-skillWrote 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.
[](https://agentmods.dev/skills/cass-2003/local-workflow-skill/websocket-impl)<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/websocket-impl"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/websocket-impl/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/websocket-impl"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/websocket-impl.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00186 | $0.04021 |
| Opus 5.5 | $0.00074 | $0.01608 |
| Sonnet 5.5 | $0.00037 | $0.00804 |
| Haiku 4.5 | $0.00019 | $0.00402 |
Grade A, and why
websocket-impl 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 446 lines — stays where its author put it; the contents beside it link to each section on GitHub.
WebSocket Implementation Skill — WS 实战
何时使用
- 实现实时双向通信(聊天 / 协作 / 推送 / 在线游戏)
- 排查"客户端莫名断线"/ 重连风暴
- 设计多实例部署的消息广播
- WebSocket vs SSE vs Long Polling 选型
- 评估 Socket.IO / 原生 ws / uWebSockets
一、何时选 WS 何时不选
| 需求 | 推荐 |
|---|---|
| 服务端 → 客户端单向推送 | SSE(更简单、自动重连、HTTP/2 多路复用) |
| 双向 / 低延迟 | WebSocket |
| 客户端 → 服务端低频提交 | HTTP POST(普通 API) |
| 实时性 < 1s 即可 | Long polling / SSE |
| 多设备同步 | WebSocket / 推送服务(FCM / APNs) |
| 文件 / 大数据流 | HTTP/2 streaming 或 WebTransport |
WS 是"双向 + 低延迟"的工具,不是默认选项。
二、协议基础
握手(HTTP Upgrade)
GET /ws HTTP/1.1
Host: example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Version: 13
Sec-WebSocket-Protocol: chat.v1
Sec-WebSocket-Extensions: permessage-deflate
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
Sec-WebSocket-Protocol: chat.v1
Frame 结构
OPCODE 类型:
0x0 continuation (分片)
0x1 text (UTF-8 字符串)
0x2 binary (任意字节)
0x8 close
0x9 ping
0xA pong
0xB-0xF reserved
最大消息体:协议无硬限,实现限(多数 16-64 MB)。
三、Node.js (ws 库) 服务端
import { WebSocketServer } from 'ws'
import http from 'node:http'
const server = http.createServer()
const wss = new WebSocketServer({ noServer: true })
server.on('upgrade', (req, socket, head) => {
// 自家鉴权(cookie / token)
if (!authenticate(req)) {
socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n')
socket.destroy()
return
}
wss.handleUpgrade(req, socket, head, (ws) => {
wss.emit('connection', ws, req)
})
})
wss.on('connection', (ws, req) => {
ws.userId = extractUserId(req)
ws.isAlive = true
ws.on('pong', () => { ws.isAlive = true })
ws.on('message', (data, isBinary) => {
const msg = isBinary ? data : data.toString()
handleMessage(ws, msg)
})
ws.on('close', (code, reason) => {
cleanup(ws)
})
})
// 心跳:每 30s 发 ping,对方未 pong 则断开
setInterval(() => {
for (const ws of wss.clients) {
if (!ws.isAlive) { ws.terminate(); continue }
ws.isAlive = false
ws.ping()
}
}, 30_000).unref()
server.listen(8080)
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.
- 1mo ago First seen · 446 lines · 186 tokens per session scan A b2fb179e8cce
websocket-impl is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 3mo ago), licensed MIT. It adds 186 tokens to every session and 4,021 once invoked, about $0.0007 per session on Opus 5.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.
Other skills, from other repositories
mem0-oss-to-platform
Plan, then execute, a migration of a project from the mem0 open-source / self-hosted SDK (local Memory class) to the mem0 Platform / hosted SDK (MemoryClient). TRIGGER when: the developer wants to move, switch, or migrate mem0 off OSS/self-hosted to the hosted API, e.g. "migrate my mem0 setup to the platform", "switch…
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…
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".
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.
dev-runtime
How the Node side of a dev stack runs without haven, and the backend host: pnpm dev (UI built once, backend reloading), pnpm dev:hmr (adds the Vite ui lane), tools/dev-runtime (api + worker in one Node process), backend reload on a file change, the debounce (quiet window + max wait), ports derived from PORT. Use when…
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…