go-auth-module-skill

go-auth-module-skill is a skill for Claude Code, Codex from jiushiwon/wg-skills. It costs 189 tokens per session (4,259 once invoked), scanned A, original, Apache-2.0.

A Go web application module for user login and access control. It adds role-based permissions, organizations, tenants, menus, data-access levels, third-party application login, and signed access to open interfaces, using Gin and GORM.

In plain words
What is it for?
Use it to add users, roles, menus, organizations, jobs, tenants, login bindings, application keys, and HmacSHA256 request checks to a Go web project.
Why use it?
It provides a shared way to decide which users and applications may access features and data. Its documented contracts are designed to match specified Java and Vue admin components so the existing front end can work with the Go service.

Skill for Claude CodeCodex

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

Good fit Use it to add users, roles, menus, organizations, jobs, tenants, login bindings, application keys, and HmacSHA256 request checks to a Go web project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jiushiwon/wg-skills/go-auth-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-auth-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-auth-module-skill

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/jiushiwon/wg-skills/go-auth-module-skill"><img src="https://agentmods.dev/badge/skills/jiushiwon/wg-skills/go-auth-module-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 189 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,259 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.00189 $0.04259
Opus 5.5 $0.00076 $0.01704
Sonnet 5.5 $0.00038 $0.00852
Haiku 4.5 $0.00019 $0.00426

Measured 24d ago against content hash 99dd492392c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-auth-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 24d 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.

backend/go/go-auth-module-skill/SKILL.md · 237 lines

How it starts

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

Go Auth Module Skill

在 go-gin-init-skill 生成的项目上叠加权限底座:RBAC + 组织架构 + 通用登录。

契约与 Java springboot-auth-module-skill / vue-admin-skill 逐字对齐,因此同一套前端可以 在「Java 后端」和「Go 后端」之间零改动切换——前端不用动一行代码,直接桥接。

已验证的落地实现见 go-auth-admin 仓库(Go 复刻 java-vue-admin 后台,21 项端到端冒烟全绿)。

依赖

  • go-gin-init-skill:基础骨架(响应信封 / 错误码 / JWT / 启动脚本),本 skill 在其之上叠加
  • database-design-skill:表前缀 wg、字段与索引规范
  • frontend-request-skill:响应信封、错误码、Token 与前端消费契约
  • crypto-scenario-skill:密码创建、校验、修改或迁移必须遵循其密码存储规范;不得自行选择或实现密码哈希算法

核心能力清单(9 项)

# 能力 说明
1 RBAC 用户 / 角色 / 菜单(目录 M、页面 C、按钮 F)/ 组织 / 岗位 / 租户
2 三段式权限码 模块:资源:动作,39 个常量唯一源(34 个有菜单 + 5 个无菜单),DB permission 列与前端 v-permission 逐字一致
3 super_admin 双路径 鉴权短路全量常量(39),me() 走 DB 派生(34)—— 见红线 1
4 四档数据权限 ALL / DEPT_AND_BELOW / DEPT_ONLY / SELF_ONLY,多角色取最宽
5 菜单树 单表树形 parent_id 递归,含按钮级权限节点
6 通用登录(universal-login) 第三方应用 App + 密钥 AppKey + 绑定 AppBinding + 绑定码 BindCode
7 开放接口应用签名 /api/open/** 用 HmacSHA256 鉴权,300s 时间偏差、常量时间比较
8 绑定双向流程 应用发起(app_initiated)/ 宿主发起(user_initiated),绑定码一次性消费
9 零环境依赖 默认 glebarez/sqlite(纯 Go,CGO_ENABLED=0),无需安装数据库

★ 契约红线(本 skill 最值钱的部分,全是踩过的坑)

1. 两个权限解析路径故意不同,别合并

场景 数据来源 super_admin 结果
GET /api/auth/me(前端权限数组) DB 派生:role_menu → menu.permission 34(真实菜单权限:8 页面级 + 26 按钮级)
鉴权中间件 RequirePerm(等价 @PreAuthorize) DB 派生 ∪ 全量常量(super_admin 短路) 39(34 + 5 个无菜单的:4 个 system:tenant:* + system:api:view)

对应 Java 的 AuthorityLoader.permissions() 与 JwtAuthenticationFilter 反射短路两条路径。 不要把 me() 也短路成 39——否则前端拿到的权限数组就和 Java 不一致了。

⚠️ 数量会变:39 里有 5 个「无菜单权限」(4 个 system:tenant:* + system:api:view)。 新增无菜单权限时常量集会增长,但 me() 的 34 只跟种子菜单走,不受影响。 别把这两个数字写死在文档里不复核 —— 曾因新增 system:api:view 后技能仍写 38 而产生偏差。

2. 目录菜单的 permission 必须存 NULL,不能存 ""

  • 装载权限的 SQL 是 permission IS NOT NULL,而空串不是 NULL,会被当成有效权限带进权限数组
  • 实测后果:super_admin 的 me() 返回 37(34 真实 + 3 个空串),且菜单树里目录的 permission 是 "" 而不是 null(与 Java 不一致)
  • 修法:模型字段用 *string,落库前把空串转 nil(strPtr 辅助函数)

Read the full file on GitHub · 237 lines

Files

What ships with it

5 files 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. 24d ago Changed · +1 lines 99dd492392c2
  2. 1mo ago Changed · +4 lines dd5d6dced950
  3. 1mo ago Changed · +62 lines a9a0c87d8077
  4. 1mo ago First seen · 170 lines · 189 tokens per session scan A 369c27475184

Subscribe to this mod's changes

go-auth-module-skill is a skill published in the GitHub repository jiushiwon/wg-skills (154 stars, last pushed 7d ago), licensed Apache-2.0. It adds 189 tokens to every session and 4,259 once invoked, about $0.0008 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-10-05.

Related

go-auth-module-skill compared with skills from other repositories

go-auth-module-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
go-auth-module-skilljiushiwon/wg-skillsSkill1547d agoApache-2.0A189Claude Code, Codex
mem0-oss-to-platformmem0ai/mem0Skill70k4d agoApache-2.0A217Claude Code, Codex
tao-run-inference-serviceNVIDIA/skillsSkill4.2ktodayApache-2.0A92Claude Code
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.3kyesterdayMITA78Claude Code
fastapi-router-pymicrosoft/skillsSkill3.3kyesterdayMITA46Claude Code
dev-runtimelangwatch/langwatchSkill5.1ktodayApache-2.0A172Claude Code
api-designericrisco/rsc-harnessSkill6916d agoMITA105Claude Code, Codex