# dsh-harmony-migrate **Repository Path**: kingwild/dsh-harmony-migrate ## Basic Information - **Project Name**: dsh-harmony-migrate - **Description**: Android → HarmonyOS 迁移助手:为 DeepSeek Harness 提供扫描评估、映射查询、最佳实践工程生成与官方技能路由 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-11 - **Last Updated**: 2026-11-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # dsh-harmony-migrate > Android → HarmonyOS migration assistant for DeepSeek Harness (DSH): scan, map, generate best-practice projects, and route to the official DevEco skills — turning your AI agent into a HarmonyOS migration engineer. [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![release](https://img.shields.io/badge/release-v1.3.0-blue)](https://gitee.com/kingwild/dsh-harmony-migrate/releases) [![tests](https://img.shields.io/badge/tests-92%20passed-brightgreen)](https://gitee.com/kingwild/dsh-harmony-migrate) ## Why HarmonyOS NEXT no longer runs Android APKs, so many Android apps and teams face migration. This plugin packages the migration domain knowledge, scaffolding, and official-skill routing as DSH plugin tools: - **Assess** an Android project (Compose component mapping coverage); - **Look up** how a Compose/Android API is written in HarmonyOS; - **Scaffold** a best-practice HarmonyOS project (Navigation + system router map, feature modules, MVVM, V2 state, adaptive layouts); - **Route** to the official DevEco skill set (writing `.ets`, `@kit.*` imports, build verification). ## Install (for users) The repository is public: **Option 1 — npm (fastest; 1.3.0 is published)** ```bash dsh plugin --profile add dsh-harmony-migrate ``` **Option 2 — git source (when you prefer not to depend on npm)** ```bash dsh plugin --profile add https://gitee.com/kingwild/dsh-harmony-migrate.git # or the pnpm shorthand dsh plugin --profile add gitee:kingwild/dsh-harmony-migrate ``` > `dsh plugin add` delegates to `pnpm add`, so an npm name, a git URL, a tarball, or a local directory all work. **Option 3 — DSH Desktop, through the Plugins page** Open the app → sidebar **Plugins** → **Installed / Install** → add, and paste the git URL above. > ⚠️ The Desktop profile is **managed exclusively by the Electron application**: the > CLI refuses with `profile "desktop" is managed exclusively by the Electron application`. > Desktop users install from the in-app Plugins page. **Option 4 — marketplace Discover page (enable index sources first)** ```bash dsh plugin --profile add @deepseek-ai/dsh-experimental-plugin-market-bundle ``` After a restart: Plugins → **Discover** → **Add index source** → ``` # recommended (jsDelivr serves it from the npm package: fast in CN, immutable cache) https://cdn.jsdelivr.net/npm/dsh-harmony-migrate@1.3.0/market/index.json # fallback (Gitee raw) https://gitee.com/kingwild/dsh-harmony-migrate/raw/master/market/index.json ``` Then search for “HarmonyOS migration assistant” and install in one click. Verify the index first if you like: ```bash node scripts/check-index-url.mjs https://gitee.com/kingwild/dsh-harmony-migrate/raw/master/market/index.json ``` **Restart DSH after installing.** Then either open any session and click **“Android 迁移 Harmony”** in the header to launch the six-step wizard, or simply ask the agent to scan an Android project. | Capability | Requirement | |---|---| | Scan / map / convert / generate | none | | Build verification (wizard step 5), `harmony_build` / `run` / `log` | **DevEco Studio** installed and `devecocli` on PATH | | DSH version | `engines.dsh: ">=0.2.2-rc.1"` | ## Documentation The root keeps only the README; all docs live in [`docs/`](docs/index.md): - [Implementation plan](docs/implementation-plan.md): roadmap v0.4→v1.0, milestones, risks, estimates - [Migration quality](docs/migration-quality.md): acceptance checklist - [Official skills catalog](docs/official-skills.md): snapshot, versions, installation ## Tools | Tool | Purpose | |---|---| | `harmony_scan` | Scan an Android project (**XML + Compose mixed projects supported**): file stats, Compose usage, detected components, mapping coverage | | `harmony_map` | Look up mappings: `kind=compose` (default, Compose→ArkUI), `kind=api` (Android API→HarmonyOS), `kind=xml` (XML layouts/widgets/attributes→ArkUI) | | `harmony_generate` | Generate a best-practice project: Navigation + system router map (no router), V2 state, MVVM + feature modules, adaptive (NavigationMode.Auto + GridRow/GridCol + tablet resource qualifiers) | | `harmony_official_skills` | Query/route the official DevEco skills set (live registry; offline snapshot fallback) | | `harmony_convert` | Deterministic Compose page/snippet → ArkUI (V2) conversion + quality gate (TODO markers for manual review) | | `harmony_build` | Build HAP via devecocli (fixed subcommands + parameter whitelist + timeout + output truncation) | | `harmony_run` | Build, install and launch on a device/emulator (device must be connected) | | `harmony_log` | Fetch hilog / crash logs (level / bundle / keyword / time offset / tail) | ## Migration wizard (since v1.1; v1.3 adds XML inventory and conversion) A “迁移” (Migrate) button in the session header opens a **step-by-step wizard**: choose project → scan report → configure → generate scaffold → build verification → official skills. - Report: project size, Compose component list, mapping coverage; - Real progress: scan/generate stream live percentages, and the build step streams hvigor output into a log console; - Native directory picker, plus remembered path and settings; - Data flows through the plugin's own `/harmony-migrate/api` routes (browser-trust fenced). See [docs/user-guide.md](docs/user-guide.md). ## Plugin market (self-hosted index, no npm) The repo ships a format-1 market index at `market/index.json`. In the DSH plugin page → Discover → Add index source, enter: - Gitee Pages (after enabling): `https://kingwild.gitee.io/dsh-harmony-migrate/market/index.json` - or Gitee raw (when browser-reachable): `https://gitee.com/kingwild/dsh-harmony-migrate/raw/master/market/index.json` See [docs/market.md](docs/market.md) for hosting options and release updates. ## Best-practice scaffold (v0.3) `harmony_generate` follows the official "HMOS Code Workshop" sample () and the official skill rules: ``` ets/ ├── entryability/EntryAbility.ets entry ability ├── page/MainPage.ets Navigation host (single @Entry) + system router map ├── common/ PageEnum / PageContext / Theme / Logger ├── features/ home + settings (extract to HAR/HSP later) │ ├── home/{model,viewmodel,view} V2 state + MVVM │ └── settings/{model,viewmodel,view} NavDestination page (router_map) └── resources/ base + tablet qualifiers ``` Rules: Navigation + `router_map.json` (`name` + `pageSourceFile` + `buildFunction`), no `router` / `pageTransition` / multiple `@Entry`; V2 state (`@ComponentV2` + `@Local/@Param/@Event/@ObservedV2/@Trace/@Computed`); MVVM with View never importing Model; adaptive via `NavigationMode.Auto`, `GridRow/GridCol`, and resource qualifiers. Quality baseline: [`docs/migration-quality.md`](docs/migration-quality.md). 7. **Multi-module scaffold (v0.7)**: `harmony_generate({ modules: "multi" })` produces entry HAP + common HAR + features HAR; single module stays the default, both modes are covered by golden snapshots. ## Skills `skills/` ships three knowledge skills (now with best-practice guidance: architecture, navigation, V2 state, adaptive layouts): - `compose-to-arkui`, `android-to-harmony-api`, `harmony-migration-workflow`. ## Data - `data/compose-arkui-map.json` — Compose → ArkUI (~50 entries) - `data/android-api-map.json` — Android → HarmonyOS API (~35 entries) Contributions welcome; entries carry `confidence` and `note`. ## Official skills ecosystem (important) HarmonyOS ships an official, continuously updated Agent skills set in DevEco (60+ skills today). This plugin is the migration layer — **API details are owned by the official skills**; this repo does not embed their content: - Upstream: - Live registry (same source as `devecocli skills`): - Query/install: `devecocli skills list`, `devecocli skills add --all --path ` - `harmony_official_skills` tool fetches the live catalog and routes tasks to skills (`action=route`), e.g. "write .ets page" → `hmos-arkui-develop-skill`, "@kit.* import" → `hmos-one-sdk-skill` ⚠️ Local caches can be stale (e.g. the 2026-10-28 install of `hmos-arkui-develop-skill` lacks `references/style-guide.md`/`test-cases/` present in live v1.1.1). Trust `devecocli skills list` and the live registry; `data/official-skills.json` is a dated offline fallback only. ## Development ```bash npm test # dependency-free Node assertions npm run check # syntax checks node scripts/gen-official-skills.mjs # refresh official skills snapshot + docs (needs network) ``` No build step: `lib/` is the source (ESM). ## Roadmap - [x] v0.1–v0.3: tools + mapping data + skills + official-skill routing + best-practice scaffold + quality guide - [x] v0.4: visual panel (session-header entry + overlay) - [x] v0.5: devecocli integration (build / run / log) - [x] v0.6: code-level Compose → ArkUI converter (deterministic core + quality gate) - [x] v0.7: engineering (multi-module templates, CI, golden snapshots) - [x] v1.0: release (Gitee Release + self-hosted market index; 1.1.0 is on npm) - [x] v1.1: six-step visual wizard + real execution progress + four buildability fixes - [x] v1.2: XML/Compose **mixed-project** inventory (three coverage figures) + Compose false-positive fix - [x] v1.3: **XML layout → ArkUI converter (M1)** — measured on 112 real layouts: 90% of nodes mapped, 21% structurally automatic; M2/M3 deliberately skipped after that measurement (see [CHANGELOG](docs/CHANGELOG.md)) ## License MIT