memory-leak-detection
OfficialPrevent NAPI memory leaks with correct scope handling.
Software Engineering#cpp#openharmony#napi#memory leak detection#async callbacks#handle scope#handle escape
Authoropenharmonyinsight
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps you find and fix NAPI memory leaks in OpenHarmony Ability Runtime by enforcing correct HandleScope and HandleEscape usage so JS objects created from C++ don’t become unreachable but still retained.
Core Features & Use Cases
- Detect risky napi_value lifecycles: flags issues when functions return
napi_value, usenapi_value&outputs, callnapi_create_*, create temporarynapi_valueduring property setting, or create values inside async callbacks without proper scope management. - Apply proven fixes (patterns/templates): provides concrete C++ patterns for using
HandleEscapewhen returning values to the parent scope,HandleScopefor output parameters, andHandleScopeinside async tasks. - Review assist by function type: recommends which function categories (e.g.,
Create*,Wrap*) typically require scope management checks.
Quick Start
Ask the AI to review the specific OpenHarmony NAPI C++ function you’re worried about (paste the function body) and identify which HandleScope/HandleEscape changes are required to eliminate potential leaks.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: memory-leak-detection Download link: https://github.com/openharmonyinsight/openharmony-skills/archive/main.zip#memory-leak-detection Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.