py-memory-optimizer
SKILL.md
py-memory-optimizer Skill
Overview
This skill provides static analysis of Python code to identify memory-intensive patterns, potential memory leaks, and optimization opportunities. It generates actionable suggestions with estimated memory savings and best practice recommendations.
Core Capabilities
- Static Code Analysis: Parses Python source files using the AST module to analyze code structure without execution
- Pattern Detection: Identifies common memory-intensive patterns (large list comprehensions, unnecessary object creation, improper generator usage)
- Leak Detection: Finds potential memory leaks from circular references, unclosed resources, and global variable accumulation
- Optimization Suggestions: Provides specific, actionable recommendations with estimated memory impact
- Framework Support: Handles Python 3.8+ and common frameworks (Django, Flask, FastAPI patterns)
- CLI Interface: Command-line tool for integration into development workflows
- Report Generation: Creates detailed analysis reports in multiple formats (JSON, markdown, plain text)