Install
$ agentstack add skill-yuaicode-ai-skills-go-migration-guard ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
go-migration-guard — GORM 迁移覆盖启发式检查
> 启发式提醒,不是保证。 脚本只看 diff 里的文本信号,无法执行 SQL 或理解运行时逻辑。Claude 应结合实际 migration 文件内容判断,不要凭本 skill 的结论臆断"已覆盖"或"一定缺失"。
何时触发
用户说:
- "检查一下迁移 / migration 覆盖了吗"
- "gorm 模型改了,有没有加迁移"
- "迁移链断了 / 数据库和模型不同步了"
- "AutoMigrate 会自动加字段吗"
- 代码 review 时看到
.go里有 gorm struct 改动,想确认迁移
用法
- 在目标 repo 根目录运行(与
git命令并列):
``bash bash /bin/check-migration.sh [base] # base 缺省:自动探测 main 或 master;也可传 HEAD~1、某 commit hash 等 # 例:bash /bin/check-migration.sh main ``
脚本输出两类信息:
- 字段变更列表 — diff 里所有新增(
+)或删除(-)且含gorm:"的 struct 字段行。 - 迁移线索评估 — 若 diff 里完全没有迁移线索(没动 migration 目录、没有
AutoMigrate相关字样),给出更强提醒。
退出码:
0— 没有检测到 gorm 字段变更(放行)2— 检测到字段变更,需人工确认
- Claude 拿到输出后,应:
- 列出脚本找到的字段变更。
- 告知"是否在 diff 里看到迁移线索"。
- 如有线索,请用户确认对应 migration 文件里是否真的涵盖了这些列。
- 如无线索且项目不依赖 AutoMigrate,提醒用户补写 migration 文件。
确定性脚本做什么 / 不做什么
| 做 | 不做 | |---|---| | 扫 diff 中带 gorm:" 的新增/删除行 | 解析 SQL、运行数据库 | | 检测 migration 目录是否有变动 | 验证 migration 内容是否正确 | | 检测 AutoMigrate 字样 | 判断 AutoMigrate 是否在生产启用 | | 给出字段名+所在文件 | 做 schema diff |
边界
- 只读 git diff,不改任何文件。
- 不与
commit-guard-zh/bin/gorm-mysql-check.sh重复:那个脚本扫"TEXT/JSON 带 DEFAULT"这一特定非法写法;本 skill 聚焦"模型字段有没有迁移覆盖"的更宏观问题。 - 依赖
git;不依赖其他外部工具。 - 误报优于漏报:宁可提醒多余,也不想漏掉迁移缺失。
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: YuAICode
- Source: YuAICode/ai-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.