How AI Coding is Reshaping HarmonyOS Multi‑Platform Development

The article analyzes the challenges of extending development to Android, iOS, and HarmonyOS simultaneously, outlines an AI‑driven workflow that includes code location, requirement understanding, and ArkTS generation, and shares practical lessons, skill sets, and case studies that demonstrate how AI can improve efficiency, observability, and reliability in cross‑platform client development.

Kuaishou Frontend Engineering
Kuaishou Frontend Engineering
Kuaishou Frontend Engineering
How AI Coding is Reshaping HarmonyOS Multi‑Platform Development

Introduction

After the rapid expansion of the HarmonyOS ecosystem, client development teams face not just single‑point adaptation but a comprehensive reassessment of their delivery system, moving from a dual Android/iOS model to a three‑platform parallel workflow.

1. Hongtu AI: Integrating AI into the Main Development Pipeline

Hongtu AI was created to move AI beyond simple code generation and become part of the entire development process. Its current focus covers three capabilities:

Code Locate : Given a business description, locate related code across Android, iOS, and HarmonyOS and produce development documentation.

Requirement Understanding : Generate material from Java/Kotlin/KMP/ArkTS code to feed subsequent AI code generation.

HarmonyOS Code Implementation : Produce robust ArkTS code based on the material and technical solution.

These capabilities form an agent loop that addresses three core problem types: context assembly, evidence grounding, and verification loop.

2. Business Jargon Code Localization

Accurate code localization is critical. Three approaches were tried:

Static "jargon guide" : A mapping from business terms to code keywords. Effective for isolated issues but costly to maintain.

Embedding and clustering of development traces : Vector retrieval of relevant snippets, which often yields fragmented context insufficient for high‑precision tasks.

Skill/SOP abstraction : Fixed procedures improve consistency but can constrain the model’s ability to handle real‑world ambiguities.

The most reliable method turned out to be exposing the full set of MR histories, product requirements, and raw code files directly to the model, allowing it to use genuine evidence rather than a processed summary.

3. Solution Understanding: Long Context Matters

When generating technical documents, models tend to produce well‑structured output that lacks deep analysis of migration boundaries, compatibility constraints, and risk factors. Effective prompting requires breaking the task into concrete questions, planning steps, and intermediate reasoning rather than feeding a single template.

Key observations:

Fixed templates drive the model toward self‑consistent formatting but ignore critical constraints.

Long context consumes the model’s attention budget; important details buried deep may be ignored.

LLMs excel at local consistency but rarely discover missing premises without explicit reflection steps.

4. ArkTS Code Generation Challenges

Generated ArkTS code often looks plausible but fails when integrated into real projects due to missing APIs, mismatched component patterns, or unavailable base capabilities. The root cause is limited public ArkTS corpora and extensive private conventions.

Two‑layer solution:

Pre‑generation context constraints : Provide the model with real API definitions, component usage examples, and prohibited patterns from the HarmonyOS repository.

Post‑generation feedback loop : Immediately run Edit Hooks, LSP checks, compilation, and log analysis to surface errors and trigger corrective cycles.

This harness‑based approach keeps the model anchored to actual engineering constraints.

5. Phase‑wise Skill Consolidation

Collaborating with the Huawei HarmonyOS task force, a set of reusable skills and tools were built, covering code generation, code locate, solution design, and knowledge maintenance. Example skills include: arkts-code-lookup: Provides public API and usage examples during ArkTS generation. arkts-code-check: Performs syntax and type checking on generated ArkTS. ets-lsp-check: LSP‑based validation. harmonyos-build: Direct compilation of HarmonyOS projects. harmonyos-fix: Parses build logs and iteratively fixes code.

Additional skills handle cross‑language mapping, function sorting, and knowledge base updates.

6. Real‑world Cases

Several projects demonstrated significant efficiency gains:

Small task (≈200 lines) using Claude Opus 4.6 achieved 90% first‑pass code generation and 100% final completeness, reducing effort from 7 hours to 25 minutes (~90% gain).

Medium task (≈3000 lines) achieved 70% first‑pass generation, 100% final completeness, cutting development time from 19.5 hours to 5.9 hours (~70% gain).

A detailed migration case showed that preparing accurate task context (code locations, dependencies, risk points) took about 3 hours, while solution generation took another 2 hours. The key insight was that high‑quality context, not raw generation speed, determines overall efficiency.

7. Next Steps: Towards a Verification Loop

The current pipeline stops after code generation. Future work focuses on closing the loop by integrating telemetry, real‑device execution, log capture, and result comparison into a unified CLI, reducing context fragmentation and enabling continuous feedback.

8. Conclusion

In the era of “multi‑code multi‑platform,” AI’s role shifts from a peripheral productivity tool to a core component of the development system. Success depends on exposing genuine development evidence, constraining generation with real repository knowledge, and establishing observable verification loops. The evolving Hongtu AI infrastructure, together with the defined skill set, illustrates a path toward stable, AI‑augmented client development.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

code generationLLMAI codingsoftware engineeringHarmonyOSCross‑platform development
Kuaishou Frontend Engineering
Written by

Kuaishou Frontend Engineering

Explore the cutting‑edge tech behind Kuaishou's front‑end ecosystem

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.