Skip to content
Development
Command

/migrate

Ultra-fast parallel migration planning using 10 sub-agents for comprehensive impact analysis

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/migrate

Context preview

What this command does when you run it.

Ultra-fast parallel migration planning using 10 sub-agents for comprehensive impact analysis

Command definition

migrate.md
allowed-tools: Read, Write, Task, Bash(gdate:*), Bash(date:*), Bash(pwd:*), Bash(fd:*), Bash(rg:*), Bash(git:*)
name: "Migrate"
description: "Ultra-fast parallel migration planning using 10 sub-agents for comprehensive impact analysis"
author: "wcygan"
tags: ["code","migrate"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N 2>/dev/null || date +%s%N`
  • Current directory: !`pwd`
  • Project files: !`fd "(go\.mod|Cargo\.toml|pom\.xml|package\.json|deno\.json)" --max-depth 2 | head -5 || echo "No project files found"`
  • Migration directories: !`fd "migrations?" --type d | head -5 || echo "No migration directories found"`
  • Database configs: !`fd "\.(env|properties|yaml|yml)$" --max-depth 2 | head -3 || echo "No config files found"`
  • Git status: !`git status --porcelain | head -10 || echo "Not a git repository"`
  • Migration target: $ARGUMENTS

Your task

**IMMEDIATELY DEPLOY 10 PARALLEL SUB-AGENTS** for instant comprehensive migration planning

STEP 1: Initialize Migration Planning Session

  • Create session state file: `/tmp/migration-strategy-$SESSION_ID.json`
  • Initialize results directory: `/tmp/migration-results-$SESSION_ID/`

STEP 2: **LAUNCH ALL 10 AGENTS SIMULTANEOUSLY**

**NO SEQUENTIAL ANALYSIS** - All agents work in parallel:

1. **Impact Analysis Agent**: Assess breaking changes and affected systems 2. **Risk Assessment Agent**: Identify risks and mitigation strategies 3. **Database Migration Agent**: Analyze schema changes and data migration 4. **API Migration Agent**: Map endpoint changes and client impacts 5. **Dependency Agent**: Analyze package updates and compatibility 6. **Testing Strategy Agent**: Create comprehensive test plans 7. **Rollback Planning Agent**: Design rollback procedures and checkpoints 8. **Performance Impact Agent**: Analyze migration performance implications 9. **Security Review Agent**: Assess security implications of changes 10. **Documentation Agent**: Generate migration guides and runbooks

Each agent saves analysis to: `/tmp/migration-results-$SESSION_ID/agent-N.json`

Think deeply about migration complexity while maximizing parallel execution.

**Expected speedup: 10x faster migration planning and risk assessment**

IF $ARGUMENTS contains "database":

  • Use **Database Migration Agent** for schema analysis
  • Detect migration tools (Flyway, Liquibase, golang-migrate, Prisma)
  • Analyze current schema and identify breaking changes

ELSE IF $ARGUMENTS contains "api" OR "version":

  • Use **API Migration Agent** for endpoint analysis
  • Map deprecated endpoints and compatibility requirements
  • Analyze client SDK dependencies and breaking changes

ELSE IF $ARGUMENTS contains "dependency" OR "update":

  • Use **Dependency Migration Agent** for package analysis
  • Detect dependency managers and version constraints
  • Analyze breaking changes and compatibility matrix

ELSE IF $ARGUMENTS contains "kubernetes" OR "k8s":

  • Use **Infrastructure Migration Agent** for resource analysis
  • Detect API version changes and deprecated resources
  • Analyze Helm charts and custom controller dependencies

ELSE:

  • Use **General Migration Agent** for pattern analysis
  • Detect code patterns requiring migration
  • Analyze refactoring scope and impact

STEP 2: Migration Risk Assessment and Planning

Think deeply about migration complexity, potential risks, and optimal execution strategies.

FOR EACH identified migration component:

  • Assess breaking change impact (high/medium/low)
  • Evaluate rollback complexity and requirements
  • Determine data loss or downtime risks
  • Plan testing and validation strategies

**Risk Analysis Framework:**

IF migration_impact == "high":

  • Create detailed rollback procedures
  • Plan staged migration with checkpoints
  • Implement comprehensive testing strategy
  • Schedule maintenance windows and notifications

ELSE IF migration_impact == "medium":

  • Create automated rollback scripts
  • Plan feature flag rollouts if applicable
  • Implement integration testing
  • Schedule during low-traffic periods

ELSE:

  • Plan simple rollback procedures
  • Implement automated testing
  • Execute during normal operations

STEP 3: Migration Implementation Strategy

TRY:

  • Create session state file: /tmp/migration-strategy-$SESSION_ID.json
  • Generate migration scripts and automation
  • Create validation and testing procedures
  • Implement monitoring and rollback systems

**Database Migration Implementation:**

CASE database_type: WHEN "postgresql" OR "mysql":

  • Generate SQL migration files with up/down scripts
  • Create data validation queries
  • Plan index creation strategy (online vs offline)
  • Configure connection pooling during migration

WHEN "mongodb":

  • Create document transformation scripts
  • Plan collection reorganization strategy
  • Implement data validation procedures
  • Configure replica set migration approach

DEFAULT:

  • Create generic migration procedures
  • Document manual migration steps
  • Plan data backup and validation

**Code Migration Implementation:**

FOR EACH code pattern requiring migration:

  • Create automated refactoring scripts using modern tools (rg, fd)
  • Generate before/after code examples
  • Plan batch processing with validation checkpoints
  • Implement automated testing for each refactored component

**Dependency Migration Implementation:**

CASE package_manager: WHEN "go":

  • Update go.mod with version constraints
  • Plan module proxy considerations
  • Generate compatibility testing suite
  • Create vendor directory migration if needed

WHEN "rust":

  • Update Cargo.toml with semantic versions
  • Plan feature flag migration
  • Generate cargo audit security checks
  • Create lock file migration strategy

WHEN "java":

  • Update Maven/Gradle dependencies
  • Plan classpath conflict resolution
  • Generate integration test suite
  • Create security vulnerability assessment

WHEN "node":

  • Update package.json with exact versions
  • Plan npm audit vulnerability fixes
  • Generate lockf
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin