memory-leak-detection

Official

Prevent NAPI memory leaks with correct scope handling.

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, use napi_value& outputs, call napi_create_*, create temporary napi_value during property setting, or create values inside async callbacks without proper scope management.
  • Apply proven fixes (patterns/templates): provides concrete C++ patterns for using HandleEscape when returning values to the parent scope, HandleScope for output parameters, and HandleScope inside 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 required

Components

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.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.