new-model

new-model is a skill for Claude Code from zuoyebang/aiweave. It costs 33 tokens per session (1,022 once invoked), scanned A, original, Apache-2.0.

A generator that turns a database table definition, called DDL, into a GORM model. GORM is a Go library that maps database tables to Go structs.

In plain words
What is it for?
Use it to create or update one model or all models from the database design document, including fields, types, and GORM mappings.
Why use it?
It avoids manually translating columns, nullability, database types, and field tags. It also places the model in the package and database area specified by the project design.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go build ./models/{db_package}/....

Good fit Use it to create or update one model or all models from the database design document, including fields, types, and GORM mappings.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/zuoyebang/aiweave
agentmods
npx agentmods add skills/zuoyebang/aiweave/new-model

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/zuoyebang/aiweave/new-model.svg)](https://agentmods.dev/skills/zuoyebang/aiweave/new-model)
Your own site
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-model"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-model.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,022 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.00033 $0.01022
Opus 5 $0.00016 $0.00511
Sonnet 5 $0.00007 $0.00204
Haiku 4.5 $0.00003 $0.00102

Measured 7d ago against content hash 3ae39ffc2730, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, 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 7d 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.

templates/skills/new-model/SKILL.md · 93 lines

How it starts

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

根据 $ARGUMENTS 从 DDL 文档生成 GORM Model 文件。

公共步骤模板见 skills-spec/01_skill_authoring_guide.md §A-§E。本 Skill 特定内容如下。

第 0 步:拒绝规则与依赖前置

  • ⛔ 拒绝(§A.1):表名属于 BUILD_STATUS.md §0 的 🚫 模块时立即拒绝
  • 状态检查(§A.2):读 BUILD_STATUS.md §3 模型层明细
  • 依赖(§A.3):目标包目录(models/db_xxx/)不存在则先创建

第 1 步:读取 DDL(公共必读见 §B)

  • 主文档:docs/schema/database_design.md
  • 如参数为 all,提取所有表 DDL;否则定位到指定表
  • 确认表所属库(§1 表清单 / §2 分库设计)

第 2 步:确定文件路径与类型映射

数据库 Go 包 目录
db_xxx_core db_xxx_core models/db_xxx_core/
db_xxx_trade db_xxx_trade models/db_xxx_trade/
db_xxx_log db_xxx_log models/db_xxx_log/
db_xxx_call_log db_xxx_call_log models/db_xxx_call_log/

类型映射

  • bigint unsigned NOT NULL AUTO_INCREMENT → uint64
  • varchar(N) NOT NULL → string;可空 → *string
  • tinyint NOT NULL → int8;可空 → *int8
  • int NOT NULL → int;bigint NOT NULL → int64
  • decimal NOT NULL → float64
  • datetime NOT NULL → time.Time
  • date NOT NULL → string(YYYY-MM-DD)

第 3 步:生成 struct

package {db_package}

import "time"

type {StructName} struct {
    ID        uint64    `gorm:"column:id;primaryKey" json:"id"`
    Field1    string    `gorm:"column:field_1;type:varchar(32);not null;default:''" json:"field_1"`
    Status    int8      `gorm:"column:status;not null;default:0" json:"status"`
    Deleted   int8      `gorm:"column:deleted;not null;default:0" json:"deleted"`
    CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
    UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
}

func ({StructName}) TableName() string {
    return "{table_name}"
}

按月分片表需额外 ShardTableName

func ShardTableName(t time.Time) string {
    return fmt.Sprintf("{table}_%s", t.Format("200601"))
}

GORM tag 规则:必含 column:{snake};主键 primaryKey;varchar/decimal/text 加 type:{完整类型};NOT NULL → not null;DEFAULT → default:{值};敏感字段(凡含密钥 / 哈希 / token 类——落地按业务字段名补充)json:"-"

第 4 步:已有文件处理 + 文档同步(公共项见 §C)

Read the full file on GitHub · 93 lines

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. 7d ago First seen · 93 lines · 33 tokens per session scan A 3ae39ffc2730

Subscribe to this mod's changes

new-model is a skill published in the GitHub repository zuoyebang/aiweave (20 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 33 tokens to every session and 1,022 once invoked, about $0.0002 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

kotlin-exposed-patterns

JetBrains Exposed ORM patterns including DSL queries, DAO pattern, transactions, HikariCP connection pooling, Flyway migrations, and repository pattern.

hashgraph-online/awesome-codex-plugins · 36 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

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

golang-patterns

A collection of idiomatic Go patterns for building clear, robust, and maintainable applications. It covers error handling, interfaces, zero values, and package design.

loulanyue/awesome-claude-notes · 49 tokens