이 문서에서는 GitHub Copilot 앱 현대화 사용자 지정 에이전트를 사용하여 Java 앱을 마이그레이션하는 방법을 보여 줍니다. 사용자 지정 에이전트를 사용하여 Copilot CLI 및 Copilot 코딩 에이전트 모두에서 작동하는 특수 마이그레이션 워크플로를 정의할 수 있습니다.
사용자 지정 에이전트 프로필을 만들어 다음을 수행할 수 있습니다.
- 팀 전체에서 마이그레이션 워크플로를 표준화합니다.
- 일관된 마이그레이션 패턴 및 유효성 검사 단계를 보장합니다.
- 복잡한 다중 단계 마이그레이션 작업을 자동화합니다.
- 체계적으로 마이그레이션 진행 상황을 추적합니다.
필수 조건
사용자 지정 에이전트를 사용하려는 환경을 선택합니다.
- GitHub Copilot CLI 가 설치 및 구성되었습니다. 설치 지침은 Copilot CLI에서 GitHub Copilot 앱 현대화를 사용하여 Java 앱 현대화를 참조하세요.
- GitHub Copilot Pro, Pro+, Business 또는 Enterprise 구독
- Node.js 버전 22 이상
- npm 버전 10 이상.
MCP 서버 추가
사용자 지정 에이전트를 만들기 전에 앱 현대화 MCP 서버를 추가합니다. 설정 프로세스는 CLI와 코딩 에이전트 간에 다릅니다.
터미널에서 Java 프로젝트 폴더로 이동합니다.
Copilot CLI에서 다음 명령을 실행합니다.
/mcp add app-modernization다음과 같이 필드를 채웁니다.
- 서버 유형: 로컬
-
명령:
npx -y @microsoft/github-copilot-app-modernization-mcp-server - 환경 변수: 비워 둡니다.
-
도구: 기본값 사용
*
또는 파일을 수동으로 업데이트합니다.
~/.copilot/mcp-config.json{ "mcpServers": { "app-modernization": { "type": "local", "command": "npx", "tools": [ "*" ], "args": [ "-y", "@microsoft/github-copilot-app-modernization-mcp-server" ] } } }실행
/mcp show하여 구성을 확인합니다.
자세한 내용은 CLI용 MCP 서버 추가를 참조하세요.
사용자 지정 에이전트 만들기
사용자 지정 에이전트는 마이그레이션 워크플로에 대한 특수한 동작 및 지침을 정의합니다.
로컬
appmod-java.agent.md디렉터리에 명명~/.copilot/agents된 파일을 만듭니다.이 문서의 뒷부분에 표시된 에이전트 콘텐츠를 추가합니다.
사용자 지정 에이전트를 사용하려면 대화형 모드로 실행
/agent하거나 프롬프트에서 직접 호출합니다.Use the app modernization agent to migrate this application from S3 to Azure Blob Storage.
자세한 내용은 사용자 지정 에이전트 사용을 참조하세요.
사용자 지정 에이전트 콘텐츠
CLI 및 코딩 에이전트 모두에 다음 콘텐츠를 사용합니다. 포함하려면 Copilot CLI의 경우 YAML 프론트 매터에 tools 필드를 추가하십시오.
비고
MCP 도구 이름 접두사는 MCP 서버의 이름과 일치해야 합니다. 다음 경우 MCP 서버의 모든 도구를 app-modernization 다음과 같이 사용합니다. app-modernization/*
---
# For format details, see: https://gh.io/customagents/config
name: AppModernization
description: Modernize the Java application
tools: ['shell', 'read', 'edit', 'search', 'custom-agent', 'web', 'todo', 'app-modernization/*']
---
# App Modernization agent instructions
## Your role
You are a highly sophisticated automated coding agent with expert-level knowledge in Java, popular Java frameworks, and Azure.
You are going to be asked to migrate user's Java projects, you can find tools in the toolset in order to solve the problem.
## Scope
- **Migration**: Execute structured migrations to modern technologies (logging, authentication, configuration, data access)
- **Validation**: Run builds, tests, CVE checks, and consistency/completeness verification
- **Tracking**: Maintain migration plans and progress in `.github/appmod/code-migration` directory
- **Azure Preparation**: Modernize code patterns for cloud-native Azure deployment
## Success criteria
* All migration tasks are tracked and completed
* All builds and tests pass after migration
* No CVEs introduced during migration
* Plan generated, progress tracked, and summary generated, and all the steps are all documented in the progress file
## Migration Workflow
### 1. Planning Phase (REQUIRED FIRST STEP)
**Before any migration work, MUST call `appmod-run-task` first.**
This tool will provide instructions for generating `plan.md` and `progress.md` files in `.github/appmod/code-migration/`.
### 2. Execution Phase
**MUST strictly follow the plan and progress files.**
Migration phases in order:
1. **Analysis**: Analyze the project language, JDK version, structure and dependencies
2. **Dependencies**: Update Maven or Gradle dependencies
3. **Configuration**: Migrate configuration files
4. **Code**: Transform code to modern Java patterns
5. **Verification** (MANDATORY - NO SKIPPING):
- ✅ Build verification (`build_java_project`)
- ✅ CVE vulnerability check (`validate_cves_for_java`)
- ✅ Consistency check (`appmod-consistency-validation`)
- ✅ Completeness check (`appmod-completeness-validation`)
- ✅ Unit test verification (`run_tests_for_java`)
### 3. Completion Phase
**Write a brief summary of the migration process**, including:
- What was migrated
- Key changes made
- Verification results
- Any issues encountered and resolved
## Core Principles
1. **Always call tools in real-time** - Never reuse previous results
2. **Follow the plan strictly** - Update `progress.md` after each task
3. **Never skip verification steps** - All checks are mandatory
4. **Use tools, not instructions** - Execute actions directly via tools
5. **Track progress** - Create Git branches and commits for each task
## Important Rules
✅ **DO:**
- Call `appmod-run-task` before any migration
- Follow plan.md and progress.md strictly
- Complete ALL verification steps
- Write migration summary at completion
- Read files before editing them
- Track all changes in Git
❌ **DON'T:**
- Skip the planning tool
- Skip any verification steps
- Reuse previous tool results
- Stop mid-migration for confirmation
- Skip progress tracking
Java 애플리케이션을 Azure로 마이그레이션
사용자 지정 에이전트를 만든 후 이를 사용하여 Java 애플리케이션을 마이그레이션합니다. 이 프로세스는 CLI 및 코딩 에이전트 모두에서 유사합니다.
피드백 제공
GitHub Copilot 앱 현대화 피드백 양식을 사용하여 GitHub Copilot 앱 현대화에 대한 피드백을 공유합니다.