Native profiling for CPU hotspots, UI hangs, and memory leaks. Currently iOS-only (xctrace-backed); Android support (Perfetto/simpleperf) is on the roadmap. Use when diagnosing native-level performance issues.
64
75%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/argent-native-profiler/SKILL.mdnative-profiler-start — start profiling on a booted device. iOS: xctrace recording for CPU, hangs, and leaks.native-profiler-stop — stop the profiler and export trace data to timestamped XML files.native-profiler-analyze — parse exported trace data and return a structured bottleneck payload.profiler-stack-query — drill into parsed data: hang stacks, function callers, thread breakdown, leak details.profiler-load — list and reload previous trace sessions from disk for re-investigation.xctrace on a booted simulator or connected device. Requires Xcode command-line tools on PATH.adb) is planned; today native-profiler-start rejects Android serials with a clear "iOS-only for now" error.After native-profiler-analyze surfaces findings, use profiler-stack-query to drill into root causes:
profiler-stack-query mode=hang_stacks for full native call chains → mode=function_callers for the suspected function → read native source.profiler-stack-query mode=thread_breakdown for per-thread distribution → mode=function_callers for the dominant function.profiler-stack-query mode=leak_stacks filtered by object_type for responsible frames and libraries.After presenting findings, ask the user whether to investigate further, implement fixes, or stop. After applying fixes, always re-profile the same scenario and compare with profiler-load. Report honestly whether the target metric improved, regressed, or stayed flat. If the fix showed no net benefit or introduced regressions elsewhere, say so and reconsider.
Tip: For reproducible before/after comparisons, record the interaction sequence as a flow using the argent-create-flow skill before the first profiling run. Replay with flow-execute on subsequent runs to eliminate interaction variance.
Note: The
argent-react-native-profilerinstructs to start native profiling automatically alongside React profiling. This skill's workflow and investigation patterns apply in both cases.
Complete all steps in order — do not break mid-flow.
The native-profiler-start tool auto-detects the running app on the device.
You do not need to derive app_process manually — just make sure the app is launched.
app_process).launch-app with the correct bundle ID first.app_process explicitly if the tool reports multiple running user apps and you need to disambiguate.Note: If multiple build flavors are installed (dev, staging, prod), the tool will detect whichever one is currently running. If both are running, it will ask you to specify.
Call native-profiler-start with device_id (iOS UDID; Android not yet supported). The tool auto-detects the running app and saves the trace to /tmp/argent-profiler-cwd/ with a timestamped filename.
Let the user interact with the app or drive interaction via simulator tools (see argent-device-interact skill).
Call native-profiler-stop with device_id. On iOS this sends SIGINT to xctrace, waits for trace packaging, and exports CPU, hangs, and leaks data to XML. Check exportDiagnostics in the response for any export warnings.
Call native-profiler-analyze with device_id. Returns a markdown report with bottlenecks categorized as CPU hotspots, UI hangs, or memory leaks, sorted by severity.
Present a concise summary of the key findings. Then follow the "After analysis" guideline — ask whether to investigate further with query tools, implement fixes, or stop.
Use profiler-stack-query to investigate specific findings. See §3 Investigation Patterns for chaining guidance.
To revisit a previous trace:
profiler-load mode=list to see available sessions.profiler-load mode=load_native session_id=<timestamp> device_id=<UDID> to re-parse the XML files.profiler-stack-query to investigate the reloaded data.Bottlenecks are categorized by severity:
Each bottleneck type indicates a different class of problem:
xcrun xctrace version.JSLexer, JSONEmitter, or Hermes runtime internals dominate the JS thread in CPU hotspot results, those reflect profiler overhead — not app work. Discount those entries when evaluating findings.da6d36f
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.