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 latestaiagents/agent-skills --skill migration-safetygit clone --depth 1 https://github.com/latestaiagents/agent-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/latestaiagents/agent-skills/migration-safety)<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/migration-safety"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/migration-safety/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/latestaiagents/agent-skills/migration-safety"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/migration-safety.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.00068 | $0.02505 |
| Opus 5 | $0.00034 | $0.01252 |
| Sonnet 5 | $0.00014 | $0.00501 |
| Haiku 4.5 | $0.00007 | $0.00250 |
Grade A, and why
migration-safety scanned grade A with 1 finding 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
execSync('npx prisma migrate deploy'); How it starts
The opening of the file, as written. The whole thing — 410 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Migration Safety
CRITICAL: Migrations can destroy production data. This skill prevents catastrophic data loss.
The Problem This Solves
Real disaster scenarios:
- Migration fails halfway, rollback deletes all records
- Re-running migration truncates existing data
- Column drop removes 50,000 user records
- Foreign key constraint fails, cascade deletes everything
- "Fresh migration" on wrong database wipes production
Golden Rules
- NEVER run migrations without checking for existing data first
- ALWAYS create a backup before ANY migration
- NEVER re-run a migration that previously partially completed without investigation
- ALWAYS verify you're on the correct database/environment
- NEVER trust
migrate:freshormigrate:reseton any database with data
Pre-Migration Checklist
Step 1: Environment Verification
# Check current environment
echo $NODE_ENV
echo $RAILS_ENV
echo $APP_ENV
# Check database connection
# Laravel
php artisan db:show
# Rails
rails db:version
# Node.js (check connection string)
echo $DATABASE_URL
RED FLAGS - STOP IMMEDIATELY:
- Environment shows "production", "prod", "live"
- Database URL contains production hostname
- You're not 100% certain which database you're connected to
Step 2: Check Existing Data
-- Before ANY migration, check what exists
SELECT table_name,
(SELECT COUNT(*) FROM information_schema.columns
WHERE table_name = t.table_name) as columns,
(SELECT reltuples::bigint FROM pg_class
WHERE relname = t.table_name) as estimated_rows
FROM information_schema.tables t
WHERE table_schema = 'public'
ORDER BY table_name;
Present this to user:
## Current Database State
**Database:** [name]
**Environment:** [env]
**Tables:** [count]
**Total estimated rows:** [count]
| Table | Columns | Estimated Rows |
|-------|---------|----------------|
| users | 15 | 12,450 |
| orders | 23 | 89,234 |
| ... | ... | ... |
⚠️ This migration will affect a database with EXISTING DATA.
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.
- 7d ago First seen · 410 lines · 68 tokens per session scan A 53cdb40eb4f4
migration-safety is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 68 tokens to every session and 2,505 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
chroma-integration
Chroma local vector database setup and operations for development and production.
drizzle-orm-expert
Expert in Drizzle ORM for TypeScript — schema design, relational queries, migrations, and serverless database integration. Use when building type-safe database layers with Drizzle.
redis
Skill "redis" from dhaupin/vant, covering redis, when to use, what to do, 1. connect and 2. operations.
web-backend-builder
Scaffold backend API, data models, ORM setup, and endpoint inventory with OpenAPI output.
sql-optimisation
Universal SQL performance optimisation assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Provides execution plan analysis, pagination optimisation, batch operations, and performance monitoring guidance.
snowflake-semanticview
Create, alter, and validate Snowflake semantic views using Snowflake CLI (snow). Use when asked to build or troubleshoot semantic views/semantic layer definitions with CREATE/ALTER SEMANTIC VIEW, to validate semantic-view DDL against Snowflake via CLI, or to guide Snowflake CLI installation and connection setup.