migration-scripts

Enforce frozen snapshots and isolated imports for database and config migrations.

9.0k|629|Updated Apr 16, 2025
One-click install
npx skills add https://github.com/mengxi-ream/read-frog --skill migration-scripts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migration-scripts
Source: https://github.com/mengxi-ream/read-frog/tree/main/.agents/skills/migration-scripts
Command: npx skills add https://github.com/mengxi-ream/read-frog --skill migration-scripts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing database/config migrations is error-prone when migrations reference code, rely on non-deterministic imports, or risk drift between environments. Enforcing frozen-snapshot migrations, safe registration, and lean import boundaries helps teams maintain stable upgrade paths.

Core Features & Use Cases

  • Frozen snapshots: migrations must not depend on evolving code, ensuring reproducible upgrades.
  • Validated registries: auto-discover and verify version-bridging steps to prevent gaps or duplicates.
  • Isolated imports: migration scripts live in isolation from the main app code, reducing blast radius.
  • Use Case: teams rolling from v001 to v003 can rely on a clear chain with validated steps.

Quick Start

Create a new migration under src/utils/config/migration-scripts/v001-to-v002.ts following the versioning rules.

Frequently Asked Questions about migration-scripts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create safe database migrations that don't break when app code changes?

Safe database migrations require frozen snapshots and isolated scripts that do not import evolving code from the main application, ensuring deterministic and reproducible upgrades without drift.

How do I validate a config migration registry to prevent version gaps?

Validating a config migration registry involves auto-discovering and verifying version-bridging steps to ensure a clear from-to version chain, preventing gaps or duplicates across multiple schema versions.

Why should migration scripts be isolated from the main codebase imports?

Migration scripts must be isolated from main codebase imports to reduce the blast radius of changes, enforce self-contained execution, and guarantee that upgrades remain stable and independent of evolving application logic.

How do I set up a version chain for schema migrations from v001 to v003?

Setting up a version chain for schema migrations requires creating self-contained scripts like v001-to-v002.ts in the migration-scripts directory, allowing the system to validate the complete from-to version progression.

What are the limitations of using frozen snapshots for config management?

Frozen snapshot migrations require all inputs and outputs to be typed as any and prohibit dependencies on the main codebase, which limits dynamic code reuse but guarantees reproducible and safe upgrade paths.

Do I need specific typing rules for writing isolated migration scripts?

Writing isolated migration scripts requires all inputs and outputs to be typed as any, ensuring the scripts remain self-contained and do not rely on type definitions imported from the evolving main codebase.