go-ws-module-skill

go-ws-module-skill is a skill for Claude Code, Codex from jiushiwon/wg-skills. It costs 131 tokens per session (3,894 once invoked), scanned A, original, Apache-2.0.

A Go Gin module for adding WebSocket chat to an existing backend. WebSockets keep a live connection open so messages can arrive without repeated requests.

In plain words
What is it for?
Use it for authenticated text, image, and voice chat, friend checks, message history, unread counts, offline delivery, conversations, and duplicate-send protection.
Why use it?
It provides the server-side pieces for real-time one-to-one messaging instead of requiring you to build connection handling, delivery states, and offline storage yourself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for authenticated text, image, and voice chat, friend checks, message history, unread counts, offline delivery, conversations, and duplicate-send protection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jiushiwon/wg-skills/go-ws-module-skill
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 jiushiwon/wg-skills --skill go-ws-module-skill
Clone the repo
git clone --depth 1 https://github.com/jiushiwon/wg-skills

Made for: Claude Code, Codex.

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 go-ws-module-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/jiushiwon/wg-skills/go-ws-module-skill/github.svg)](https://agentmods.dev/skills/jiushiwon/wg-skills/go-ws-module-skill)
Your own site
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/go-ws-module-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/go-ws-module-skill/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.

agentmods 80×15 button for go-ws-module-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/go-ws-module-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/go-ws-module-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 131 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,894 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.00131 $0.03894
Opus 5.5 $0.00052 $0.01558
Sonnet 5.5 $0.00026 $0.00779
Haiku 4.5 $0.00013 $0.00389

Measured 1mo ago against content hash 65aae182d133, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-ws-module-skill 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.

vibeCoding/backend/go/go-ws-module-skill/SKILL.md · 415 lines

How it starts

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

Go Gin WebSocket Module Skill

为 Go Gin 项目叠加一套 WebSocket 即时通信能力,不是重新生成新项目。

定位

  • 目标:在已有 go-gin-init-skill 骨架上,添加可运行的 WebSocket 通信模块。
  • 不替代:不重复生成 go-gin-init-skill 已经提供的 JWT、统一响应、GORM 等基础设施。
  • 不做腾讯 IM:自建轻量方案,适合小中规模,不依赖第三方 IM 服务。
  • 输出:连接管理器、消息路由、消息存储、离线推送、会话管理、好友校验、接口契约。

骨架依赖(子模块)

本模块是 go-gin-init-skill 的子模块,必须在骨架基础上使用。

使用前必须满足以下条件:

  1. ✅ 已安装 go-gin-init-skill(项目骨架)
  2. ✅ 骨架包含:JWT、统一响应、GORM、分页、目录结构
  3. ✅ 遵循骨架的表前缀、字段命名、软删除规范

检测逻辑:

  1. 读取用户项目根目录,检查是否包含 go-gin-init-skill 的标志性文件(main.go、config/config.go、middleware/auth.go)
  2. 检查是否已有 getCurrentUser 依赖
  3. 如未检测到骨架,提示:"本模块需要先安装 go-gin-init-skill 骨架"
  4. 如用户拒绝安装骨架,则终止并提示无法使用

用户问题(最多 3 个)

1. 现有项目的包名是什么?(默认从 go-gin-init-skill 推断,如 main)
2. 表前缀是什么?(默认 wg)
3. 是否需要群聊?(默认不需要,先做单聊)

核心能力清单

# 能力 说明
1 WebSocket 长连接 WS /api/ws?token=<jwt>,query 参数鉴权,多端登录
2 单聊消息 文本/图片/语音实时投递,在线直推,离线入库
3 好友校验 仅允许已通过好友互发消息
4 消息幂等 客户端传 client_msg_id,网络抖动重发不重复入库
5 离线消息 用户上线时自动推送未送达消息(最多 100 条)
6 未读数 单聊未读计数,支持清零 + 实时通知对方
7 会话列表 最近会话排序,最后一条消息预览
8 聊天记录 基于 cursor 翻页的历史消息查询
9 消息状态 未读 → 已送达 → 已读 三态流转
10 接口契约 生成 api-contract-ws.md,与前端对齐

生成流程

  1. 确认已存在 Go Gin 骨架(含 JWT、统一响应、GORM)。
  2. 询问用户包名、表前缀(默认 wg)、是否需要群聊。
  3. 按 references/skeleton.go 生成 ws/ 下全部源码:
    • 将所有 {prefix} 占位符替换为用户指定的表前缀(如 wg_)
    • 将 ws 替换为用户的包名
  4. 生成 api-contract-ws.md 与 docs/ws-module-guide.md。
  5. 在 main.go 注册 WebSocket 路由。
  6. 提示用户:重启服务后可通过 WebSocket 客户端测试连接。

模块结构

{{PROJECT_NAME}}/
├── main.go                         # 注册 WebSocket 路由
├── config/
│   └── config.go                   # 配置
├── ws/
│   ├── manager.go                  # WebSocket 连接管理器(多端登录)
│   ├── handler.go                  # 消息路由与处理
│   ├── hub.go                      # 消息分发中心
│   ├── models/
│   │   ├── message.go              # 消息模型
│   │   ├── conversation.go         # 会话模型
│   │   └── friend.go               # 好友模型
│   ├── services/
│   │   ├── message_service.go      # 消息存储与查询
│   │   └── conversation_service.go # 会话管理
│   ├── routers/
│   │   ├── ws.go                   # WebSocket 端点
│   │   ├── chat.go                 # REST 接口
│   │   └── friend.go               # 好友接口
│   └── utils/
│       ├── validators.go           # 消息校验
│       └── helpers.go              # 工具函数
├── migrations/
│   └── ws_module.sql              # 数据库迁移
├── api-contract-ws.md              # 接口契约
└── docs/
    └── ws-module-guide.md          # 接入指南

Read the full file on GitHub · 415 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 415 lines · 131 tokens per session scan A 65aae182d133

Subscribe to this mod's changes

go-ws-module-skill is a skill published in the GitHub repository jiushiwon/wg-skills (121 stars, last pushed 2d ago), licensed Apache-2.0. It adds 131 tokens to every session and 3,894 once invoked, about $0.0005 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-09-15.

Related

Other skills, from other repositories

golang-pro

Implements concurrent Go patterns using goroutines and channels, designs and builds microservices with gRPC or REST, optimizes Go application performance with pprof, and enforces idiomatic Go with generics, interfaces, and robust error handling. Use when building Go applications requiring concurrent programming…

Jeffallan/claude-skills · 95 tokens

golang-graphql

Implements GraphQL APIs in Golang using gqlgen or graphql-go. Apply when building GraphQL servers, designing schemas, writing resolvers, handling subscriptions, or integrating GraphQL with existing Go HTTP services. Also apply when the codebase imports github.com/99designs/gqlgen or github.com/graph-gophers/graphql-go.

samber/cc-skills-golang · 77 tokens

golang-grpc

Provides gRPC usage guidelines, protobuf organization, and production-ready patterns for Golang microservices. Use when implementing, reviewing, or debugging gRPC servers/clients, writing proto files, setting up interceptors, handling gRPC errors with status codes, configuring TLS/mTLS, testing with bufconn, or…

samber/cc-skills-golang · 72 tokens

golang-swagger

Golang OpenAPI/Swagger documentation with swaggo/swag — annotation comments (@Summary, @Param, @Success, @Router, @Security), swag init code generation, framework integrations (gin, echo, fiber, chi, net/http), security definitions (Bearer/JWT, OAuth2, API key), and struct tags (swaggertype, enums, example…

samber/cc-skills-golang · 146 tokens

printing-press

Set up a new integration, connector, or CLI binding for any API. Wrap or generate a ship-ready Go CLI from an OpenAPI, HAR, or Postman spec via the lean research -> generate -> build -> shipcheck loop. Use when the user says build a CLI, wrap this API, set up a new integration, add a connector, integrate with a…

mvanhorn/cli-printing-press · 86 tokens

goframe-v2

GoFrame development skill. TRIGGER when writing/modifying Go files, implementing services, creating APIs, or database operations. DO NOT TRIGGER for frontend/shell scripts.

hashgraph-online/awesome-codex-plugins · 40 tokens