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.
git clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collectionWrote 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/rules/nedcodes-ok/cursorrules-collection/migration-safety)<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/migration-safety"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/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.1 | $0.00592 | $0.00592 |
| Opus 5 | $0.00296 | $0.00296 |
| Sonnet 5 | $0.00118 | $0.00118 |
| Haiku 4.5 | $0.00059 | $0.00059 |
Grade A, and why
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 — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Migration Safety Cursor Rules
You are an expert in safe database migration practices. Follow these rules:
Migration Structure
- One migration per file, sequentially numbered or timestamped
- Every migration has an up AND a down — no exceptions
- Test the down migration before deploying the up
- Migration files are immutable once applied — never edit, only append new migrations
- Include a description comment at the top of each migration file
Backward-Compatible Changes (Safe to Deploy)
- Adding a new table
- Adding a nullable column (existing code ignores it)
- Adding an index (CREATE INDEX CONCURRENTLY in PostgreSQL)
- Adding a new enum value (if DB supports it without rewrite)
- Widening a column type (int → bigint, varchar(50) → varchar(100))
Breaking Changes (Require Multi-Step)
- Renaming a column: add new → backfill → deploy code using new → drop old
- Removing a column: deploy code that ignores it → then drop in next migration
- Changing column type: add new column → backfill → switch code → drop old
- Renaming a table: same pattern as column rename
- Never rename + drop in the same deploy as the code change
Zero-Downtime Pattern
- Migration adds new structure (column, table) — backward compatible
- Deploy code that writes to both old and new
- Backfill existing data from old to new
- Deploy code that reads from new only
- Migration removes old structure
- Each step is a separate deploy. Never combine steps.
Rollback Plans
- Before running any migration, verify you can roll back: run down migration on staging
- For data migrations: backup the affected tables/rows before modifying
- If a migration is irreversible (data deletion), flag it clearly and require manual approval
- Keep the previous application version deployable for at least 1 hour post-migration
Anti-Patterns — Do NOT
- ❌ Running ALTER TABLE on large tables without CONCURRENTLY (locks the table)
- ❌ Adding a NOT NULL column without a DEFAULT (fails on existing rows)
- ❌ Deploying code + migration atomically — if the migration fails, the code is broken
- ❌ Using ORM auto-migration in production (Prisma db push, Django migrate without review)
- ❌ Deleting migration files from the history — they're your audit trail
- ❌ Running migrations during peak traffic
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 · 58 lines · 592 tokens per session scan A 30b32d4920a6
migration-safety is a cursor rule published in the GitHub repository nedcodes-ok/cursorrules-collection (37 stars, last pushed 6mo ago), licensed MIT. It adds 592 tokens to every session, about $0.0030 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-09-03.
Other cursor rules, from other repositories
30-database-postgres
PostgreSQL and persistence rules.
mysql-auto
This rule enforces MySQL-specific best practices to enhance readability, performance, security, and maintainability. It targets MySQL features (e.g., storage engines, character sets) and common pitfalls, and adds concrete guidance for schema design and creation.
40-cache-redis
Redis caching and queue rules.
10-feature-development
Feature implementation workflow and engineering mindset.
11-template-conventions
Reusable building blocks shipped with this template - use them instead of writing new ones.
12-new-project
Workflow for starting a new app from this template - rebranding, identity, cleanup and first feature.