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 wu529778790/shenzjd-skills --skill db-migration-helpergit clone --depth 1 https://github.com/wu529778790/shenzjd-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/wu529778790/shenzjd-skills/db-migration-helper)<a href="https://agentmods.dev/skills/wu529778790/shenzjd-skills/db-migration-helper"><img src="https://agentmods.dev/badge/skills/wu529778790/shenzjd-skills/db-migration-helper/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/wu529778790/shenzjd-skills/db-migration-helper"><img src="https://agentmods.dev/badge/skills/wu529778790/shenzjd-skills/db-migration-helper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk fail
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.00032 | $0.01072 |
| Opus 5 | $0.00016 | $0.00536 |
| Sonnet 5 | $0.00006 | $0.00214 |
| Haiku 4.5 | $0.00003 | $0.00107 |
Grade A, and why
db-migration-helper 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 — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DB Migration Helper
分析 model 变更,生成安全的数据库迁移 SQL。
Overview
对比代码中的实体/模型定义与当前数据库 schema,检测结构变更(新增表、增删列、改类型),生成向前兼容的迁移 SQL。支持 MySQL、PostgreSQL、SQLite。
When to Use
- User wants to create database migrations
- User modified model/entity definitions
- User mentions migration, schema change, or sync
- User says "生成迁移" / "create migration"
- User inputs
/db-migration-helper
When NOT to Use:
- User only wants to view database structure
- User wants data migration (not schema)
- User uses ORM auto-migration
- User wants to generate seed data
- User wants to backup/restore database
Core Pattern
Step 1: 检测项目类型和 ORM
| 检测文件 | ORM/框架 | 迁移方式 |
|---|---|---|
prisma/schema.prisma |
Prisma | 生成 SQL diff |
alembic/ |
SQLAlchemy + Alembic | 生成 Alembic migration |
migrations/ |
通用 | 扫描已有迁移推断 |
*.entity.ts / *.model.ts |
TypeORM / Sequelize | 从装饰器提取 |
schema.rb / db/migrate/ |
Rails | Rails migration |
Step 2: 提取当前 Schema
# Prisma (v2.18+,旧命令 introspect 已更名为 db pull,统一用 db pull)
npx prisma db pull 2>/dev/null
# 通用 — 从代码提取
grep -r "CREATE TABLE\|@Entity\|@Table\|model " --include="*.ts" --include="*.py" --include="*.go" -l
提取:
- 表名和列定义
- 列类型、约束(NOT NULL、DEFAULT、UNIQUE)
- 索引和外键
Step 3: 对比变更
对比代码中的 model 定义与已有 schema(或上一次迁移),检测:
| 变更类型 | 风险等级 | 说明 |
|---|---|---|
| 新增表 | 低 | 直接 CREATE TABLE |
| 新增列(有 DEFAULT) | 低 | ALTER TABLE ADD COLUMN |
| 新增列(无 DEFAULT) | 中 | 需要处理已有数据 |
| 删除列 | 高 | 可能丢失数据,需要确认 |
| 修改列类型 | 高 | 可能不兼容 |
| 新增索引 | 低 | CREATE INDEX |
| 删除索引 | 低 | DROP INDEX |
Step 4: 生成迁移文件
使用 templates/migration.sql 模板,生成:
- Up 迁移 — 正向变更 SQL
- Down 回滚 — 反向回滚 SQL
- 风险评估 — 标注高风险操作
-- Migration: 20260603_add_user_avatar
-- Risk: LOW
-- Up
ALTER TABLE users ADD COLUMN avatar_url VARCHAR(500);
CREATE INDEX idx_users_email ON users(email);
-- Down
DROP INDEX idx_users_email;
ALTER TABLE users DROP COLUMN avatar_url;
Quick Reference
/db-migration-helper # 检测变更,生成迁移
/db-migration-helper --dry-run # 只预览 SQL 不执行
/db-migration-helper --name add_user # 指定迁移名称
What ships with it
2 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.
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 · 115 lines · 32 tokens per session scan A a708a2b31505
db-migration-helper is a skill published in the GitHub repository wu529778790/shenzjd-skills (0 stars, last pushed 4d ago), licensed MIT. It adds 32 tokens to every session and 1,072 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-31.
Other skills, from other repositories
mssql-query
Query the stack's SQL Server (mssql-express) from the sandbox: probe, databases, tables, schema, sample rows, read-only SQL, and opt-in DML/DDL. Connection string comes from GADBCONNECTIONSTRING in the Guide's Environment variables. Use when the user wants to inspect or query the GuideAnts database.
api-baas-firebase
Firebase backend-as-a-service — Firestore, Authentication, Cloud Functions v2, Storage, Hosting, Admin SDK, security rules, emulator suite.
api-database-mongodb
Native MongoDB driver (the mongodb npm package) - MongoClient lifecycle, typed collections, CRUD result shapes, cursors, aggregation pipelines, index design, transactions.
api-baas-neon
Serverless PostgreSQL with branching, autoscaling, and edge-compatible driver.
api-baas-planetscale
Serverless MySQL platform with branching, deploy requests, and edge-compatible driver.
api-database-cockroachdb
CockroachDB distributed SQL -- transaction retries, multi-region, online schema changes, follower reads, PostgreSQL compatibility gaps.