framework-migration-code-migrate
You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migration plans, automated migration scripts, and
About this skill
This skill empowers an AI agent to act as a highly specialized code migration expert. It focuses on facilitating smooth and efficient transitions of codebases by generating comprehensive migration plans, automated migration scripts, and providing best practices. The agent is proficient in handling migrations between different programming frameworks, languages, software versions, and deployment platforms, ensuring minimal disruption and adherence to modern development standards.
Best use case
Assisting developers and teams with complex code migration projects, providing expert guidance, automated tools, and detailed planning for transitioning software between diverse technical environments.
You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migration plans, automated migration scripts, and
A detailed, actionable migration plan, including steps, considerations, and potential challenges; Automated scripts or code snippets to facilitate parts of the migration process; Expert advice, best practices, and checklists to ensure a successful and efficient code transition.
Practical example
Example input
Migrate a Python 2.7 Flask application to Python 3.9 FastAPI. Outline the key steps, dependencies, and potential breaking changes. Generate a script to update common Flask imports to FastAPI equivalents.
Example output
**Migration Plan: Flask 2.7 to FastAPI 3.9**
**Phase 1: Analysis & Preparation**
1. **Dependency Audit**: List all `requirements.txt` dependencies. Check Python 3.9 and FastAPI compatibility.
2. **Codebase Scan**: Identify Python 2.7 specific syntax (e.g., `print` statements, `long` integers, `basestring`).
3. **Authentication/Authorization**: Review current Flask-Login/Flask-Security implementations for FastAPI alternatives (e.g., FastAPI's security utilities, OAuth2).
4. **Database ORM**: If using SQLAlchemy, ensure it's compatible with Python 3.9 and review how connections are managed in an ASGI context.
5. **Testing Suite**: Identify existing unit/integration tests. Plan for updating them for FastAPI.
**Phase 2: Core Migration**
1. **Python 2.7 to 3.9 Refactoring**:
* Automate `2to3` tool for initial conversion.
* Manual review for encoding issues, dictionary iteration, exceptions, etc.
2. **Framework Transition (Flask to FastAPI)**:
* **Routing**: Map Flask `@app.route` decorators to FastAPI `@app.get`, `@app.post`, etc.
* **Request/Response Handling**: Convert `request` object access (Flask `request.args`, `request.json`) to FastAPI dependency injection (`Request`, Pydantic models).
* **Middleware**: Port custom Flask middleware to FastAPI `MiddlewareStack` or dependencies.
* **Templating**: If Jinja2 is used, it's generally compatible, but adjust setup.
* **Configuration**: Adapt Flask `app.config` to FastAPI's Pydantic `BaseSettings` or environment variables.
3. **Asynchronous Nature**: Identify synchronous Flask functions and evaluate for asynchronous implementation where performance benefits are significant (e.g., I/O operations, database calls).
4. **Error Handling**: Convert Flask error handlers to FastAPI's `ExceptionHandler`.
**Phase 3: Testing & Deployment**
1. **Unit & Integration Tests**: Update/create tests using `pytest` and `httpx` (for FastAPI).
2. **Performance Testing**: Benchmark FastAPI application against Flask version.
3. **Deployment**: Update Dockerfiles, CI/CD pipelines for ASGI server (Uvicorn/Gunicorn).
**Potential Breaking Changes:**
* Synchronous I/O operations in an async context can block the event loop.
* Changes in URL routing behavior (e.g., trailing slashes).
* Different error handling mechanisms.
**Automated Script (Partial Example for Imports):**
```python
# migration_script.py
import os
import re
def migrate_flask_imports(filepath):
with open(filepath, 'r') as f:
content = f.read()
# Example: Migrate common Flask import patterns
content = re.sub(r'from flask import Flask, request, jsonify',
r'from fastapi import FastAPI, Request, HTTPException\nfrom pydantic import BaseModel',
content)
content = re.sub(r'from flask_restful import Api, Resource',
r'from fastapi import APIRouter',
content)
# More complex replacements would involve Abstract Syntax Tree (AST) parsing
with open(filepath, 'w') as f:
f.write(content)
# Example usage (would iterate through project files)
# migrate_flask_imports('app/main.py')
```When to use this skill
- When working on code migration assistant tasks or workflows
- When needing guidance, best practices, or checklists for code migration
- When planning or executing transitions between different frameworks, languages, versions, or platforms
When not to use this skill
- When the task is not directly related to code migration or requires manual intervention beyond the agent's generative and analytical capabilities
- When looking for general code generation, debugging, or code review unrelated to a migration context
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/framework-migration-code-migrate/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How framework-migration-code-migrate Compares
| Feature / Agent | framework-migration-code-migrate | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | easy | N/A |
Frequently Asked Questions
What does this skill do?
You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migration plans, automated migration scripts, and
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as easy. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Code Migration Assistant You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migration plans, automated migration scripts, and ensure smooth transitions with minimal disruption. ## Use this skill when - Working on code migration assistant tasks or workflows - Needing guidance, best practices, or checklists for code migration assistant ## Do not use this skill when - The task is unrelated to code migration assistant - You need a different domain or tool outside this scope ## Context The user needs to migrate code from one technology stack to another, upgrade to newer versions, or transition between platforms. Focus on maintaining functionality, minimizing risk, and providing clear migration paths with rollback strategies. ## Requirements $ARGUMENTS ## Instructions - Clarify goals, constraints, and required inputs. - Apply relevant best practices and validate outcomes. - Provide actionable steps and verification. - If detailed examples are required, open `resources/implementation-playbook.md`. ## Output Format 1. **Migration Analysis**: Comprehensive analysis of source codebase 2. **Risk Assessment**: Identified risks with mitigation strategies 3. **Migration Plan**: Phased approach with timeline and milestones 4. **Code Examples**: Automated migration scripts and transformations 5. **Testing Strategy**: Comparison tests and validation approach 6. **Rollback Plan**: Detailed procedures for safe rollback 7. **Progress Tracking**: Real-time migration monitoring 8. **Documentation**: Migration guide and runbooks Focus on minimizing disruption, maintaining functionality, and providing clear paths for successful code migration with comprehensive testing and rollback strategies. ## Resources - `resources/implementation-playbook.md` for detailed patterns and examples.
Related Skills
metasploit-framework
⚠️ AUTHORIZED USE ONLY > This skill is for educational purposes or authorized security assessments only. > You must have explicit, written permission from the system owner before using this tool. > Misuse of this tool is illegal and strictly prohibited.
framework-migration-deps-upgrade
You are a dependency management expert specializing in safe, incremental upgrades of project dependencies. Plan and execute dependency updates with minimal risk, proper testing, and clear migration pa
database-migrations-sql-migrations
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, and SQL Server. Focus on data integrity and rollback plans.
database-migrations-migration-observability
Migration monitoring, CDC, and observability infrastructure
database-migration
Master database schema and data migrations across ORMs (Sequelize, TypeORM, Prisma), including rollback strategies and zero-downtime deployments.
data-quality-frameworks
Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts.
backtesting-frameworks
Build robust, production-grade backtesting systems that avoid common pitfalls and produce reliable strategy performance estimates.
nft-standards
Master ERC-721 and ERC-1155 NFT standards, metadata best practices, and advanced NFT features.
nextjs-app-router-patterns
Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.
new-rails-project
Create a new Rails project
networkx
NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs.
network-engineer
Expert network engineer specializing in modern cloud networking, security architectures, and performance optimization.