Dev & Engineering ✓ Microsoft · Official memory-leakdisposable-managementevent-listenerstypescriptdom-handlerslifecycle-managementtest-validation

Memory Leak Audit

Systematically find and fix listener, lifecycle, and disposable leaks in VS Code code.

FollowSkills review · FSRS-2.0
Use with care
52/ 100 5-point scale 2.6 / 5
1 2 3 4 5 6
1Trust17 / 25 · 3.4/5

The skill provides code-review guidance only and requests no credentials, network access, or elevated privileges. Its recommendations generally promote disposal and lifecycle isolation. It does not specify user confirmation, sensitive-data handling, rollback, or external-side-effect boundaries, and the cited PR claims are not directly verified in the supplied material, so points are deducted.

2Reliability8 / 20 · 2.0/5

The six-step checklist, examples, and verification section are internally readable, and the repository shows related chat leak scripts and CI workflows. However, the skill does not define handling for abnormal input, ambiguous framework semantics, failed tests, or unavailable dependencies; several rules are absolute, and key paths were not statically reproducible, so the score remains below the static ceiling.

3Adaptability10 / 15 · 3.3/5

Trigger scenarios are clear and cover listeners, lifecycle events, repeated calls, pooled objects, and tests. Non-fit cases, input/output format, audit boundaries, and semantic exceptions are not clearly defined. Chinese-language support is absent, but the core function does not depend entirely on unreachable overseas services, so only partial points are deducted.

4Convention7 / 15 · 2.3/5

The document has useful progressive structure with usage conditions, ordered checks, examples, and a quick-reference table. Repository context supplies MIT licensing, version information, and official maintenance provenance. The skill lacks installation or dependency notes, named ownership, an update path, changelog, FAQ, and explicit known limitations, warranting a mid-level score.

5Effectiveness6 / 15 · 2.0/5

The guidance can directly help a reviewer identify common disposable leaks and suggests concrete repair patterns such as MutableDisposable, Event.once, and DisposableStore. Repository context also exposes a chat memory-leak script and CI entry point. The skill does not define a standard review output or patch format, requires case-specific judgment, and has no statically verified representative outputs, so points are deducted.

6Verifiability4 / 10 · 2.0/5

The skill names PRs, code patterns, and repository scripts, while the supplied workflow provides auditable CI definitions for chat memory-leak checks. It lacks committed tests mapped to the skill's six key paths, pinned supporting evidence, and independent reproduction; no execution was performed in this review, so verifiability is limited.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 5b3e1be7be9e
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
Before you use it
  • Do not apply the absolute rules mechanically; verify object lifetime, event semantics, and ownership in the local context.
  • The cited PR validation claims were not independently verified from the supplied material and should not be treated as proven test results.
  • Listener-count checks and the chat leak script require the repository's actual environment, dependencies, and build conditions; static review is not execution.
  • The skill does not define an output format, failure diagnosis, or rollback procedure, leaving those responsibilities to the user.
See the full review method →

What does this skill do, and when should you use it?

This skill supports VS Code code review and fixes for memory leaks, with emphasis on event listeners, DOM handlers, lifecycle callbacks, and disposable ownership. Its six-step checklist covers DOM events, one-time events, repeated method calls, model lifetimes, pooled resources, and test validation. It focuses on addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose patterns. It is a good fit for leak-focused engineering work, although the source does not document a standalone installer or executable audit script.

It instructs an agent to inspect DOM event registration, one-time events, listeners created by repeatedly called methods, model-tied DisposableStores, disposal ownership for pooled objects, and disposable leak checks in test suites. It flags raw .onload, .onclick, addEventListener(), unsuitable this._register() usage, and missing model cleanup, then recommends the corresponding disposable patterns. After a fix, it can check listener counts before and after repeated operations, confirm that object counts stabilize, and, for chat-related leaks, run npm run perf:chat-leak --messages 20 --verbose.

  1. A developer reviews a search, toggle, or initialization method that may add another listener every time it runs.
  2. A developer investigates a reported DOM-handler or extension-icon leak where listener counts keep increasing.
  3. A developer implements onWillDispose or onDidClose lifecycle handling and needs resources to follow the model lifetime.
  4. A developer maintains list or tree pools and must scope each pooled item's listeners to that item rather than to the pool.
  5. A developer writes tests that create disposable objects and needs automatic suite-level leak validation.

What are this skill's strengths and limitations?

Pros
  • Provides an ordered six-step checklist covering DOM events, one-time events, repeated calls, model lifetimes, pooled resources, and tests.
  • Includes concrete bad-versus-good TypeScript examples.
  • Names specific patterns: addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose.
  • Defines post-fix checks for listener counts, object-count stabilization, and chat heap growth.
Limitations
  • The guidance is centered on VS Code-style disposables and event patterns; broader framework or runtime coverage is not evidenced.
  • It provides no standalone audit script, test suite, or report format; the agent performs the review using the instructions.
  • A standalone installation method is not documented.
  • Chat leak verification depends on npm and the separately referenced chat-perf skill, whose contents are not included here.

How do you install this skill?

The skill is located at .github/skills/memory-leak-audit/SKILL.md in the microsoft/vscode repository. The source only identifies it as one of 61 bundled skills and does not document a standalone installation command or package; load this SKILL.md in an Agent Skills-compatible client. The repository as a whole is licensed under MIT.

How do you use this skill?

In a review or repair task, ask: "Audit this code for memory leaks and disposable issues, especially event listeners, DOM handlers, repeated calls, model lifecycle, and test cleanup." Have the agent follow the six-step checklist and verify that listener and object counts remain stable after repeated operations. For a chat-specific check, request npm run perf:chat-leak --messages 20 --verbose; the skill notes that this uses the chat-perf skill.

FAQ

Does this skill scan an entire repository and produce a report automatically?
The source provides no scanning script or report format. It supplies review rules, code examples, and verification steps for an agent to apply.
What code is it intended for?
It explicitly targets code involving event listeners, DOM handlers, lifecycle callbacks, repeated method calls, model lifetimes, and disposable objects in VS Code.
Does using it require network access?
The SKILL.md does not require network access. It mentions npm run perf:chat-leak for chat verification, but does not state that this command needs a network connection.
Can it guarantee that a leak is fixed?
No. It prescribes listener, object-count, test, and optional chat checks, but provides no formal guarantee.

More skills from this repository

All from microsoft/vscode

Dev & Engineering ✓ Microsoft · Official

VS Code Configuration Policy Maintainer

Standardize VS Code policy registration, export, and validation.

Dev & Engineering ✓ Microsoft · Official

VS Code Unit Test Runner

Run VS Code repository unit tests by file, test name, or compiled-output glob.

Dev & Engineering ✓ Microsoft · Official

VS Code Chat Customizations Editor Skill

Guides developers through safe changes and testing for VS Code’s chat customization management UI.

Dev & Engineering ✓ Microsoft · Official

V8 Heap Snapshot Analyzer

Trace V8 heap retention paths to diagnose leaks and GC-surviving objects.

Dev & Engineering ✓ Microsoft · Official

Tool Rename Compatibility Check

Protect existing prompts and tool configurations when built-in tools are renamed.

Dev & Engineering ✓ Microsoft · Official

Run Command Builder

Configure and update commands shown in a VS Code Agent Session's Run button.

Dev & Engineering ✓ Microsoft · Official

VS Code Hygiene Checks

Catch VS Code commit-blocking style and hygiene issues before the work is declared complete.

Dev & Engineering ✓ Microsoft · Official

VS Code Smoke Test Failure Diagnosis

Diagnose and validate intermittent VS Code Electron smoke-test failures in Azure DevOps.

Dev & Engineering ✓ Microsoft · Official

Anthropic SDK Upgrade Assistant

Upgrade Anthropic SDK packages methodically while checking API changes, compilation, and Claude-focused tests.

Dev & Engineering ✓ Microsoft · Official

Context7 Project Bootstrapper

Build a complete VS Code project scaffold using current library documentation.

Dev & Engineering ✓ Microsoft · Official

GitHub Copilot SDK Upgrade Assistant

Upgrade and validate @github/copilot in the VS Code Copilot Chat project.

Dev & Engineering ✓ Microsoft · Official

VS Code Chat Performance Lab

Benchmark chat rendering and detect memory growth across VS Code builds.

Dev & Engineering ✓ Microsoft · Official

VS Code Agents Window Sessions

Safely implement and repair VS Code Agents window features.

Dev & Engineering ✓ Microsoft · Official

Component Fixtures for Screenshot Testing

Create stable, theme-aware VS Code component fixtures for isolated screenshot testing.

Dev & Engineering ✓ Microsoft · Official

VS Code Telemetry Error Fix Guide

Trace unhandled telemetry errors to invalid-data producers instead of masking the crash site.

Dev & Engineering ✓ Microsoft · Official

VS Code Integration Test Runner

Run and filter VS Code repository integration tests with the correct platform scripts.

Dev & Engineering ✓ Microsoft · Official

Session Code Review

Review the current session's code changes and place actionable findings directly on the relevant lines.

Dev & Engineering ✓ Microsoft · Official

Copilot Session Troubleshooter

Explain unexpected Copilot CLI behavior from session-log evidence.

Dev & Engineering ✓ Microsoft · Official

Branch Merge Assistant

Safely merges session work from a topic branch back into its base branch.

Dev & Engineering ✓ Microsoft · Official

Git Branch Sync

Safely sync an upstream branch or publish the current session branch to a remote.

Related skills