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.
npx skills add fanqingxuan/awesome-skills --skill gormgit clone --depth 1 https://github.com/fanqingxuan/awesome-skillsWrote 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.
[](https://agentmods.dev/skills/fanqingxuan/awesome-skills/gorm)<a href="https://agentmods.dev/skills/fanqingxuan/awesome-skills/gorm"><img src="https://agentmods.dev/badge/skills/fanqingxuan/awesome-skills/gorm/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.
<a href="https://agentmods.dev/skills/fanqingxuan/awesome-skills/gorm"><img src="https://agentmods.dev/badge/skills/fanqingxuan/awesome-skills/gorm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00209 | $0.02816 |
| Opus 5 | $0.00105 | $0.01408 |
| Sonnet 5 | $0.00042 | $0.00563 |
| Haiku 4.5 | $0.00021 | $0.00282 |
Grade A, and why
gorm 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 12d 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.
How it starts
The opening of the file, as written. The whole thing — 465 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GORM 开发指南
GORM 是 Go 语言最流行的 ORM 库,提供完整的数据库操作功能。
⚠️ 重要说明
本 skill 专注于 GORM 的传统 API(Traditional API),不使用泛型方式。
所有示例代码均使用传统的链式调用方式,确保与现有代码和 GORM 插件的完全兼容性。
传统 API vs 泛型 API
// ✅ 使用传统 API(推荐)
var user User
db.Where("name = ?", "John").First(&user)
db.Create(&user)
db.Model(&user).Update("age", 30)
// ❌ 不使用泛型 API
// result := gorm.Query[User](db).Where("name = ?", "John").First()
快速开始
安装
go get -u gorm.io/gorm
go get -u gorm.io/driver/mysql
go get -u gorm.io/driver/postgres
go get -u gorm.io/driver/sqlite
连接数据库
package main
import (
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
func main() {
// MySQL
dsn := "user:password@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local"
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
if err != nil {
panic("failed to connect database")
}
// PostgreSQL
// dsn := "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable"
// db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
// SQLite
// db, err := gorm.Open(sqlite.Open("test.db"), &gorm.Config{})
}
模型定义
基础模型
type User struct {
ID uint `gorm:"primaryKey"`
Name string `gorm:"size:100;not null"`
Email string `gorm:"uniqueIndex;size:100"`
Age int `gorm:"default:0"`
Birthday *time.Time
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
使用 gorm.Model
type User struct {
gorm.Model
Name string
Email string
}
// gorm.Model 包含:
// ID uint
// CreatedAt time.Time
// UpdatedAt time.Time
// DeletedAt gorm.DeletedAt
字段标签
type User struct {
ID uint `gorm:"primaryKey"`
Name string `gorm:"size:100;not null;index"`
Email string `gorm:"uniqueIndex;size:100"`
Age int `gorm:"default:18"`
Active bool `gorm:"default:true"`
Salary float64 `gorm:"type:decimal(10,2)"`
Profile string `gorm:"type:text"`
Extra string `gorm:"-"` // 忽略该字段
}
What ships with it
45 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.
- references/advanced_query.md 20 KB
- references/associations.md 13 KB
- references/belongs_to.md 3.2 KB
- references/changelog.md 2.1 KB
- references/composite_primary_key.md 600 B
- references/connecting_to_the_database.md 11 KB
- references/constraints.md 1.2 KB
- references/context.md 3.5 KB
- references/conventions.md 4.6 KB
- references/create.md 10 KB
- references/data_types.md 6.5 KB
- references/dbresolver.md 4.1 KB
- references/delete.md 7.5 KB
- references/error_handling.md 3.8 KB
- references/generic_interface.md 991 B
- references/gorm_config.md 3.6 KB
- references/has_many.md 2.7 KB
- references/has_one.md 2.9 KB
- references/hints.md 1.3 KB
- references/hooks.md 3.1 KB
- references/index.md 3.0 KB
- references/indexes.md 3.7 KB
- references/logger.md 1.9 KB
- references/many_to_many.md 6.4 KB
- references/method_chaining.md 9.0 KB
- references/migration.md 8.7 KB
- references/models.md 11 KB
- references/performance.md 3.2 KB
- references/polymorphism.md 1.6 KB
- references/preload.md 7.5 KB
- references/prometheus.md 1.8 KB
- references/query.md 16 KB
- references/scopes.md 3.1 KB
- references/security.md 2.8 KB
- references/serializer.md 5.1 KB
- references/session.md 7.1 KB
- references/settings.md 1.6 KB
- references/sharding.md 2.4 KB
- references/sql_builder.md 11 KB
- references/the_generics_way.md 8.5 KB
- references/transactions.md 3.3 KB
- references/update.md 14 KB
- references/v2_release_note.md 27 KB
- references/write_driver.md 5.3 KB
- references/write_plugins.md 5.6 KB
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.
- 12d ago First seen · 465 lines · 209 tokens per session scan A f5942ad5fe90
gorm is a skill published in the GitHub repository fanqingxuan/awesome-skills (27 stars, last pushed 4mo ago), licensed MIT. It adds 209 tokens to every session and 2,816 once invoked, about $0.0010 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.
Other skills, from other repositories
golang-pro
Implements concurrent Go patterns using goroutines and channels, designs and builds microservices with gRPC or REST, optimizes Go application performance with pprof, and enforces idiomatic Go with generics, interfaces, and robust error handling. Use when building Go applications requiring concurrent programming…
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…
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…
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…
ecto-patterns
Ecto patterns — schemas, changesets, queries, migrations, Multi, associations, preloads, upserts. Use when editing Repo calls, Ecto.Query, or schema fields. Skip for Ash.
compiling
Compile and build the SkyWalking BanyanDB project. Use when the user asks to compile, build, or generate code for this project.