auto-perf-optimize

Automate VS Code scenarios to capture heap snapshots and diagnose memory leaks.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/jimeh/hucode --skill auto-perf-optimize-jimeh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: auto-perf-optimize
Source: https://github.com/jimeh/hucode/tree/main/.github/skills/auto-perf-optimize
Command: npx skills add https://github.com/jimeh/hucode --skill auto-perf-optimize-jimeh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright-core, @playwright/cli, and includes scripts (resource) components.

What problem does it solve? Investigating memory leaks and performance regressions in VS Code requires manually repeating UI workflows while capturing heap snapshots, which is slow, error-prone, and hard to reproduce. This Skill automates launching Code OSS, driving repeatable scenarios with Playwright over CDP, and collecting verifiable memory artifacts. ## Core Features & Use Cases - Automated scenario runners: Checked-in scripts drive multi-turn Chat sessions, session switching, and workbench CSS performance measurement while sampling renderer heap and writing summary.json plus screenshots. - Targeted heap snapshot capture: Take labeled .heapsnapshot files at warmed-up baseline and later iterations instead of snapshotting every sample, then hand off to heap-snapshot-analysis for object and retainer investigation. - Fix-and-verify workflow: Root-cause leaks with git blame and lifecycle tracing, patch product code, rerun the identical scenario, and compare like-for-like memory trends. - Use Case: A user suspects Chat sessions leak memory. Run the chat-memory-smoke runner for 8 iterations with two snapshot labels, verify summary.json, compare snapshots, fix the leaking disposable chain, and rerun to confirm flat memory growth. ## Quick Start Ask the agent to run the Chat memory smoke runner with a few iterations and no heap snapshots to validate the scenario before capturing targeted heap snapshots.

Frequently Asked Questions about auto-perf-optimize

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

FAQPage Schema
How do I run a VS Code memory leak investigation with automation?▼

Run the bundled chat-memory-smoke.mts runner with a small iteration count and --no-heap-snapshots first to validate the scenario. Once reliable, rerun with targeted --heap-snapshot-label values to capture baseline and later-iteration snapshots for comparison.

How to capture heap snapshots from a running VS Code instance?▼

The runners launch Code OSS with --enable-smoke-test-driver and a remote debugging port, connect via Playwright's chromium.connectOverCDP, enable the CDP HeapProfiler domain, force garbage collection, and write labeled .heapsnapshot files under the run's heap folder.

Can I automate non-Chat VS Code scenarios for performance testing?▼

Yes. Write a new scenario runner in the gitignored scratchpad folder using patterns from the checked-in scripts: launch Code OSS, connect over CDP, wait for workbench restore, sample heap, and write summary.json. Validate with --no-heap-snapshots before capturing snapshots.

Why should I avoid taking heap snapshots on every iteration?▼

Heap snapshots are huge and slow to capture, so snapshotting every sample wastes time and can hide real failures. Capture only a warmed-up baseline and a later iteration, since startup, login, and first-use allocations are expected noise.

When should I use heap-snapshot-analysis instead of this skill?▼

Use heap-snapshot-analysis directly when .heapsnapshot files already exist and you only need object grouping, retainer paths, or snapshot comparison. This skill is for driving scenarios and producing the snapshots, not analyzing existing ones.