$npx -y skills add Livsy90/iOS-Performance-Agent-Skills --skill ios-performance-profilingUse this skill when choosing, running, or interpreting iOS performance profiling workflows, including Instruments traces, signposts, XCTest metrics, MetricKit, Xcode Organizer, hangs, hitches, CPU, allocations, memory graphs, disk I/O, networking, power, or production performance
| 1 | # iOS Performance Profiling |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | Use this skill to choose the right profiling workflow, gather evidence, interpret performance signals, and recommend validation before claiming that an optimization worked. |
| 6 | |
| 7 | This skill is a profiling router and evidence workflow. It should not replace more specific skills for launch performance, SwiftUI performance, Swift Concurrency performance, perceived performance, or Swift runtime costs. |
| 8 | |
| 9 | ## When to use this skill |
| 10 | |
| 11 | Use this skill when the task involves: |
| 12 | |
| 13 | - choosing an Instruments template or profiling workflow; |
| 14 | - interpreting traces, screenshots, XCTest metrics, MetricKit payloads, Organizer data, logs, or signposts; |
| 15 | - diagnosing hangs, animation hitches, CPU spikes, memory growth, leaks, disk I/O, network latency, power usage, or production regressions; |
| 16 | - designing a before/after measurement plan; |
| 17 | - adding signposts or performance tests; |
| 18 | - checking whether a proposed optimization is supported by evidence. |
| 19 | |
| 20 | ## When not to use this skill |
| 21 | |
| 22 | Do not use this skill as the primary skill for: |
| 23 | |
| 24 | - app startup architecture or launch-critical work unless the task asks how to profile, measure, or verify launch performance; |
| 25 | - SwiftUI invalidation, identity, layout, or scrolling fixes unless the task asks which profiling evidence to collect; |
| 26 | - Swift Concurrency design or actor isolation unless the task asks how to profile task behavior, actor hopping, or executor-related latency; |
| 27 | - perceived performance, loading states, skeletons, optimistic UI, or feedback design unless the task asks how to validate perceived latency; |
| 28 | - Swift runtime, ARC, allocation, existential, generic, dispatch, or linking costs unless the task asks how to measure them. |
| 29 | |
| 30 | Prefer the more specific skill when the user already knows the domain and needs a fix rather than a measurement workflow. |
| 31 | |
| 32 | ## Core principle |
| 33 | |
| 34 | Evidence before optimization. |
| 35 | |
| 36 | Use this loop: |
| 37 | |
| 38 | ```text |
| 39 | Symptom -> reproducible scenario -> correct tool -> trace or metric -> hypothesis -> focused fix -> re-measure |
| 40 | ``` |
| 41 | |
| 42 | Do not claim that a change improved performance unless there is a validation path. If evidence is missing, say what is not proven yet and what should be measured next. |
| 43 | |
| 44 | ## Capability check |
| 45 | |
| 46 | Before recommending or running a real profiling workflow, check what is actually available. |
| 47 | |
| 48 | Ask or infer: |
| 49 | |
| 50 | - Is there a buildable Xcode project, workspace, scheme, and target? |
| 51 | - Is profiling possible on a real device, or only in Simulator? |
| 52 | - Is a Release or release-like configuration available? |
| 53 | - Is the scenario reproducible with stable data and stable app state? |
| 54 | - Are Instruments traces, screenshots, MetricKit payloads, Organizer screenshots, logs, or XCTest results available? |
| 55 | - Can traces or reports be shared as artifacts? |
| 56 | - Is the task asking for a profiling plan, a code review, or interpretation of existing evidence? |
| 57 | |
| 58 | If tooling or artifacts are unavailable, provide a measurement plan instead of pretending to have profiled the app. |
| 59 | |
| 60 | ## Measurement baseline |
| 61 | |
| 62 | Prefer profiling with: |
| 63 | |
| 64 | - real device over Simulator for UI, launch, power, memory pressure, thermal behavior, and production-like responsiveness; |
| 65 | - Release or release-like builds over Debug builds; |
| 66 | - repeated runs over a single measurement; |
| 67 | - stable input data and deterministic scenarios; |
| 68 | - device and OS information included in the report; |
| 69 | - signposts around app-specific operations when system-level traces are too broad. |
| 70 | |
| 71 | Use Simulator only when the question is about relative local investigation and the limitation is clearly stated. |
| 72 | |
| 73 | ## Tool selection |
| 74 | |
| 75 | Choose the tool from the symptom, not from a favorite workflow. |
| 76 | |
| 77 | | Symptom or question | Primary tool | Secondary signal | |
| 78 | |---|---|---| |
| 79 | | Cold launch, warm launch, first frame, first interaction | App Launch, Time Profiler, XCTest launch metrics | MetricKit, Organizer, signposts | |
| 80 | | Main-thread hang or freeze | Hangs, Time Profiler | Main Thread Checker, signposts | |
| 81 | | Animation hitch, scrolling hitch, dropped frames | Animation Hitches, Core Animation, Time Profiler | SwiftUI Instrument, signposts | |
| 82 | | SwiftUI repeated updates or broad invalidation | SwiftUI Instrument | Time Profiler, signposts | |
| 83 | | CPU spike or slow operation | Time Profiler | Counters, signposts, XCTest metrics | |
| 84 | | Memory growth, high allocations, churn | Allocations, VM Tracker | Memory Graph, Leaks, XCTest memory metric | |
| 85 | | Retain cycle or logical leak | Memory Graph Debugger | Allocations generation analysis | |
| 86 | | D |