Agent skill

Tgf Server Dev

by thkhxm in thkhxm/tgf

基于 tgf v2(github.com/thkhxm/tgf/v2)用确定性的 tgfctl 工作流创建、验证和维护 Go 游戏服务器项目。

MITAuto-check: notesDatabases

Install Tgf Server Dev

skills CLI
$ npx skills add thkhxm/tgf --skill tgf-server-dev -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install thkhxm/tgf tgf-server-dev --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/thkhxm/tgf.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/tgf-server-dev .claude/skills/tgf-server-dev && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tgf-server-dev
GitHub stars
128
Token cost
~1.3k tokens
SKILL.md length
363 words
Files
8 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

基于 tgf v2(github.com/thkhxm/tgf/v2)用确定性的 tgfctl 工作流创建、验证和维护 Go 游戏服务器项目。

  • Works in 9 steps: 先确认工具链与事实 → 收集生成参数 → 调用生成器 → …
  • Tasks that involve Container orchestration
  • SKILL.md covers 1. 先确认工具链与事实, 2. 收集生成参数, 3. 调用生成器 and 4. 强制验证依赖来源, plus 5 more sections
  • Runs Python scripts from its folder; calls go and gh

What it does

Tgf Server Dev is an agent skill from thkhxm/tgf. 基于 tgf v2(github.com/thkhxm/tgf/v2)用确定性的 tgfctl 工作流创建、验证和维护 Go 游戏服务器项目。 当用户要创建 tgf 项目、生成 tgf 脚手架、搭建单进程或分布式游戏服、HTTP REST、HTTP+RPC、 TCP/WebSocket/KCP 网关、Redis/MySQL write-behind、Docker Compose/K8s 部署,或排查 tgf 使用问题时使用。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts and reference files (for example `agents/openai.yaml`, `references/api-reference.md` and `references/generator-contract.md`).

It sits in Databases, covering Container orchestration, Realtime and WebSockets and Containers. It works with GitHub, Redis, Kubernetes and MySQL. The repository describes itself as: tgf框架是使用golang开发的一套游戏分布式框架.项目采用了rpcx做为底层rpc的通讯,consul提供服务注册发现.定义了一整套的模块开发规范. The licence is MIT.

When your agent uses it

  • Tasks that involve Container orchestration
  • Tasks that involve Realtime and WebSockets
  • Tasks that involve Containers

Example prompts

  • “/tgf-server-dev”

Requirements

  • Python 3
  • Docker

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. 先确认工具链与事实
  2. 收集生成参数
  3. 调用生成器
  4. 强制验证依赖来源
  5. 项目统一规范
  6. 场景覆盖
  7. 验收与有界修复
  8. 框架问题升级
  9. Skill 维护资源

What it can do on your machine

Read from SKILL.md and the folder at commit ff52796. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • go
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tgf Server Dev loads about 1.3k tokens when it runs, and up to ~6.6k if it reads all its reference files. Until then it costs about 57 tokens; SKILL.md has 363 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:35
    enerated` / `external` | 前者用 CSPRNG 写本地 `.env.dev`;后者只留外部注入占位 |
  • NoteMentions a .env fileSKILL.md:99
    - `.env.dev`、`.env.test`、`.env.release`、日志和可执行产物必须被 `.gitignore` 忽略;

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from thkhxm/tgf at commit ff52796, republished under its MIT licence (© thkhxm). 363 words, ~1,264 tokens.

Download SKILL.mdSave it as .claude/skills/tgf-server-dev/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
tgf-server-dev
description
基于 tgf v2(github.com/thkhxm/tgf/v2)用确定性的 tgfctl 工作流创建、验证和维护 Go 游戏服务器项目。 当用户要创建 tgf 项目、生成 tgf 脚手架、搭建单进程或分布式游戏服、HTTP REST、HTTP+RPC、 TCP/WebSocket/KCP 网关、Redis/MySQL write-behind、Docker Compose/K8s 部署,或排查 tgf 使用问题时使用。

tgf-server-dev

用“问答决策 → tgfctl 原子生成 → 来源验证 → 构建/冒烟 → 有界修复”交付一致的业务项目。 模板的唯一权威来源是 github.com/thkhxm/tgf/v2/cmd/tgfctl 内嵌资源;禁止由模型复制或临场改写模板。

1. 先确认工具链与事实

  • Go 必须满足 go 1.26.0,推荐 toolchain go1.26.4;先执行 go version。
  • 业务依赖必须是 github.com/thkhxm/tgf/v2 的公开版本,不手写 rpcx/rpcx-consul,也不加本地 replace。
  • @latest 是默认且受支持的输入;tgfctl 必须先解析它,再把精确版本写入 go.mod。
  • 正常项目可以使用自己的 go.work。不要全局或无条件设置 GOWORK=off;它只适合发布隔离检查。
  • 框架统一处理 SIGINT/SIGTERM。业务 main 只等待 Run() 返回,禁止再写 signal.Notify 抢占信号。

框架调用不确定时,先读 API 速查,再读对应版本源码,禁止凭记忆杜撰。

2. 收集生成参数

用户已说明的项不要重复问;缺少会改变产物的项才询问。

决策值约束
module合法 Go module path分布式项目内部 import 依赖它
profilesingle / distributed / http-rest / http-rpc四种一等项目形态
datanone / redis / redis-mysqldistributed 最低为 redis
protocolnone / tcp / websocket / kcp / allHTTP 两种 profile 必须为 none;游戏网关始终含 TCP,其他值增加 WS/KCP
deploylocal / compose / k8scompose、k8s 都生成 Dockerfile
securitydev-generated / external前者用 CSPRNG 写本地 .env.dev;后者只留外部注入占位

安全默认:游戏网关必须有 LoginTokenSecret;admin 不用时保持 fail-closed;KCP 必须使用 32 字节 AEAD key。 不要让用户在聊天、命令行参数或 Git 文件中提供真实密钥。

3. 调用生成器

优先使用 PATH 中的 tgfctl。未安装时使用公开模块运行。 已安装工具的入口是 tgfctl init ...;下面的 go run 形式与它等价:

bash
go run github.com/thkhxm/tgf/v2/cmd/tgfctl@latest init \
  --module github.com/acme/mygame \
  --dir ./mygame \
  --profile single \
  --data none \
  --protocol tcp \
  --deploy local \
  --security dev-generated \
  --tgf-version latest

仅框架维护者测试尚未发布的 CLI 时,才可从明确的 tgf checkout 执行 go run ./cmd/tgfctl; 生成项目本身仍必须是 GitHub module consumer,并通过下一节的来源检查。

生成器默认执行 go mod tidy、go build ./...、go vet ./... 和来源验证。目标目录默认必须不存在; --force 也只接受空目录,绝不合并或删除用户文件。--git-init 必须由用户明确要求才传。

完整命令、参数交叉约束、原子生成和退出行为见 生成器契约。

4. 强制验证依赖来源

生成完成后再次运行:

bash
tgfctl verify --dir ./mygame

如果使用 go run,保持同一来源:

bash
go run github.com/thkhxm/tgf/v2/cmd/tgfctl@latest verify --dir ./mygame

通过条件:

  • go.mod 直接 require github.com/thkhxm/tgf/v2 v2.x.y,版本非 latest、非空;
  • go.mod 不含指向 tgf/rpcx/rpcx-consul 的本地 replace;
  • go list -m -json github.com/thkhxm/tgf/v2 有固定 Version,没有 Replace,也不是 workspace 主模块;
  • 当前项目自己的 go.work 可以存在,但不能 use 本地 tgf 源码或把 tgf 替换成本地目录。

发现父目录 workspace 污染时,移动到该 workspace 之外重新生成或修正项目 workspace;不要把 GOWORK=off 写成所有项目的永久规则。

Show full SKILL.md (170 more words)Show less

5. 项目统一规范

  • cmd/<process>/main.go 只做装配;多进程或多 module 项目使用 internal/api、internal/service、 internal/dao 分层。
  • 服务只有在 Startup() == (true, nil) 时才可被发现/本地分发;失败服务仍由框架清理。
  • 服务间 RPC 用 ServiceAPI 和指针 reply;客户端帧直达使用 rpc.Args[T] / rpc.Reply[T]。
  • 统一 WithGatewayOptions,不与 deprecated WithGateway* 混用;网关端口与 rpcx 内部端口错开。
  • 配置统一从 config.Current() 读取;框架配置禁止散落 os.Getenv,否则热更新失效。
  • RPC、数据库、HTTP bridge 错误必须处理;禁止 _ = err、空错误分支和把上游敏感错误原样返回客户端。
  • .env.dev、.env.test、.env.release、日志和可执行产物必须被 .gitignore 忽略; 只提交 .env.example,生产密钥走 Secret/环境注入。
  • WithoutLoginCheck() 只允许明确的内网联调,生产禁止。
  • 数据层选 redis-mysql 时使用 write-behind 失败队列和启动重放;外部 Redis/MySQL 未实际运行时, 只能报告“未验证”,不能当作通过。

目录、编码、安全、数据与部署细则见 项目规范。

6. 场景覆盖

四个 profile 覆盖项目骨架;其余能力作为受测扩展加入,不能另起不一致模板。

场景入口
单进程游戏服profile=single
分布式 gateway + gameprofile=distributed
HTTP RESTprofile=http-rest
HTTP → RPCprofile=http-rpc
TCP / WebSocket / KCP游戏 profile 的 protocol
Redis / MySQL write-behinddata,并按项目规范接 DAO
Docker Compose / K8sdeploy
config reload / game config / logging / metrics+trace / RPC policy / robot / util / platform SDK先生成最近的 profile,再按 场景指南 和框架 example/ 加入

7. 验收与有界修复

先保存基线,再执行:

bash
go mod tidy
go test ./...
go build ./...
go vet ./...
tgfctl verify --dir .

然后按 profile 做真实冒烟:HTTP 必须实际请求 /health 和业务路由;游戏服至少启动并验证端口/robot; 分布式、Redis/MySQL、Consul 只有在依赖真实启动后才能标记 integration 通过。验证优雅停机时,向进程发 SIGINT/SIGTERM,不要在业务代码重复注册信号。

失败时最多修复 3 轮。每轮记录失败命令、根因、修改和重跑结果;同一根因连续失败、缺凭据/外部服务、 需要扩大授权或第 3 轮仍失败时停止并明确报告,不伪造通过。

交付必须包含:精确 tgf 版本、生成参数、通过的命令、未运行的外部集成、运行方式和下一步扩展建议。

8. 框架问题升级

先用最小业务项目确认不是配置/API 误用。确认框架缺陷后收集 tgf/Go 版本、形态、最小复现、期望/实际、 脱敏日志;删除 token、密码、AEAD key、内网地址和真实玩家数据。只有用户授权且 gh auth status 可用时 才创建 issue,否则输出可复制的 issue 正文。

9. Skill 维护资源

修改本 Skill 后必须同步仓库源与安装副本,并依次运行 skill-creator/quick_validate.py、 t-sys-skill/lint_skill.py、静态契约检查和外部 consumer 前向测试。

© thkhxm, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references) in .claude/skills/tgf-server-dev of thkhxm/tgf.

  • SKILL.md
  • agents/openai.yaml
  • references/api-reference.md
  • references/generator-contract.md
  • references/project-standards.md
  • references/scenario-guide.md
  • scripts/check_skill_contract.py
  • scripts/forward_test_generator.py

Open the folder on GitHubat commit ff52796

Compare with similar skills

Tgf Server Dev next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tgf Server Dev compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tgf Server Dev this skillthkhxm/tgf128—~1.3kAutomated safety check: NotesMIT
Cloudrun DevelopmentTencentCloudBase/CloudBase-AI-Toolkit1.1k1 repos~7.2kAutomated safety check: PassMIT
Redis Test Image Updateredis/go-redis22k—~1.5kAutomated safety check: PassBSD-2-Clause
Supercheck Infrastructure Deploymentsupercheck-io/supercheck215—~1.4kAutomated safety check: NotesAGPL-3.0
Project Referencesaiskillstore/marketplace430—~2.3kAutomated safety check: NotesNone
GitHub Runnermagnus919/agent-skills113—~1.7kAutomated safety check: PassMIT

Similar skills

  • Cloudrun Development

    TencentCloudBase/CloudBase-AI-Toolkit

    CloudBase Run backend development rules (Function mode/Container mode).

    1.1k GitHub starsUsed in 1 repo~7.2k tokens
    DatabasesAuto-check passed
  • Official

    Keeps every reference to the redislabs client-libs-test image tag in sync across the Makefile, compose file, GitHub workflows and docs when a Redis test version changes.

    22k GitHub stars~1.5k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Supercheck Infrastructure Deployment

    supercheck-io/supercheck

    Work on Supercheck Docker Compose, K3s, Kubernetes manifests, gVisor, OpenTofu/Hetzner, secrets, external services, autoscaling, backups, disaster recovery, DNS/TLS, or production deployment.

    215 GitHub stars~1.4k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Project References

    aiskillstore/marketplace

    Look up conventions, patterns, and concrete implementations from your own GitHub repositories checked out locally under ~/projects/referenzen/.

    430 GitHub stars~2.3k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • GitHub Runner

    magnus919/agent-skills

    Deploy, manage, and troubleshoot self-hosted GitHub Actions runners.

    113 GitHub stars~1.7k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Cloud SaaS Mode

    chmonitor/chmonitor

    Work on chmonitor's Cloud (SaaS) vs self-hosted (OSS) behaviour from ONE codebase.

    299 GitHub stars~2.5k tokensUpdated 2 days ago
    DatabasesAuto-check: notes

Questions about Tgf Server Dev

What does Tgf Server Dev do?

基于 tgf v2(github.com/thkhxm/tgf/v2)用确定性的 tgfctl 工作流创建、验证和维护 Go 游戏服务器项目。. Tgf Server Dev is an agent skill from thkhxm/tgf.

When should I use Tgf Server Dev?

Tgf Server Dev fits situations like: tasks that involve Container orchestration; tasks that involve Realtime and WebSockets; tasks that involve Containers.

How do I install Tgf Server Dev in Claude Code?

Run `npx skills add thkhxm/tgf --skill tgf-server-dev -a claude-code`. Or copy the skill folder (.claude/skills/tgf-server-dev in thkhxm/tgf) into .claude/skills/tgf-server-dev in your project. Claude Code loads it when a task matches its description.

How do I install Tgf Server Dev in Codex?

Run `npx skills add thkhxm/tgf --skill tgf-server-dev -a codex`. Or copy the skill folder (.claude/skills/tgf-server-dev in thkhxm/tgf) into .agents/skills/tgf-server-dev in your project. Codex loads it when a task matches its description.

Can I use Tgf Server Dev in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add thkhxm/tgf --skill tgf-server-dev -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tgf-server-dev, .gemini/skills/tgf-server-dev, .github/skills/tgf-server-dev and .opencode/skills/tgf-server-dev in your project.

What does Tgf Server Dev need to run?

Going by SKILL.md and its folder, Tgf Server Dev needs Python for the scripts in its folder and the command-line tools its instructions call (go and gh). Our summary lists: Python 3; Docker.

Does Tgf Server Dev access the network?

SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Tgf Server Dev safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Tgf Server Dev use?

Tgf Server Dev is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tgf Server Dev use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.3k tokens, read only when the agent opens those files.

What are the alternatives to Tgf Server Dev?

Skills that share tags, products or a category with Tgf Server Dev: Cloudrun Development (TencentCloudBase/CloudBase-AI-Toolkit, 1.1k stars), Redis Test Image Update (redis/go-redis, 22k stars), Supercheck Infrastructure Deployment (supercheck-io/supercheck, 215 stars) and Project References (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tgf Server Dev?

thkhxm (a GitHub user) maintains it in thkhxm/tgf, which has 128 GitHub stars. The repository was last updated on July 24, 2026.

Source: thkhxm/tgf on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.