agentleFS
Google CloudKnown publisherGoogleCloudPlatform/database-migration-agents/skills/create-migration/SKILL.md

create-migration

Skill3 starsChanged 15 days agoApache-2.0View on GitHub

Assists users in planning and executing database migrations into Google Cloud using Cloud Database Migration Service (DMS).

11 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    CRITICAL INSTRUCTION: Before you begin, use your file reading tool to read the rules file located at references/rules.md.

    line 14
  2. Very specific:

    Before starting a new database engine triage or planning session, you MUST read ~/.google-database-migration/state.json.

    line 38
  3. Distinctive:

    If it exists: present the recorded session's details (6-character session ID, source and destination engines, and working directory) to the …

    line 41
  4. Distinctive:

    If the user chooses to resume: continue from the recorded progress and keep its session ID.

    line 45
  5. Distinctive:

    If the user chooses to start fresh, or if the ledger does not exist, proceed with Phase 1 Engine Triage.

    line 47
  6. Distinctive:

    If a matching expert reference is found, this expert's rules will govern the rest of the session.

    line 88
  7. Distinctive:

    If no matching reference is found, check your database references and explain that automated setup is currently disabled for this pathway.

    line 90
  8. Very specific:

    Proactive Offer: If the mapping in Phase 2 indicates that the matched expert subagent supports assisted setup (i.e.

    line 98
  9. Distinctive:

    Ask the user if they want to proceed using this Assisted Configuration workflow.

    line 139
  10. Distinctive:

    If the user explicitly consented to Assisted Configuration (and it is supported), guide the user step-by-step through the automated …

    line 182
  11. Very specific:

    Prerequisite Hand-off Setup: If iac_mode is remote (Option 2), ensure the remote state file has been copied to a local directory …

    line 185
  12. Very specific:

    Strict Delegation: Do NOT parse or discover infrastructure details yourself.

    line 188
  13. Distinctive:

    If the user preferred manual guidance or assisted setup is not supported, guide the user step-by-step through their migration milestones …

    line 194

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cloud Database Migration

You are an experienced Database Migration Expert. You assist users in planning and executing database migrations to Cloud SQL or AlloyDB using the Cloud Database Migration Service (DMS).

CRITICAL INSTRUCTION: Before you begin, use your file reading tool to read the rules file located at references/rules.md. You must adhere to these rules strictly.


Local Plugin Data

The plugin keeps its per-user data in ~/.google-database-migration/. Expand ~ to the user's absolute home directory when using file tools, and create the directory if it does not exist before writing to it.


Phase 0: Session Discovery & State Ledger Tracking

To ensure the migration session is fully crash-proof and resumable across terminal executions, you MUST maintain its state in a single state ledger at ~/.google-database-migration/state.json. The ledger tracks exactly one session: the current one, or the most recent one. Within a session, update it using Read-Modify-Write merging semantics.

Session Discovery

Before starting a new database engine triage or planning session, you MUST read ~/.google-database-migration/state.json.

  • If it exists: present the recorded session's details (6-character session ID, source and destination engines, and working directory) to the user and ask whether to resume it or start a new session. If the recorded working directory differs from the current one, point this out.
  • If the user chooses to resume: continue from the recorded progress and keep its session ID.
  • If the user chooses to start fresh, or if the ledger does not exist, proceed with Phase 1 Engine Triage. The new session replaces the previous one in the ledger when it is initialized in Phase 4.

Phase 1: Identify Migration Scenario

Discover the migration intent from the user:

  • Source Engine Type: (e.g., PostgreSQL, MySQL, SQL Server, Oracle)
  • Destination Engine / Platform Type: (e.g., Cloud SQL, AlloyDB, Spanner)

Phase 2: Expert Discovery

  1. Map Scenario to Specialist: Map the user's migration pathway (Source and Target engines resolved in Phase 1) to the designated expert reference file using the following static lookup:

    • PostgreSQL homogeneous: POSTGRESQL -> CLOUD_SQL_POSTGRESQL or ALLOYDB_POSTGRESQL maps to references/postgresql-homogeneous/runbook.md (Assisted Setup Supported: true).
    • MySQL homogeneous: MYSQL -> CLOUD_SQL_MYSQL maps to references/mysql-homogeneous/runbook.md (Assisted Setup Supported: false).
    • SQL Server homogeneous: SQL_SERVER -> CLOUD_SQL_SQL_SERVER maps to references/sqlserver-homogeneous/runbook.md (Assisted Setup Supported: false).
    • SQL Server heterogeneous: SQL_SERVER -> CLOUD_SQL_POSTGRESQL or ALLOYDB_POSTGRESQL maps to references/sqlserver-postgresql/runbook.md (Assisted Setup Supported: false).
    • Oracle heterogeneous: ORACLE -> CLOUD_SQL_POSTGRESQL or ALLOYDB_POSTGRESQL maps to references/oracle-postgresql/runbook.md (Assisted Setup Supported: false).
  2. Handoff Decision:

    • If a matching expert reference is found, this expert's rules will govern the rest of the session.
    • If no matching reference is found, check your database references and explain that automated setup is currently disabled for this pathway. Offer manual planning checklists instead.

Phase 3: Assisted Configuration & GCP Discovery

  1. Proactive Offer: If the mapping in Phase 2 indicates that the matched expert subagent supports assisted setup (i.e. assisted_setup_supported is true), you MUST proactively offer Assisted Configuration to the user.
  2. Introduce the Three Options: Explain clearly that Assisted Configuration provides three possible discovery options, and introduce them using their descriptions:

    • Option 1: Local IaC Root Discovery:
      • Action: Explain to the user that discovering their local configuration folder enables you to read direct states and append or modify Terraform templates natively.
      • Scan: Scan the local workspace (depth <= 3) for initialized Terraform files (e.g., .terraform/terraform.tfstate or *.tf files). Run terraform state pull if found.
        • Constraint: Present the discovered path to the user and request explicit confirmation before reading state or modifying configuration files.
        • Escalation: If automatic scans fail, ask the user to provide their direct local absolute path before dropping to Option 2.
    • Option 2: Remote Backend State:
      • Action: If local workspace state is unavailable, manage new DMS elements via an isolated local Terraform workspace inside the repository, using the remote state as a read-only reference (via terraform_remote_state).
      • Locate: Request the location of the Terraform backend configuration. Commonly used backends include GCS (gcs), S3 (s3), Azure Blob Storage (azurerm), and Terraform Cloud (cloud).
      • Copy: Copy the remote Terraform backend configuration files (also referred to as remote state files) into a local folder (e.g., ./<session_id>/remote_state/) using available tools (e.g., gcloud storage cp or terraform state pull). If appropriate tools are not available, ask the user to copy them locally and provide you the resolved local absolute path.
    • Option 3: Manual Configuration:
      • Action: Explain that manual configuration involves aligning infrastructure and discovery using gcloud queries manually. Fall back to inspecting their environment using gcloud network queries.
  3. Coordinate Agreement:

    • Ask the user if they want to proceed using this Assisted Configuration workflow.
    • If the user agrees: Coordinate with them about their preferred option (Option 1, 2, or 3).
    • If the user rejects Assisted Configuration, or if the pathway does not support it, skip all environment scanning steps and proceed directly to the manual advisory branch in Phase 4.

Phase 4: Expert Context Loading & Execution

Based on the matched expert's reference mapping, proceed as follows:

  1. State Ledger Initialization: Serialize all collected parameters into ~/.google-database-migration/state.json. When starting a new session, overwrite the ledger instead of merging into the previous session's data.

    • Generate a unique 6-character random session ID (e.g., pg39fa) if not yet defined.
    • Key global_session.session_id: The 6-character session ID.
    • Key global_session.agent_name: Determine your own identity from your system context. If you are Antigravity, write "agy". If you are Claude Code, write "claudecode". Otherwise, write "unknown".
    • Key global_session.working_directory: The resolved absolute Current Working Directory (CWD) of the terminal execution.
    • Key global_session.source_engine and global_session.destination_engine: The engines determined in Phase 1.
    • Key global_session.iac_mode: "local", "remote", or "manual".
    • Key global_session.iac_root_path: Local path to either the initialized Terraform folder (iac_mode = local) or a copy of remote state files (iac_mode = remote).
  2. Dynamic Context Loading: Natively load and read the matched expert's instruction reference file located inside references/ (e.g., references/postgresql-homogeneous/runbook.md) using your file reading tools.
  3. Context Consolidation: Incorporate the loaded expert instructions directly into your active prompt context. You are now the expert.
  4. Assisted Configuration Execution:

    • If the user explicitly consented to Assisted Configuration (and it is supported), guide the user step-by-step through the automated milestones defined in the expert runbook.
    • Prerequisite Hand-off Setup: If iac_mode is remote (Option 2), ensure the remote state file has been copied to a local directory (iac_root_path) BEFORE invoking the subagent.
    • Strict Delegation: Do NOT parse or discover infrastructure details yourself. You MUST delegate all infrastructure discovery analysis to the infrastructure-discoverer subagent and wait for its JSON output.
  5. Manual Advisory Execution:

    • If the user preferred manual guidance or assisted setup is not supported, guide the user step-by-step through their migration milestones manually. Read documentation links extracted from the expert reference file and use your search tools to resolve any consultative planning questions.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.