|
| 1 | +--- |
| 2 | +title: Re-architect Projects by Using GitHub Copilot Modernization |
| 3 | +titleSuffix: Azure |
| 4 | +description: Learn how to use the re-architecture feature in GitHub Copilot modernization to rewrite projects from legacy frameworks to modern architectures. |
| 5 | +author: KarlErickson |
| 6 | +ms.author: karler |
| 7 | +ms.reviewer: xiading |
| 8 | +ms.topic: overview |
| 9 | +ms.date: 04/17/2026 |
| 10 | +ms.custom: devx-track-java |
| 11 | +ms.subservice: migration-copilot |
| 12 | +ms.collection: ce-skilling-ai-copilot |
| 13 | +ai-usage: ai-generated |
| 14 | +--- |
| 15 | + |
| 16 | +# Re-architect projects by using GitHub Copilot modernization |
| 17 | + |
| 18 | +This article describes how to use the re-architecture feature in GitHub Copilot modernization to rewrite projects from legacy frameworks to modern architectures, such as from Struts to Spring MVC. |
| 19 | + |
| 20 | +> [!IMPORTANT] |
| 21 | +> The re-architecture feature is currently in preview. Preview features might have limited capabilities and aren't recommended for production use. |
| 22 | +
|
| 23 | +## Overview |
| 24 | + |
| 25 | +The re-architecture feature enables you to transform an entire project from a legacy framework to a modern architecture by using an AI-powered multi-agent workflow. Instead of manual, file-by-file migration, you can describe the desired transformation in natural language, and the modernization agents handle analysis, planning, and code generation. |
| 26 | + |
| 27 | +Common re-architecture scenarios include: |
| 28 | + |
| 29 | +- Struts to Spring MVC |
| 30 | +- JSP to Thymeleaf |
| 31 | +- EJB to Spring Boot |
| 32 | +- Legacy servlet-based applications to modern Spring-based architectures |
| 33 | + |
| 34 | +## Prerequisites |
| 35 | + |
| 36 | +- Visual Studio Code with the [GitHub Copilot modernization](https://marketplace.visualstudio.com/items?itemName=vscjava.migrate-java-to-azure) extension installed. |
| 37 | +- A GitHub Copilot subscription. For more information, see [Copilot plans](https://github.com/features/copilot/plans?ref_product=copilot). |
| 38 | +- (Optional) [Python](https://www.python.org/downloads/) 3.7 or later for building a knowledge graph, which gives the agent a clearer understanding of your project structure during the rewriting process. If Python isn't available, the knowledge graph step is skipped. |
| 39 | +- (Optional) [Node.js](https://nodejs.org/) 18 or later for running Playwright tests as part of runtime validation. If Node.js isn't available, the Playwright test step is skipped. |
| 40 | +- (Optional) [Docker Desktop](https://www.docker.com/products/docker-desktop/) for runtime validation. If Docker isn't available, the runtime validation step is skipped. |
| 41 | + |
| 42 | +## Enable the re-architecture feature |
| 43 | + |
| 44 | +The re-architecture feature is in preview, so you need to activate it manually in Visual Studio Code. |
| 45 | + |
| 46 | +Use the following steps to enable the feature: |
| 47 | + |
| 48 | +1. In Visual Studio Code, open the **Settings** editor by selecting **File** > **Preferences** > **Settings** (or **Code** > **Preferences** > **Settings** on macOS). |
| 49 | + |
| 50 | +1. Search for `appmod.experimental.task.rearchitecture`. |
| 51 | + |
| 52 | +1. Select the checkbox to enable the re-architecture feature. |
| 53 | + |
| 54 | +Alternatively, add the following entry to your `settings.json` file: |
| 55 | + |
| 56 | +```json |
| 57 | +{ |
| 58 | + "appmod.experimental.task.rearchitecture": true |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +## Use the re-architecture agent |
| 63 | + |
| 64 | +After you enable the feature, use the re-architecture agent in the GitHub Copilot Chat panel. |
| 65 | + |
| 66 | +Use the following steps to re-architect a project: |
| 67 | + |
| 68 | +1. Open your project in Visual Studio Code. |
| 69 | + |
| 70 | +1. Open the **GitHub Copilot Chat** panel. |
| 71 | + |
| 72 | +1. Select the **modernize-rearchitecture** agent from the agent list. |
| 73 | + |
| 74 | +1. Describe the transformation you want to perform. For example: |
| 75 | + |
| 76 | + ```prompt |
| 77 | + Rewrite the entire project from Struts to Spring MVC |
| 78 | + ``` |
| 79 | + |
| 80 | +The agent coordinates a multi-agent team that performs the following steps: |
| 81 | + |
| 82 | +1. **Analysis** - Examines the existing codebase, identifying framework patterns, dependencies, and module boundaries. |
| 83 | +1. **Planning** - Generates a structured implementation plan with ordered tasks and requirement traceability. |
| 84 | +1. **Execution** - Applies code transformations following the plan, with validation checks at each step. |
| 85 | + |
| 86 | +### Provide more context |
| 87 | + |
| 88 | +You can improve the transformation results by providing additional context in your prompt: |
| 89 | + |
| 90 | +- Specify target framework versions, for example, "Use Spring Boot 3.2 and Java 21." |
| 91 | +- Reference documentation links or migration guides. |
| 92 | +- Describe organization-specific patterns or conventions. |
| 93 | +- Indicate which modules or packages to prioritize. |
| 94 | + |
| 95 | +For example: |
| 96 | + |
| 97 | +```prompt |
| 98 | +Rewrite the entire project from Struts to Spring MVC using Spring Boot 3.2. |
| 99 | +Refer to the Spring MVC migration guide at https://docs.spring.io/spring-framework/reference/web/webmvc.html. |
| 100 | +Keep the existing backend business logic unchanged. |
| 101 | +``` |
| 102 | + |
| 103 | +## Limitations |
| 104 | + |
| 105 | +Because this feature is in preview, the following limitations apply: |
| 106 | + |
| 107 | +- Complex projects with deeply coupled legacy frameworks might require multiple iterations. |
| 108 | +- You should review generated code carefully before committing changes. |
| 109 | + |
| 110 | +## Provide feedback |
| 111 | + |
| 112 | +If you have any feedback about the re-architecture feature, [create an issue at the github-copilot-appmod repository](https://github.com/microsoft/github-copilot-appmod/issues/new?template=feedback-template.yml) or use the [GitHub Copilot modernization feedback form](https://aka.ms/ghcp-appmod/feedback). |
0 commit comments