lifecycle_guard

Enforce explicit disposal patterns for VS Code webview extensions.

2|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/IdanDavidAviv/virgo --skill lifecycle-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lifecycle_guard
Source: https://github.com/IdanDavidAviv/virgo/tree/main/.agent/skills/lifecycle_guard
Command: npx skills add https://github.com/IdanDavidAviv/virgo --skill lifecycle-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents memory leaks and accumulation of global event listeners in VS Code webview extensions by enforcing disciplined disposal and test isolation.

Core Features & Use Cases

  • Explicit disposal methods on components that register global listeners.
  • Global test setup to mock APIs and enforce cleanups.
  • Verification protocol to detect lingering listeners between tests.

Quick Start

Implement explicit disposal patterns and a global test setup to ensure no leaked listeners in your VS Code webview extension.

Frequently Asked Questions about lifecycle_guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent memory leaks in VS Code webview extensions?

Prevent memory leaks in VS Code webview extensions by enforcing explicit disposal patterns for global event listeners. Implementing disciplined disposal methods ensures deterministic cleanup and prevents listener accumulation across extension lifecycles.

How do I ensure test isolation for VS Code webview event listeners?

Ensure test isolation by applying a global test setup that mocks APIs and enforces cleanups. A verification protocol then detects lingering listeners between tests, maintaining deterministic isolation for webview extensions.

Why do global event listeners accumulate in VS Code webviews?

Global event listeners accumulate in VS Code webviews when components register listeners without explicit disposal methods. Without disciplined cleanup, listeners persist across lifecycle changes, leading to memory leaks and degraded extension performance.

What is the best way to verify disposal in VS Code webview testing workflows?

The best way to verify disposal is applying a dedicated verification protocol to detect lingering listeners between tests. Combine this with a global test setup enforcing cleanups to satisfy anti-leak practices.

Can I use explicit disposal patterns to fix webview event listener accumulation?

Yes, explicit disposal patterns fix webview event listener accumulation by requiring components that register global listeners to implement disposal methods. This enforces deterministic cleanup and prevents leaks in VS Code extensions.