migration-architect – skill DevOps & Hạ tầng cho agent AI
Lập kế hoạch di chuyển không gián đoạn, kiểm tra tương thích và tạo chiến lược rollback. Công cụ cho di chuyển hệ thống, cơ sở dữ liệu và hạ tầng với tác động tối thiểu đến kinh doanh. Dùng khi lập kế hoạch di chuyển cơ sở dữ liệu, chuyển đổi hạ tầng, thay thế hệ thống hoặc mọi chuyển đổi rủi ro cao cần có rollback rõ ràng.
Cài skill migration-architect bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/migration-architect-7bfc9.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /migration-architect – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/migration-architect-7bfc9.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $migration-architect – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/migration-architect-7bfc9.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /migration-architect – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/migration-architect-7bfc9.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /migration-architect – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Migration Architect
Tier: POWERFUL
Category: Engineering - Migration Strategy
Purpose: Zero-downtime migration planning, compatibility validation, and rollback strategy generation
Overview
The Migration Architect skill provides comprehensive tools and methodologies for planning, executing, and validating complex system migrations with minimal business impact. This skill combines proven migration patterns with automated planning tools to ensure successful transitions between systems, databases, and infrastructure.
Core Capabilities
1. Migration Strategy Planning
- Phased Migration Planning: Break complex migrations into manageable phases with clear validation gates
- Risk Assessment: Identify potential failure points and mitigation strategies before execution
- Timeline Estimation: Generate realistic timelines based on migration complexity and resource constraints
- Stakeholder Communication: Create communication templates and progress dashboards
2. Compatibility Analysis
- Schema Evolution: Analyze database schema changes for backward compatibility issues
- API Versioning: Detect breaking changes in REST/GraphQL APIs and microservice interfaces
- Data Type Validation: Identify data format mismatches and conversion requirements
- Constraint Analysis: Validate referential integrity and business rule changes
3. Rollback Strategy Generation
- Automated Rollback Plans: Generate comprehensive rollback procedures for each migration phase
- Data Recovery Scripts: Create point-in-time data restoration procedures
- Service Rollback: Plan service version rollbacks with traffic management
- Validation Checkpoints: Define success criteria and rollback triggers
Quick Start — plan → check compatibility → generate rollback
All paths relative to this skill folder; sample inputs in assets/, expected shapes in expected_outputs/.
# 1. Generate the migration plan from a spec (copy assets/sample_database_migration.json)
python3 scripts/migration_planner.py --input migration_spec.json --format json -o migration_plan.json
# 2. Check schema/API compatibility — exits non-zero unless fully compatible (CI gate)
python3 scripts/compatibility_checker.py --before assets/database_schema_before.json --after assets/database_schema_after.json --type database --format json -o compatibility.json
# 3. Generate the rollback runbook from the plan
python3 scripts/rollback_generator.py --input migration_plan.json --format both -o rollback_runbookOutputs chain: migration_plan.json (phases, risks, estimated_duration_hours) feeds step 3; compatibility.json reports overall_compatibility plus breaking_changes_count / potentially_breaking_count.
Gate: the migration is not approved until (a) compatibility_checker exits 0 (overall_compatibility: compatible) or every breaking/potentially-breaking item is explicitly accepted by the owner in writing, and (b) a rollback runbook exists for every phase in the plan. Re-run both checks after any schema revision.
Migration Patterns
Database Migrations
Schema Evolution Patterns
1. Expand-Contract Pattern
- Expand: Add new columns/tables alongside existing schema
- Dual Write: Application writes to both old and new schema
- Migration: Backfill historical data to new schema
- Contract: Remove old columns/tables after validation
2. Parallel Schema Pattern
- Run new schema in parallel with existing schema
- Use feature flags to route traffic between schemas
- Validate data consistency between parallel systems
- Cutover when confidence is high
3. Event Sourcing Migration
- Capture all changes as events during migration window
- Apply events to new schema for consistency
- Enable replay capability for rollback scenarios
Data Migration Strategies
1. Bulk Data Migration
- Snapshot Approach: Full data copy during maintenance window
- Incremental Sync: Continuous data synchronization with change tracking
- Stream Processing: Real-time data transformation pipelines
2. Dual-Write Pattern
- Write to both source and target systems during migration
- Implement compensation patterns for write failures
- Use distributed transactions where consistency is critical
3. Change Data Capture (CDC)
- Stream database changes to target system
- Maintain eventual consistency during migration
- Enable zero-downtime migrations for large datasets
Service Migrations
Strangler Fig Pattern
1. Intercept Requests: Route traffic through proxy/gateway
2. Gradually Replace: Implement new service functionality incrementally
3. Legacy Retirement: Remove old service components as new ones prove stable
4. Monitoring: Track performance and error rates throughout transition
graph TD
A[Client Requests] --> B[API Gateway]
B --> C{Route Decision}
C -->|Legacy Path| D[Legacy Service]
C -->|New Path| E[New Service]
D --> F[Legacy Database]
E --> G[New Database]Parallel Run Pattern
1. Dual Execution: Run both old and new services simultaneously
2. Shadow Traffic: Route production traffic to both systems
3. Result Comparison: Compare outputs to validate correctness
4. Gradual Cutover: Shift traffic percentage based on confidence
Canary Deployment Pattern
1. Limited Rollout: Deploy new service to small percentage of users
2. Monitoring: Track key metrics (latency, errors, business KPIs)
3. Gradual Increase: Increase traffic percentage as confidence grows
4. Full Rollout: Complete migration once validation passes
Infrastructure Migrations
Cloud-to-Cloud Migration
1. Assessment Phase
- Inventory existing resources and dependencies
- Map services to target cloud equivalents
- Identify vendor-specific features requiring refactoring
2. Pilot Migration
- Migrate non-critical workloads first
- Validate performance and cost models
- Refine migration procedures
3. Production Migration
- Use infrastructure as code for consistency
- Implement cross-cloud networking during transition
- Maintain disaster recovery capabilities
On-Premises to Cloud Migration
1. Lift and Shift
- Minimal changes to existing applications
- Quick migration with optimization later
- Use cloud migration tools and services
2. Re-architecture
- Redesign applications for cloud-native patterns
- Adopt microservices, containers, and serverless
- Implement cloud security and scaling practices
3. Hybrid Approach
- Keep sensitive data on-premises
- Migrate compute workloads to cloud
- Implement secure connectivity between environments
Feature Flags for Migrations
Progressive Feature Rollout
# Example feature flag implementation
class MigrationFeatureFlag:
def __init__(self, flag_name, rollout_percentage=0):
self.flag_name = flag_name
self.rollout_percentage = rollout_percentage
def is_enabled_for_user(self, user_id):
hash_value = hash(f"{self.flag_name}:{user_id}")
return (hash_value % 100) < self.rollout_percentage
def gradual_rollout(self, target_percentage, step_size=10):
while self.rollout_percentage < target_percentage:
self.rollout_percentage = min(
self.rollout_percentage + step_size,
target_percentage
)
yield self.rollout_percentageCircuit Breaker Pattern
Implement automatic fallback to legacy systems when new systems show degraded performance:
class MigrationCircuitBreaker:
def __init__(self, failure_threshold=5, timeout=60):
self.failure_count = 0
self.failure_threshold = failure_threshold
self.timeout = timeout
self.last_failure_time = None
self.state = 'CLOSED' # CLOSED, OPEN, HALF_OPEN
def call_new_service(self, request):
if self.state == 'OPEN':
if self.should_attempt_reset():
self.state = 'HALF_OPEN'
else:
return self.fallback_to_legacy(request)
try:
response = self.new_service.process(request)
self.on_success()
return response
except Exception as e:
self.on_failure()
return self.fallback_to_legacy(request)Data Validation and Reconciliation
Validation Strategies
1. Row Count Validation
- Compare record counts between source and target
- Account for soft deletes and filtered records
- Implement threshold-based alerting
2. Checksums and Hashing
- Generate checksums for critical data subsets
- Compare hash values to detect data drift
- Use sampling for large datasets
3. Business Logic Validation
- Run critical business queries o
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- setup-wizard-generator – Tạo wizard bash hướng dẫn người dùng thực hiện thiết lập thủ công.
- dep – Xử lý containerization, pipeline CI/CD và thiết lập triển khai.
- deploy-to-vercel – Triển khai ứng dụng và website lên Vercel. Dùng khi người dùng yêu cầu các hành động…
- deployment-engineer – Kỹ sư triển khai chuyên nghiệp, chuyên về pipeline CI/CD hiện đại, quy trình GitOps và…
- deployment-pipeline-design – Các mô hình kiến trúc cho pipeline CI/CD nhiều giai đoạn với cổng phê duyệt và chiến…
- deployment-procedures – Nguyên tắc và cách ra quyết định khi triển khai production. Quy trình triển khai an…
- deployment-validation-config-validate – Kiểm tra cấu hình ứng dụng bằng schema, bài kiểm thử cấu hình, và kiểm tra bảo mật cũng…
- simpy – Xây dựng, kiểm tra và phân tích các mô phỏng sự kiện rời rạc có giới hạn, dựa trên tiến…