go-hichat-api: Skill for Claude Code

.claude/skills/new-model/SKILL.md

new-model is a skill for Claude Code from iceymoss/go-hichat-api. It costs 24 tokens per session (544 once invoked), scanned A, original, Apache-2.0.

A guided workflow for adding a database table or fields to a go-zero project using GORM, a Go database library, and generated models.

In plain words
What is it for?
Use it to agree on a schema, write database changes, generate models, update automatic migrations or SQL scripts, handle database-specific branches, and test the result.
Why use it?
It makes the schema change explicit before code is written and keeps the database structure compatible with MySQL, PostgreSQL, and SQLite. It also covers migration safety, defaults, and cleanup in tests.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is iceymoss/go-hichat-api's own configuration. It tells Claude Code how to work on go-hichat-api itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything go-hichat-api configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is goctl model mongo --type <Type> --dir ./apps/<svc>/models/.

Reuse

Borrowing it

Nothing to install: this file belongs to iceymoss/go-hichat-api. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/iceymoss/go-hichat-api/main/.claude/skills/new-model/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/iceymoss/go-hichat-api

Made for: Claude Code.

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 new-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/iceymoss/go-hichat-api/new-model.svg)](https://agentmods.dev/skills/iceymoss/go-hichat-api/new-model)
Your own site
<a href="https://agentmods.dev/skills/iceymoss/go-hichat-api/new-model"><img src="https://agentmods.dev/badge/skills/iceymoss/go-hichat-api/new-model.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 544 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00024 $0.00544
Opus 5 $0.00012 $0.00272
Sonnet 5 $0.00005 $0.00109
Haiku 4.5 $0.00002 $0.00054

Measured 8d ago against content hash c7e3c70768fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

new-model 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 8d 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.

.claude/skills/new-model/SKILL.md · 58 lines

What it actually says

新增数据库表 / 字段。结构变更前必须先与用户对齐 schema

步骤

1. 与用户对齐 schema(必须)

database-model.md,问清楚:

  • 表名、字段、类型、索引、是否软删除
  • JSON 字段统一用 TEXT(不要用 JSONB)
  • 主键交给 GORM 处理(不写 AUTO_INCREMENT / SERIAL)
  • 三库兼容:MySQL / PostgreSQL / SQLite 都跑得过

2. 写 DDL

  • MySQL:deploy/sql/<svc>.sql(追加新表/ALTER TABLE
  • 注意:SQLite 不支持 ALTER COLUMN,只能 ADD COLUMN
  • 保留字列名用 commonGroupCol / commonKeyCol(见 model/main.go 约定)
  • 布尔值用 commonTrueVal / commonFalseVal

3. 生成 GORM model

goctl model mysql ddl -src=./deploy/sql/<svc>.sql -dir=./apps/<svc>/models/ -c

如果是 MongoDB:

goctl model mongo --type <Type> --dir ./apps/<svc>/models/

4. 迁移 / 初始化

如果项目用代码自动迁移,确认 AutoMigrate 列表里加上新模型。 否则在 deploy/sql/ 提供 idempotent 的 SQL 脚本。

5. 数据库分支

需要数据库特定 SQL 时用:

common.UsingPostgreSQL { ... }
common.UsingSQLite     { ... }
common.UsingMySQL      { ... }

不要把 MySQL 方言的语法直接写死。

6. 测试

  • 单元测试不 mock 数据库(test-files.md
  • 测试结束清理数据
  • 三种数据库环境都跑通

严格约束

  • 绝对不修改 .env
  • 绝对不直接 drop / truncate 现有表
  • 新增字段如果是 NOT NULL,必须给默认值(兼容旧行)
  • 涉及生产数据的迁移必须在 PR 描述里说明回滚方案
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. 8d ago First seen · 58 lines · 24 tokens per session scan A c7e3c70768fb

Subscribe to this mod's changes

new-model is a skill published in the GitHub repository iceymoss/go-hichat-api (41 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 544 once invoked, about $0.0001 per session on Opus 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.

Related

Other skills, from other repositories

golang-database

Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context propagation, and migration tooling. Use when writing, reviewing, or debugging Golang code that interacts with PostgreSQL…

samber/cc-skills-golang · 99 tokens

golang-samber-hot

In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports…

samber/cc-skills-golang · 122 tokens

vendor-update

Upgrade Go/Node.js vendor dependencies and sync tool versions. Use whenever the user says "upgrade dependencies", "update vendors", "vendor update", "run vendor-upgrade", "bump dependencies", "update packages", or asks to run the vendor-update Make target. This skill also checks scripts/build/version.mk after…

apache/skywalking-banyandb · 95 tokens

compiling

Compile and build the SkyWalking BanyanDB project. Use when the user asks to compile, build, or generate code for this project.

apache/skywalking-banyandb · 31 tokens

neo4j-driver-go-skill

Covers the Neo4j Go Driver v6 — driver lifecycle, ExecuteQuery, managed and explicit transactions, session config, error handling, data type mapping, and connection tuning. Use when writing Go code that connects to Neo4j, setting up NewDriver or ExecuteQuery, debugging sessions/transactions/result handling, or working…

neo4j-contrib/neo4j-skills · 143 tokens

go-database

Database patterns for Go services: database/sql, connection management, transactions, migrations, query builders, and ORM usage (sqlc, GORM, ent). Use when: "database access", "SQL query", "connection pool", "transactions", "database migration", "sqlc", "GORM", "ent", "prepared statement", "repository pattern". Not…

eduardo-sl/go-agent-skills · 103 tokens