What problem does it solve? Diagnosing JavaScript memory leaks in HarmonyOS/ArkTS applications requires manually inspecting rawheap and heapsnapshot files, tracing reference chains to GC Roots, and correlating objects with native allocations—a slow, error-prone process. This Skill automates heap clustering, cross-snapshot comparison, and fault-mode classification to pinpoint leak suspects with root causes and fix suggestions. ## Core Features & Use Cases - Heap Conversion & Clustering: Converts .rawheap files to .heapsnapshot via platform-specific rawheap_translator binaries, then runs the Node-based heap_cluster script to produce Markdown, HTML, and JSON reports of top business and common objects by Retained Size. - Multi-Snapshot & Version Comparison: Aggregates a directory of snapshots into a cumulative leaderboard, or compares baseline vs. new version directories to surface new and growing objects indicating memory regressions. - GlobalHandler Native Stack Correlation: When explicitly requested, links GlobalHandler objects to native call stacks using rawheap + htrace + js_map three-in-one logs or a native hook DB, with aggregate fallback when address-level mapping is unavailable. - Fault Mode Classification: Matches every leak suspect against the ArkTS OOM fault mode library (ROOT_VM, ROOT_FRAME, ROOT_LOCAL_HANDLE, ROOT_GLOBAL_HANDLE) and outputs a structured report with reference chains, three-level root causes, and repair suggestions. - Use Case: A HarmonyOS developer receives a memory leak faultlog containing a .rawheap file. The Skill converts it, clusters the snapshot, identifies a large object held by a GlobalHandle root, classifies it as FM-04, and recommends adding the missing napi_delete_reference call. ## Quick Start Use the hmos-jsleak-analysis skill to analyze the memory snapshot file leak.rawheap and generate a memory leak analysis report.