用途:将 Android 项目系统化迁移到 HarmonyOS,通过 7 个专业 agent 协作完成,采用迭代式流程。
主要能力与流程:
- Analyzer Agent 扫描 Android 源码,运行 python scripts/analyze.py <source-path>,输出文件统计、组件类型分布、依赖关系图与复杂度评分。
- Planner Agent 制定模块化迁移计划,原则为每模块约 5000 行、顺序为数据层→业务逻辑→UI 层、优先低风险高复用模块,并维护 migration_state 与 migration_status.yaml。
- 模块迁移循环:Translator Agent 执行转换(python scripts/migrate.py <source-file> <target-file> --mode <component-type>),映射如 Activity→@Entry @Component Page、Fragment→@Component、RecyclerView→LazyForEach、Room→RelationalDB、ViewModel→@Observed + @ObjectLink;Validator Agent 检查 ArkTS 语法、API 版本 <= 22、编译与类型安全,推荐使用 ohos-app-build-debug skill 的 build.py、install.py、launch.py、screenshot.py,备选 hvigorw assembleApp、hdc install、hdc shell aa start;Tester Agent 做功能验证。
- 全局比对阶段(所有模块完成后):Feature Comparator Agent 运行 python scripts/compare_features.py <android-source> <harmonyos-target> 比对功能清单、API 覆盖、业务逻辑与资源;UI Comparator Agent 用 Hypium 自动化或手动截图比对,命令如 python scripts/compare_ui_auto.py --android <android-package> --harmonyos <harmonyos-package>、python scripts/compare_ui.py <android-screenshots-dir> <harmonyos-screenshots-dir>。
- 迭代:遗漏项反馈给 Planner Agent 制定补充计划,回到模块循环,直到无遗漏。
完成标准:代码转换率 100%、语法 0 错误且 <10 警告、编译通过、核心功能 100% 通过、功能覆盖率 ≥95%、核心页面 UI 100% 匹配、响应时间差异 <20%。
参考文档:API_MAPPING.md、COMPONENT_MAPPING.md、COMMON_PATTERNS.md、TROUBLESHOOTING.md、FEATURE_COMPARE.md、UI_COMPARE.md、PLANNING.md、TESTING.md。
限制:API 限制 <= API 22;示例项目源码路径与目标路径为资料中给出的本地路径;具体收费、平台支持与效果数据暂未提供。