Memory Leak Diagnosis Skill
Installation
SKILL.md
Swift Memory Diagnosis
Prove the lifetime bug before changing capture lists. “Memory grew,” “deinit has not run yet,” “an object is retained,” and “an allocation is leaked” describe different evidence.
Compatibility baseline
ARC, weak references, and Xcode’s core memory tools apply across currently supported Swift/Apple-platform projects. State version requirements for the specific APIs in the inspected code:
- Structured concurrency and
Taskrequire Swift 5.5 and the corresponding platform concurrency runtime. - The task example in this skill uses duration-based sleep, available with Swift 5.7-era toolchains and iOS 16 / macOS 13.
- Observation, SwiftData, Combine, and framework-specific lifetime rules depend on the app’s declared deployment targets.
- Xcode and Instruments UI labels change. Describe goals and inspected relationships, not assumed arrow colors or displayed reference-count numbers.