본문으로 건너뛰기
Skillpedia
모바일 앱10k · #11922

migrate-xml-views-to-jetpack-compose

하는 일

이 스킬은 Android 앱의 기존 XML 레이아웃 하나를 Jetpack Compose로 바꾸는 방법을 안내합니다. 겉모습은 그대로 유지하고, 기존 XML을 제거하기 전에 결과를 확인합니다. 오래된 화면을 현대화하려는 Android 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓XML 뷰로 만든 오래된 Android 화면을 Jetpack Compose로 옮기고 싶을 때.
  • ✓먼저 옮기기 가장 좋은 XML 레이아웃을 고르고 싶을 때.
  • ✓새 Compose 화면이 예전 화면과 같은지 계획과 시각적 확인이 필요할 때.

스킬 링크

https://github.com/android/skills/blob/main/jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/android/skills/blob/main/jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“설정 화면을 XML 뷰에서 Jetpack Compose로 옮기되, 모양은 그대로 유지해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 레이아웃 선택과 분석부터 Compose 설정과 테마 적용까지 열 단계 과정을 거칩니다. 기존 화면을 캡처하고, Compose 버전을 만들고, 시각적으로 확인한 뒤 이전 사용처를 바꾸고 XML을 제거합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

This skill guides through the process of migrating an existing Android XML View to Jetpack Compose. It performs a stable, safe and visually consistent transition by following a structured, 10-step methodology. This skill migrates UI (XML to Jetpack Compose) only.

Objective

To systematically convert a single legacy XML layout into modern, declarative Jetpack Compose UI while maintaining pixel-perfect visual parity and functional integrity.

Summary of the 10-step migration process

  1. Identify the optimal XML candidate for migration
  2. Analyze the project and layout
  3. Create a plan
  4. Capture the XML View UI
  5. Set up Compose dependencies and compiler
  6. Set up Compose theming
  7. Migrate the XML layout to Compose
  8. Validate the migration
  9. Replace usages
  10. XML code removal

Detailed steps

Step 1: Identify the optimal XML candidate for migration

If the user has explicitly specified a target XML layout, proceed to Step 2. Otherwise, analyze the codebase to identify the best candidate for migration by following the logic in references/identify-optimal-xml-candidate.md.

Step 2: Analyze the project and layout

Analyze the identified XML View's structure, hierarchy, and implementation details. Use references/analysis-of-the-project-and-layout.md to guide your technical audit of the layout and surrounding project context.

Step 3: Create a plan

Using the outputs and analysis done in the Step 1 and 2, generate a step-by-step plan for the migration. If you support user interaction, present to the user and ask for approval before proceeding. If user interaction is not supported, proceed to Step 4 following the generated plan.

Step 4: Capture the XML View UI

IF you support user interaction, ask the user to upload a screenshot of the XML View UI or provide an absolute path to a file. Use this image as a visual reference for the layout migration in Step 7. ELSE IF you are able to run an Android emulator, locate an existing screenshot test for the XML candidate. If none exists, create one using the existing project testing framework. If no framework exists, use UI Automator or Espresso to create a screenshot test with minimum required setup. Run the test and take a baseline screenshot of the XML UI. ELSE proceed to Step 5.

Step 5: Set up Compose dependencies and compiler

Check build.gradle or libs.versions.toml for Compose dependencies and compiler setup. If missing, use Setup Compose Dependencies and Compiler. Run a sync to ensure dependencies resolve without errors.

Step 6: Set up Compose theming

If the project already has Compose theming set up, proceed to Step 7. If Compose theming is missing, initialize it. For Material-based projects, follow Material 3 migration guidelines. For custom design systems, apply expert judgment to migrate XML theming and match existing styles. Constraints: Do not migrate the entire theme. Implement only the minimum theming required for the specific XML candidate. Maintain original XML themes for interoperability. Maintain existing project code conventions, patterns, names and values.

Step 7: Migrate the XML View to Compose

Convert the XML candidate to Jetpack Compose code, referencing references/xml-layout-migration.md and the image from Step 4. You must include a Compose Preview for the newly created composable to facilitate visual verification.

Step 8: Replace usages

Replace the usages of the migrated XML layout to use the new Compose component.

Step 9: Validate the migration

Compare the baseline screenshot image from Step 4 with the rendered Compose Preview of the new composable. Ignore string content; focus on layout and styling. Iterate on the Compose code until visual parity is achieved. Once verified, write a Compose UI test for the new composable.

Step 10: XML code remo

자주 묻는 질문

앱 전체를 한 번에 옮기나요?

아니요. 한 번에 XML 레이아웃 하나씩 옮기며, 레이아웃을 직접 고르거나 스킬이 고르게 할 수 있습니다.

결과는 어떻게 확인하나요?

기존 화면을 캡처하고 새 Compose 화면과 비교해 시각적으로 같은지 확인합니다.

앱의 로직도 바뀌나요?

아니요. 이 스킬은 사용자 인터페이스만 옮깁니다.

상세 정보

작성자의 원본 설명

Provides a structured workflow for migrating an Android XML View to Jetpack Compose. This skill details the step-by-step process, from planning and dependency setup, to theming and layout migration, validation and XML cleanup. Use this skill when you need to migrate an XML View to Jetpack Compose in an Android project. It solves the problem of converting the UI of a legacy XML View into modern, declarative Compose components while maintaining interoperability.

repo: android/skills

인기도

GitHub 스타
10k
순위
#11922
라이선스
Apache-2.0
업데이트
2026. 10. 29.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬