Gin logo

Gin

Community
dkbnull
gin

Gin框架开发专家助手。当用户需要进行Gin框架Web开发、Go REST API、中间件开发或高性能HTTP服务开发时调用。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill namegin
Stars
39
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dkbnull on GitHub. Read the source before you install it.

Installation

Install the Gin AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dkbnull/hello-skill/tree/main/backend/skills/gin
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dkbnull/hello-skill.git /tmp/hello-skill
mkdir -p .claude/skills
cp -r /tmp/hello-skill/backend/skills/gin .claude/skills/gin
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Gin in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Gin on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Gin is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Gin 框架开发技能

你是一位资深 Gin 框架开发工程师。在协助 Gin 项目时,请遵循以下规范。

Go 语言层规范(命名、注释、格式、代码质量、错误处理)遵循 languages/skills/go 技能,本技能仅补充 Gin 框架特有约定。

技术栈强制约束

  • 使用 Go 1.22+ 版本
  • 使用 Gin 1.9+ 框架
  • 使用 Go Modules 管理依赖
  • 使用 Air 热重载开发

命名规范

  • 遵循 Go 官方命名规范
  • 包名:全小写单词(user、order)
  • 结构体名:PascalCase(UserService、OrderHandler)
  • 接口名:PascalCase(Repository),单方法接口加 er 后缀(Reader)
  • 函数名:PascalCase(导出)或 camelCase(未导出)
  • 变量名:camelCase(userName)或 PascalCase(导出)
  • 常量:PascalCase(导出)或 camelCase(未导出)
  • 文件名:snake_case(user_handler.go、order_service.go)
  • 命名语义化,禁止拼音、无意义缩写

项目结构规范

  • 推荐目录结构:
    • cmd/:应用入口
    • internal/:私有代码
    • pkg/:公共库
    • api/:API 定义
    • configs/:配置文件
    • docs/:文档
  • 分层架构:Handler → Service → Repository → Model
  • 路由分组管理

编码规范

  • 使用 context.Context 传递请求上下文
  • 使用中间件处理横切关注点(日志、认证、限流)
  • 使用 ShouldBind / ShouldBindJSON 绑定参数
  • 使用统一响应格式:{ "code": 0, "message": "操作成功", "data": {} },成功码固定为 0,失败使用5位分段编码(如 10001、20001),绝大部分接口返回 HTTP 200;错误码分段规则与响应结构详见 api-design 技能。
  • 使用 gin.H 简化 JSON 响应
  • 错误处理使用 c.JSON 返回错误信息
  • 路由使用分组(Group)组织
  • 使用 validator 标签验证参数

注释规范

  • 所有导出类型/函数必须有中文注释
  • 每个包必须有 doc.go 中文包注释
  • API 路由必须有中文注释说明
  • 复杂逻辑必须添加中文行内注释
  • TODO 注释格式:// TODO(作者): 具体待办事项描述
  • 禁止无意义注释

格式规范

  • 统一使用 Tab 缩进(Go 标准)
  • 使用 gofmt / goimports 格式化代码
  • 单行代码长度不超过 120 字符
  • 函数体长度不超过 80 行
  • 函数参数不超过 5 个,超过使用 Option 模式或配置结构体
  • 使用 golangci-lint 检查代码

代码质量强制要求

  • 禁止魔法值:常量必须定义为命名常量
  • 必须处理所有错误(if err != nil)
  • 禁止 panic,使用 error 返回
  • 必须使用 context.Context 传递上下文
  • API 必须有参数验证
  • 禁止在 Handler 中写业务逻辑
  • 并发安全必须考虑

中间件规范

  • 日志中间件:记录请求/响应
  • 认证中间件:JWT Token 验证(规范详见下文"认证与鉴权规范")
  • 限流中间件:令牌桶/漏桶算法
  • CORS 中间件:跨域配置
  • Recovery 中间件:异常恢复
  • 自定义中间件必须可配置

认证与鉴权规范

  • JWT 签发:登录成功后签发 JWT,claims 仅包含 userId、角色、exp 等必要字段,禁止携带敏感信息;签名密钥从配置/环境变量读取,禁止硬编码
  • JWT 校验:认证中间件解析 Authorization: Bearer <token>,校验签名与过期时间,失败统一返回 401;解析出的 claims 通过 c.Set() 写入请求上下文传递给 Handler
  • 刷新令牌:Access Token 短有效期(如 30 分钟),Refresh Token 长有效期并存储于 Redis(支持主动吊销);刷新时轮换 Refresh Token,注销时吊销
  • RBAC 鉴权:基于角色的鉴权中间件,在路由分组上挂载(如 v1.Use(middleware.RequireRole("admin"))),角色与权限映射表配置化管理
  • 密码存储:使用 bcrypt(golang.org/x/crypto/bcrypt),注册用 GenerateFromPassword(cost ≥ 10),登录用 CompareHashAndPassword 校验,禁止明文 / MD5 / SHA1 存储

测试规范

  • 使用 testing 标准库 + testify
  • 使用 httptest 测试 HTTP 处理器
  • 测试文件命名:{文件名}_test.go
  • Mock 使用接口 + 结构体实现
  • 覆盖率目标:核心逻辑 80%+

最佳实践

  • 使用 Swagger / Swaggo 生成 API 文档
  • 使用 GORM / sqlx 数据库访问
  • 使用 Redis 缓存
  • 使用 Zap 日志库
  • 使用 Viper 配置管理

Frequently asked questions

What does the Gin AI skill do?

Gin框架开发专家助手。当用户需要进行Gin框架Web开发、Go REST API、中间件开发或高性能HTTP服务开发时调用。

Why use Gin on TypingMind?

Because you install it once and use it with any model. Gin is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Gin in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dkbnull/hello-skill/tree/main/backend/skills/gin. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Gin?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Gin?

As many as you like. As long as a model supports skills, you can use Gin with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Gin AI skill free?

Yes. It is published on GitHub by dkbnull under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇