Agent Skillsopenai/plugins › ios-memgraph-leaks

ios-memgraph-leaks

GitHub

用于捕获和分析iOS模拟器内存泄漏的Skill,通过memgraph取证、根因追溯及修复验证,解决对象保留循环和内存增长问题。

plugins/build-ios-apps/skills/ios-memgraph-leaks/SKILL.md openai/plugins

Trigger Scenarios

调试iOS内存泄漏 分析retain cycles 验证内存修复效果

Install

npx skills add openai/plugins --skill ios-memgraph-leaks -g -y
More Options

Non-standard path

npx skills add https://github.com/openai/plugins/tree/main/plugins/build-ios-apps/skills/ios-memgraph-leaks -g -y

Use without installing

npx skills use openai/plugins@ios-memgraph-leaks

指定 Agent (Claude Code)

npx skills add openai/plugins --skill ios-memgraph-leaks -a claude-code -g -y

安装 repo 全部 skill

npx skills add openai/plugins --all -g -y

预览 repo 内 skill

npx skills add openai/plugins --list

SKILL.md

Frontmatter
{
    "name": "ios-memgraph-leaks",
    "description": "Capture and inspect iOS leaks and memgraphs. Use when debugging leaked objects, retain cycles, memory growth, or before\/after leak evidence."
}

iOS Memgraph Leaks

Use this skill to prove iOS leaks from a live simulator process or an existing .memgraph. Pair it with ../ios-debugger-agent/SKILL.md when the task also needs simulator build, install, launch, UI driving, logs, or screenshots.

Core Workflow

  1. Build, launch, and drive the exact flow that should release objects.
  2. Capture a memgraph from the running simulator process with scripts/capture_sim_memgraph.sh.
  3. Summarize leaks with scripts/summarize_memgraph_leaks.py.
  4. For each app-owned leaked type, inspect ownership with leaks --traceTree=<address> <file.memgraph> and grouped leak evidence.
  5. Make the smallest root-cause patch, then recapture the same flow on the same simulator when possible.
  6. Report proof: before/after leak counts, disappeared root types, remaining leaks, memgraph paths, and test/build results.

Do not claim a leak fix from a smaller memgraph alone. A credible fix explains the ownership path that kept the object alive and shows that the same path or type disappears after the patch.

Capture

Prefer capturing from the simulator already used for the reproduction. Resolve the simulator UDID and app bundle identifier, then capture the running app:

SKILL_DIR="<absolute path to this loaded skill folder>"
SIM="<simulator-udid>"
BUNDLE_ID="<app.bundle.identifier>"
MEMGRAPH_DIR="$(mktemp -d "${TMPDIR:-/tmp}/codex-ios-memgraph.XXXXXX")"

"$SKILL_DIR/scripts/capture_sim_memgraph.sh" \
  --udid "$SIM" \
  --bundle-id "$BUNDLE_ID" \
  --out-dir "$MEMGRAPH_DIR"

Do not derive SKILL_DIR from the target app repo's pwd; installed plugins usually live outside the app being debugged. Store captures in a run-specific temp or user-chosen folder, not under SKILL_DIR.

If the process cannot be found, confirm the bundle identifier and use xcrun simctl spawn "$SIM" launchctl list to inspect running labels.

Summarize

Summarize an existing memgraph:

"$SKILL_DIR/scripts/summarize_memgraph_leaks.py" \
  /path/to/app.memgraph \
  --trace-limit 5 \
  --out /path/to/leak-summary.md

Use --trace-limit sparingly. Trace trees are useful root-cause evidence, but large memgraphs can produce noisy output. If a trace tree says Found 0 roots referencing, treat it as an unreachable/self-retained leak candidate and use the summary's grouped leak tree or leaks --groupByType <file.memgraph> to identify the retained fields and payload chain.

Root Cause Rules

  • Identify the first app-owned leaked type in the leak output or trace.
  • Determine the intended lifetime: process, session, account, view, request, or task.
  • Treat lazy or deferred allocation as a scope reduction, not a leak fix, unless the original eager allocation itself violated the intended lifetime.
  • Prove retain-cycle claims with either a traceTree ownership path or an isolated reproduction.
  • For unreachable/self-cycle leaks, traceTree may have no root path; use leaks --groupByType plus source verification to find the self-retaining edge.
  • Do not claim success just because total leak count went down; prove the specific type or path disappeared.
  • Separate real root-cause branches from candidate/noise branches.
  • Prefer deleting the retaining edge over adding broad cleanup code.

Report

A useful leak report includes:

  • the exact flow and simulator/app build
  • the memgraph and summary paths
  • app-owned leaked types and counts
  • at least one ownership path, or grouped leak tree evidence when the object is unreachable from roots
  • the smallest proposed or applied retaining-edge fix
  • before/after evidence when a fix was made

If the memgraph shows only framework/runtime noise, say that and recommend the next narrower capture rather than inventing an app leak.

Version History

  • 11c74d6 Current 2026-07-19 09:28

Same Skill Collection

.agents/skills/plugin-creator/SKILL.md
plugins/airtable/skills/airtable-cli/SKILL.md
plugins/airtable/skills/airtable-filters/SKILL.md
plugins/airtable/skills/airtable-overview/SKILL.md
plugins/atlassian-rovo/skills/capture-tasks-from-meeting-notes/SKILL.md
plugins/atlassian-rovo/skills/generate-status-report/SKILL.md
plugins/base44/skills/base44-cli/SKILL.md
plugins/base44/skills/base44-sdk/SKILL.md
plugins/base44/skills/base44-troubleshooter/SKILL.md
plugins/boltz-api-cli/skills/boltz-check-status/SKILL.md
plugins/boltz-api-cli/skills/boltz-cli-setup/SKILL.md
plugins/boltz-api-cli/skills/boltz-protein-design/SKILL.md
plugins/boltz-api-cli/skills/boltz-protein-screen/SKILL.md
plugins/boltz-api-cli/skills/boltz-small-molecule-adme/SKILL.md
plugins/boltz-api-cli/skills/boltz-small-molecule-design/SKILL.md
plugins/boltz-api-cli/skills/boltz-small-molecule-screen/SKILL.md
plugins/boltz-api-cli/skills/boltz-structure-and-binding/SKILL.md
plugins/box/skills/box/SKILL.md
plugins/brighthire/skills/brighthire/SKILL.md
plugins/build-ios-apps/skills/ios-app-intents/SKILL.md
plugins/build-ios-apps/skills/ios-debugger-agent/SKILL.md
plugins/build-ios-apps/skills/ios-ettrace-performance/SKILL.md
plugins/build-ios-apps/skills/ios-simulator-browser/SKILL.md
plugins/build-ios-apps/skills/swiftui-liquid-glass/SKILL.md
plugins/build-ios-apps/skills/swiftui-performance-audit/SKILL.md
plugins/build-ios-apps/skills/swiftui-ui-patterns/SKILL.md
plugins/build-ios-apps/skills/swiftui-view-refactor/SKILL.md
plugins/build-macos-apps/skills/appkit-interop/SKILL.md
plugins/build-macos-apps/skills/build-run-debug/SKILL.md
plugins/build-macos-apps/skills/liquid-glass/SKILL.md
plugins/build-macos-apps/skills/packaging-notarization/SKILL.md
plugins/build-macos-apps/skills/signing-entitlements/SKILL.md
plugins/build-macos-apps/skills/swiftpm-macos/SKILL.md
plugins/build-macos-apps/skills/swiftui-patterns/SKILL.md
plugins/build-macos-apps/skills/telemetry/SKILL.md
plugins/build-macos-apps/skills/test-triage/SKILL.md
plugins/build-macos-apps/skills/view-refactor/SKILL.md
plugins/build-macos-apps/skills/window-management/SKILL.md
plugins/build-web-apps/skills/frontend-app-builder/SKILL.md
plugins/build-web-apps/skills/frontend-testing-debugging/SKILL.md
plugins/build-web-apps/skills/react-best-practices/SKILL.md
plugins/build-web-apps/skills/shadcn-best-practices/SKILL.md
plugins/build-web-apps/skills/supabase-best-practices/SKILL.md
plugins/build-web-data-visualization/skills/accessibility-and-inclusive-visualization/SKILL.md
plugins/build-web-data-visualization/skills/canvas2d-data-visualization/SKILL.md
plugins/build-web-data-visualization/skills/d3-data-visualization/SKILL.md
plugins/build-web-data-visualization/skills/dashboards-and-real-time-visualization/SKILL.md
plugins/build-web-data-visualization/skills/data-visualization/SKILL.md
plugins/build-web-data-visualization/skills/gantt-chart-visualization/SKILL.md

Metadata

Files
0
Version
11c74d6
Hash
f09a1e78
Indexed
2026-07-19 09:28

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-03 22:16
浙ICP备14020137号-1 $bản đồ khách truy cập$