migration

migration is a cursor rule for Cursor from mhmdreza-rafiei/agent-tools. It costs 864 tokens per session, scanned A, original, MIT.

A set of rules for safely moving, renaming, splitting, or merging code files and modules.

In plain words
What is it for?
It helps inventory references, plan a code move, update every consumer, preserve history with Git, and verify the old location before removing it.
Why use it?
It reduces broken imports, configuration references, documentation links, and tests during structural changes.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit It helps inventory references, plan a code move, update every consumer, preserve history with Git, and verify the old location before removing it.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mhmdreza-rafiei/agent-tools/migration
Install

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.

Clone the repo
git clone --depth 1 https://github.com/mhmdreza-rafiei/agent-tools

Made for: Cursor.

Wrote 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.

agentmods badge for migration

README.md
[![agentmods](https://agentmods.dev/badge/rules/mhmdreza-rafiei/agent-tools/migration/github.svg)](https://agentmods.dev/rules/mhmdreza-rafiei/agent-tools/migration)
Your own site
<a href="https://agentmods.dev/rules/mhmdreza-rafiei/agent-tools/migration"><img src="https://agentmods.dev/badge/rules/mhmdreza-rafiei/agent-tools/migration/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.

agentmods 80×15 button for migration

Your own site · 80×15
<a href="https://agentmods.dev/rules/mhmdreza-rafiei/agent-tools/migration"><img src="https://agentmods.dev/badge/rules/mhmdreza-rafiei/agent-tools/migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 864 This file is loaded in full into every session.
When invoked 864 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00864 $0.00864
Opus 5 $0.00432 $0.00432
Sonnet 5 $0.00173 $0.00173
Haiku 4.5 $0.00086 $0.00086

Measured 8d ago against content hash 33448e360ae0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

migration 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 8d 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.

rules/global/migration.mdc · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code migration (structure & location)

Structural changes: move/rename files or folders, relocate symbols to another module, split/merge files, or rename exports used across the repo.

Not database schema migrations (use project-specific migration tools for those).

Skip when the task is chat-only or a tiny edit with no path or module boundary change.

Before you change anything

  1. Inventory — Search for the old path, file name, folder name, and public symbols (imports, require, dynamic imports, string paths, URLs in config).
  2. Plan — List what will move, what will reference it, and config/docs that must change (build, test, CI, Docker, path aliases, package.json exports, OpenAPI paths, etc.).
  3. Checkpoint — If the repo has git, suggest a local commit (per git-workflow) before large moves so rollback is one command away.
  4. Prefer git mv when using git — preserves history and makes the rename obvious in diffs.

Execution order (safeguards)

Do not delete or drop the old location until the migration is verified.

1. Add destination (new file/folder or new exports) — copy or move content
2. Update every consumer (imports, configs, docs, tests, assets)
3. Verify (grep, build, tests, run app if relevant)
4. Remove old only when nothing legitimate still points at it
  • Move/rename: Update references first or in the same change set as the move; never leave the tree broken overnight if avoidable.
  • Extract code to another file: New module must compile and callers must use it; then remove duplicated code from the source file.
  • Rename symbol: Update definitions, imports, re-exports, tests, and docs; grep old name before deleting anything.

Removing the old version

Situation Rule
Old file after move Delete only after zero stale path references and verification passes
Leftover duplicate logic Remove duplicate after behavior is unchanged (diff mentally or test)
Empty directory Remove after children moved and tooling does not require the path
Public API rename Ask if a compat shim is needed (re-export / deprecated alias) unless user asked for a clean break

Read the full file on GitHub · 74 lines

Changes

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.

  1. 8d ago First seen · 74 lines · 864 tokens per session scan A 33448e360ae0

Subscribe to this mod's changes

migration is a cursor rule published in the GitHub repository mhmdreza-rafiei/agent-tools (5 stars, last pushed 24d ago), licensed MIT. It adds 864 tokens to every session, about $0.0043 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.