# ios-memgraph-analysis

A skill for reading iOS .memgraph files: it separates unreachable leaks from reachable heap growth and keeps the raw tool output.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1200 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/ios-memgraph-analysis/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/ios-memgraph-analysis

## What it does

This skill handles memory graphs from iOS apps and shows why an object outlives the point where it should have gone away. Unreachable leaks and reachable growth stay separate here, raw tool output is kept, and after a fix the same app-owned type and ownership path get checked again.

Two Python scripts do the work. `scripts/capture_sim_memgraph.py` grabs a graph from a running Simulator app: it takes `--bundle-id`, `--output-dir` and `--pretty`, shells out to `leaks --outputGraph`, and writes a manifest. `scripts/summarize_memgraph.py` parses the graph, drops raw artifacts into their own directory, and supports `--app-image`, `--trace-limit`, `--group-by-type` and `--reference-tree`. With several Simulators booted you need `--udid`; the script matches exactly one launchd label and one PID and errors out on zero or multiple hits. Capturing suspends the process, so latency numbers from a capture mean nothing.

The order matters. Name the object and the event that ends its useful life first, then run one fixed sequence of steps before and after the graph. Keep the build, the data and the Malloc Stack Logging setting identical between runs, or the comparison falls apart. Apple does not treat these text formats as stable schemas, so parser warnings are a reason to open the raw artifacts, not to soften the parser. Interactive Memory Graph Debugger, Instruments and LLDB work belong to the `debugging-instruments` skill.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill ios-memgraph-analysis -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/ios-memgraph-analysis/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/ios-memgraph-analysis/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill ios-memgraph-analysis -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/ios-memgraph-analysis/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill ios-memgraph-analysis -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/ios-memgraph-analysis/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills ios-memgraph-analysis
```

2. **Manually: put the files in place**
- File: `.github/skills/ios-memgraph-analysis/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill ios-memgraph-analysis -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/ios-memgraph-analysis
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/ios-memgraph-analysis/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill ios-memgraph-analysis -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/ios-memgraph-analysis/SKILL.md

## When to use it
- prove an object survives past its expected lifetime boundary
- tell an unreachable leak apart from reachable heap growth
- capture a memory graph from a running Simulator app
- locate the first app-owned strong edge in an ownership path
- compare baseline and post-flow graphs from the same flow

## Example prompts
- Capture a memory graph from the running app by `--bundle-id` and keep the raw artifacts
- Parse the `.memgraph` and show which app types still hold memory after the editor closes
- \`leaks` reports nothing but the heap keeps growing — diff the baseline and post-flow graphs

## Similar
- [vercel-react-native-skills](https://affpapa.org/en/nevibecode/skills/vercel-react-native-skills.md) — skill · 255200 installs
- [animate-expo](https://affpapa.org/en/nevibecode/skills/animate-expo.md) — skill · 137900 installs
- [mobile-native](https://affpapa.org/en/nevibecode/skills/mobile-native.md) — skill · 86600 installs
- [aso](https://affpapa.org/en/nevibecode/skills/aso.md) — skill · 75400 installs
- [swiftui-pro](https://affpapa.org/en/nevibecode/skills/swiftui-pro.md) — skill · 35200 installs
- [orca-emulator](https://affpapa.org/en/nevibecode/skills/orca-emulator.md) — skill · 5800 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
