Files
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

1 line
8.2 KiB
JSON

{"content": "---\nallowed-tools: Read, Write, Edit, Bash\nargument-hint: [migration-type] | framework | database | cloud | architecture | --version-upgrade\ndescription: Create comprehensive migration guides with step-by-step procedures, validation, and rollback strategies\n---\n\n# Migration Guide Generator\n\nCreate comprehensive migration guide: $ARGUMENTS\n\n## Current System Analysis\n\n- Current versions: @package.json or @requirements.txt or detect from lock files\n- Migration history: !`find . -name \"*migration*\" -o -name \"*upgrade*\" | head -5`\n- Database schema: !`find . -name \"*schema*\" -o -name \"*.sql\" | head -3`\n- Dependencies: !`grep -c \"dependency\\|require\\|import\" package.json requirements.txt 2>/dev/null || echo \"0\"`\n- Infrastructure: @docker-compose.yml or @k8s/ or @terraform/ (if exists)\n\n## Task\n\nGenerate systematic migration guide with comprehensive safety measures: $ARGUMENTS\n\n1. **Migration Scope Analysis**\n - Identify what is being migrated (framework, library, architecture, etc.)\n - Determine source and target versions or technologies\n - Assess the scale and complexity of the migration\n - Identify affected systems and components\n\n2. **Impact Assessment**\n - Analyze breaking changes between versions\n - Identify deprecated features and APIs\n - Review new features and capabilities\n - Assess compatibility requirements and constraints\n - Evaluate performance and security implications\n\n3. **Prerequisites and Requirements**\n - Document system requirements for the target version\n - List required tools and dependencies\n - Specify minimum versions and compatibility requirements\n - Identify necessary skills and team preparation\n - Outline infrastructure and environment needs\n\n4. **Pre-Migration Preparation**\n - Create comprehensive backup strategies\n - Set up development and testing environments\n - Document current system state and configurations\n - Establish rollback procedures and contingency plans\n - Create migration timeline and milestones\n\n5. **Step-by-Step Migration Process**\n \n **Example for Framework Upgrade:**\n ```markdown\n ## Step 1: Environment Setup\n 1. Update development environment\n 2. Install new framework version\n 3. Update build tools and dependencies\n 4. Configure IDE and tooling\n \n ## Step 2: Dependencies Update\n 1. Update package.json/requirements.txt\n 2. Resolve dependency conflicts\n 3. Update related libraries\n 4. Test compatibility\n \n ## Step 3: Code Migration\n 1. Update import statements\n 2. Replace deprecated APIs\n 3. Update configuration files\n 4. Modify build scripts\n ```\n\n6. **Breaking Changes Documentation**\n - List all breaking changes with examples\n - Provide before/after code comparisons\n - Explain the rationale behind changes\n - Offer alternative approaches for removed features\n\n **Example Breaking Change:**\n ```markdown\n ### Removed: `oldMethod()`\n **Before:**\n ```javascript\n const result = library.oldMethod(param1, param2);\n ```\n \n **After:**\n ```javascript\n const result = library.newMethod({ \n param1: param1, \n param2: param2 \n });\n ```\n \n **Rationale:** Improved type safety and extensibility\n ```\n\n7. **Configuration Changes**\n - Document configuration file updates\n - Explain new configuration options\n - Provide configuration migration scripts\n - Show environment-specific configurations\n\n8. **Database Migration (if applicable)**\n - Create database schema migration scripts\n - Document data transformation requirements\n - Provide backup and restore procedures\n - Test migration with sample data\n - Plan for zero-downtime migrations\n\n9. **Testing Strategy**\n - Update existing tests for new APIs\n - Create migration-specific test cases\n - Implement integration and E2E tests\n - Set up performance and load testing\n - Document test scenarios and expected outcomes\n\n10. **Performance Considerations**\n - Document performance changes and optimizations\n - Provide benchmarking guidelines\n - Identify potential performance regressions\n - Suggest monitoring and alerting updates\n - Include memory and resource usage changes\n\n11. **Security Updates**\n - Document security improvements and changes\n - Update authentication and authorization code\n - Review and update security configurations\n - Update dependency security scanning\n - Document new security best practices\n\n12. **Deployment Strategy**\n - Plan phased rollout approach\n - Create deployment scripts and automation\n - Set up monitoring and health checks\n - Plan for blue-green or canary deployments\n - Document rollback procedures\n\n13. **Common Issues and Troubleshooting**\n \n ```markdown\n ## Common Migration Issues\n \n ### Issue: Import/Module Resolution Errors\n **Symptoms:** Cannot resolve module 'old-package'\n **Solution:** \n 1. Update import statements to new package names\n 2. Check package.json for correct dependencies\n 3. Clear node_modules and reinstall\n \n ### Issue: API Method Not Found\n **Symptoms:** TypeError: oldMethod is not a function\n **Solution:** Replace with new API as documented in step 3\n ```\n\n14. **Team Communication and Training**\n - Create team training materials\n - Schedule knowledge sharing sessions\n - Document new development workflows\n - Update coding standards and guidelines\n - Create quick reference guides\n\n15. **Tools and Automation**\n - Provide migration scripts and utilities\n - Create code transformation tools (codemods)\n - Set up automated compatibility checks\n - Implement CI/CD pipeline updates\n - Create validation and verification tools\n\n16. **Timeline and Milestones**\n \n ```markdown\n ## Migration Timeline\n \n ### Phase 1: Preparation (Week 1-2)\n - [ ] Environment setup\n - [ ] Team training\n - [ ] Development environment migration\n \n ### Phase 2: Development (Week 3-6)\n - [ ] Core application migration\n - [ ] Testing and validation\n - [ ] Performance optimization\n \n ### Phase 3: Deployment (Week 7-8)\n - [ ] Staging deployment\n - [ ] Production deployment\n - [ ] Monitoring and support\n ```\n\n17. **Risk Mitigation**\n - Identify potential migration risks\n - Create contingency plans for each risk\n - Document escalation procedures\n - Plan for extended timeline scenarios\n - Prepare communication for stakeholders\n\n18. **Post-Migration Tasks**\n - Clean up deprecated code and configurations\n - Update documentation and README files\n - Review and optimize new implementation\n - Conduct post-migration retrospective\n - Plan for future maintenance and updates\n\n19. **Validation and Testing**\n - Create comprehensive test plans\n - Document acceptance criteria\n - Set up automated regression testing\n - Plan user acceptance testing\n - Implement monitoring and alerting\n\n20. **Documentation Updates**\n - Update API documentation\n - Revise development guides\n - Update deployment documentation\n - Create troubleshooting guides\n - Update team onboarding materials\n\n**Migration Types and Specific Considerations:**\n\n**Framework Migration (React 17 → 18):**\n- Update React and ReactDOM imports\n- Replace deprecated lifecycle methods\n- Update testing library methods\n- Handle concurrent features and Suspense\n\n**Database Migration (MySQL → PostgreSQL):**\n- Convert SQL syntax differences\n- Update data types and constraints\n- Migrate stored procedures to functions\n- Update ORM configurations\n\n**Cloud Migration (On-premise → AWS):**\n- Containerize applications\n- Update CI/CD pipelines\n- Configure cloud services\n- Implement infrastructure as code\n\n**Architecture Migration (Monolith → Microservices):**\n- Identify service boundaries\n- Implement inter-service communication\n- Set up service discovery\n- Plan data consistency strategies\n\nRemember to:\n- Test thoroughly in non-production environments first\n- Communicate progress and issues regularly\n- Document lessons learned for future migrations\n- Keep the migration guide updated based on real experiences"}