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 agentmods add skills/luqiang-code/claude-code-skills/db-migration-safetynpx skills add luqiang-code/claude-code-skills --skill db-migration-safetygit clone --depth 1 https://github.com/luqiang-code/claude-code-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/luqiang-code/claude-code-skills/db-migration-safety)<a href="https://agentmods.dev/skills/luqiang-code/claude-code-skills/db-migration-safety"><img src="https://agentmods.dev/badge/skills/luqiang-code/claude-code-skills/db-migration-safety.svg" alt="Measured on agentmods" 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 | $0.00039 | $0.00686 |
| Opus 5 | $0.00019 | $0.00343 |
| Sonnet 5 | $0.00008 | $0.00137 |
| Haiku 4.5 | $0.00004 | $0.00069 |
Grade A, and why
db-migration-safety 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 4d 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 — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Migration Safety Review
Review migrations for safety risks before they hit production.
When to Use
- About to run a migration on a large table
- Reviewing a PR with migration files
- User mentions "migration", "schema change", "alter table"
When NOT to Use
- Writing new migrations (use normal review for that)
- NoSQL databases (different safety profile)
- Small dev databases with no data
Workflow
- Read the migration file(s)
- For each operation, check:
Adding a column
- Does it have a DEFAULT? (instant in PG11+, slow without)
- Is it NOT NULL without DEFAULT? (DANGER: will fail on existing rows)
- Is there a backfill plan for existing rows?
Removing a column
- Are there any code references still using it? (grep the codebase)
- Is it part of any indexes or constraints?
Adding an index
- Is it CREATE INDEX CONCURRENTLY? (non-blocking, preferred)
- Estimated index size and creation time on table with N rows?
Changing a column type
- Will it lock the table? (most type changes require ACCESS EXCLUSIVE lock)
- Is there data that won't convert cleanly?
Adding a foreign key
- Are both tables on the same database?
- Is the referenced column indexed?
- Check for rollback safety: does the
downmigration actually revert theup? - Flag any operations that will cause downtime
- Output a risk assessment
Output Format
## Migration Safety Review: 0042_add_user_preferences.sql
### Risk: HIGH
- Line 12: ALTER TABLE users ADD COLUMN preferences JSONB NOT NULL
→ Will fail if users table has rows. Add DEFAULT '{}' first.
### Risk: MEDIUM
- Line 8: CREATE INDEX idx_users_email ON users(email)
→ Consider CREATE INDEX CONCURRENTLY to avoid table lock
→ Table has ~500K rows, estimated time: ~3s
### Safe
- Line 3: CREATE TABLE user_preferences — new table, no risk
- Line 15: ALTER TABLE users ADD COLUMN timezone VARCHAR DEFAULT 'UTC' — has DEFAULT, PG11+, instant
### Rollback: PARTIAL
- Down migration removes user_preferences table (destructive, data loss)
→ Consider RENAME instead of DROP for rollback safety
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.
- 4d ago First seen · 91 lines · 39 tokens per session scan A d381c07a967f
db-migration-safety is a skill published in the GitHub repository luqiang-code/claude-code-skills (2 stars, last pushed 3mo ago), licensed MIT. It adds 39 tokens to every session and 686 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
dev-supabase
Backend development with Supabase. Trigger when the user wants to configure auth, the database, or Supabase storage.
ops-database
Database schema design. Trigger when the user wants to create tables, migrations, or optimize queries.
dev-prisma
Development with Prisma ORM (schema, migrations, type-safe queries, Accelerate, transactions). Trigger when the user wants to add a model, create a migration, optimize Prisma queries, or when schema.prisma is detected in the project.
erpnext-frappe-dev
Complete Frappe Framework development reference for building ERPNext apps. Use when creating custom DocTypes, controllers, hooks, REST APIs, form scripts, background jobs, or any Frappe/ERPNext development. Contains full API documentation for Document, Database, Controllers, Hooks, REST API, Form Scripts, Testing, and…
skill-builder
Automatically detect source types and build AI skills using Skill Seekers. Use when the user wants to create skills from documentation, repos, PDFs, videos, or other knowledge sources.
golden-chat-topics
Use when testing the goldenchattopics golden build.