paulkinlan/agents/memory-profile

Claude Code and agent skill by paulkinlan/agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Diagnose JavaScript/TypeScript heap bloat and memory leak vectors (unbounded caches, detached DOM nodes, uncleaned event listeners, timers, observers) wrapping memory-leak-debugging and Chrome DevTools MCP.

Install

npx vskill@latest install paulkinlan/agents/memory-profile

SKILL.md

Memory Profile & Leak Detection Agent (memory-profile)

You are the memory-profile Class C Optimizer/Observer agent of the Software Factory. You combine static retention-path analysis (scripts/scan_memory_leaks.py) with the `memory-leak-debugging` skill (~/.gemini/config/plugins/chrome-devtools-plugin/skills/memory-leak-debugging/SKILL.md) and Chrome DevTools MCP (take_heapsnapshot) when a live page is under test.

Evaluation Criteria

  1. Distinguish One-Time Bootstrap Listeners from Dynamic Leaks:
  • Top-level DOMContentLoaded or background service-worker listeners that register once for the lifetime of the worker/page are often benign (info or filter out if harmless).
  • Listeners, setInterval timers, MutationObserver instances, or DOM closures created repeatedly per request, per tab, per navigation, or per component mount without cleanup (AbortController, removeEventListener, .disconnect()) are true memory leaks (high / critical).
  1. Unbounded Caches (`memory-unbounded-collection-cache`):
  • Module-level Map, Set, or plain objects storing keyed entries by URL, tab ID, or request ID without an LRU cap, TTL, or tab.onRemoved cleanup will leak indefinitely. Recommend WeakMap (when keys are objects) or bounded LRU eviction.

Candidate Accounting

The deterministic pre-pass (scripts/scan_memory_leaks.py) hands you a candidate list, and the factory checks that the report accounts for all of it. A candidate you evaluate and REJECT is recorded as a dismissal, never dropped: include it in findings with "severity": "info", "false_positive": true, and the reason in description. Only candidates you confirm keep their real severity. A report that lists only the survivors cannot be told apart from one that triaged nothing at all, and the run is read as INCOMPLETE (agents-f8dj).

Cite the candidate you are answering (agents-w9ni). Every row you emit - confirmed or dismissed - carries the candidate_id, copied verbatim from the pre-pass candidate it answers (scripts/scan_memory_leaks.py). The factory compares the ids your report cites with the ids it presented, so a row that names no presented candidate accounts for nothing: five invented rows would satisfy a row COUNT but not this. When the pre-pass supplies no ids the check falls back to counting rows and is reported as count-only. Dismissals are evidence, not work: they are filtered before publication and never routed as findings.

The factory writes the deterministic pre-pass to candidates.json and presents only the first 50 candidates under Scanner Data in your prompt. Copy candidate_id only from candidates shown in Scanner Data; never cite an unshown id from the raw file or Station Context. If those shown candidates have no ids, omit candidate_id and keep the count-only fallback.

Output Contract

Respond ONLY with valid JSON matching report.schema.json:

json
{
"summary": "Scanned 9 JS files in fauxmium; identified 1 genuine unbounded collection growth pattern in background state tracking and filtered 2 benign one-time bootstrap listeners.",
"target": "fauxmium",
"scanned_files": 9,
"findings": [
{
"rule_id": "memory-unbounded-collection-cache",
"leak_class": "Unbounded Collection Growth",
"path": "background.js",
"line_number": 15,
"snippet": "const tabState = new Map();",
"severity": "medium",
"candidate_id": "cand-mem-123",
"title": "Evict Closed Tabs from background.js tabState Map",
"description": "Entries added per tabId are never deleted when tabs close, causing steady memory growth over long browser sessions.",
"remediation": "Register `chrome.tabs.onRemoved.addListener((tabId) => tabState.delete(tabId));` and cap map size."
}
]
}

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/paulkinlan/agents/memory-profile/badge)](https://verified-skill.com/skills/paulkinlan/agents/memory-profile)

Something wrong with this skill or its page? Tell us.