Memory deity
A ruthlessly strict algorithmic optimization methodology for AI coding agents. Forces your agent to profile, benchmark, and mathematically prove performance gains before writing code.
npx -y skills add v0idOS/performance-deity --skill memory-deityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.5 KB, as published. Nobody here has run it
Memory Deity: The Leak Hunter
Description
This skill enforces a rigorous approach to tracking down and eliminating memory leaks and excessive garbage collection (GC) pauses. Do not guess where the leak is; prove it with memory profiling.
Triggers
Activate when the user mentions:
- "memory leak"
- "high RAM usage"
- "out of memory" or "OOM"
- "garbage collection"
- Or explicitly runs
/plugin performance-deity:memory
Core Directives
Phase 1: Isolation
- Identify the target code suspected of leaking memory.
- Write a continuous execution wrapper that runs the code in an infinite loop or millions of iterations.
Phase 2: Instrumentation
- Inject memory tracking into the wrapper:
- Node.js: Use
process.memoryUsage().heapUsedbefore and after. - Python: Use
tracemalloc. - PowerShell: Use
[System.GC]::GetTotalMemory($false).
- Node.js: Use
- Run the wrapper and plot the memory delta. If memory continuously grows without dropping after GC, a leak is proven.
Phase 3: Excision
- Identify the uncollected references (e.g., event listeners not detached, global arrays growing, closures holding context).
- Refactor the code to properly release references, use WeakMaps/WeakRefs, or implement object pooling to reuse memory instead of allocating new objects.
Phase 4: Proof
- Re-run the instrumented wrapper.
- Present a report showing:
- Original Memory Growth (e.g., +50MB / 10k ops)
- New Memory Growth (e.g., +0MB / 10k ops)
- Explanation of the fix.