Agent skill

Argent Native Profiler

by bbplayer-app in bbplayer-app/BBPlayer

Native profiling for CPU hotspots, UI hangs, memory issues. An agent skill from bbplayer-app/BBPlayer.

MITAuto-check passedDevelopment

Install Argent Native Profiler

skills CLI
$ npx skills add bbplayer-app/BBPlayer --skill argent-native-profiler -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bbplayer-app/BBPlayer argent-native-profiler --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bbplayer-app/BBPlayer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/argent-native-profiler .claude/skills/argent-native-profiler && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
argent-native-profiler
GitHub stars
1.1k
Token cost
~2k tokens
SKILL.md length
1,040 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Native profiling for CPU hotspots, UI hangs, memory issues. An agent skill from bbplayer-app/BBPlayer.

  • Works in 6 steps: Tools → Platform Support → Investigation Patterns → …
  • Diagnosing native-level performance issues
  • SKILL.md covers 1. Tools, 2. Platform Support, 3. Investigation Patterns and 4. Workflow, plus 2 more sections
  • Calls adb and xcrun

What it does

Argent Native Profiler is an agent skill from bbplayer-app/BBPlayer. Native profiling for CPU hotspots, UI hangs, memory issues. iOS via xctrace; Android via Perfetto. Use when diagnosing native-level performance issues.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Performance optimization. It works with iOS and Android. The repository describes itself as: 一款简约、好用的 BiliBili 音乐播放器。 The licence is MIT.

When your agent uses it

  • Diagnosing native-level performance issues
  • Tasks that involve Performance optimization

Example prompts

  • “/argent-native-profiler”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Tools
  2. Platform Support
  3. Investigation Patterns
  4. Workflow
  5. Understanding Results
  6. Important Caveats

What it can do on your machine

Read from SKILL.md and the folder at commit 1e1ae9f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • adb
    • xcrun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Argent Native Profiler loads about 2k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 1,040 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bbplayer-app/BBPlayer at commit 1e1ae9f, republished under its MIT licence (© bbplayer-app). 1,040 words, ~2,000 tokens.

Download SKILL.mdSave it as .claude/skills/argent-native-profiler/SKILL.md (or your agent's skills folder).
name
argent-native-profiler
description
Native profiling for CPU hotspots, UI hangs, memory issues. iOS via xctrace; Android via Perfetto. Use when diagnosing native-level performance issues.

1. Tools

  • native-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.
  • Physical iPhone: not supported; use a simulator.

2. Platform Support

  • iOS: Backend: Xcode Instruments via xctrace on a booted simulator or connected device. Requires Xcode command-line tools on PATH. Surfaces CPU hotspots, UI hangs, and memory leaks (instruments Leaks table).
  • Android: Backend: Perfetto via adb shell perfetto + an in-process WASM trace-processor engine. Surfaces CPU hotspots and UI hangs, with per-hang jank reason codes, a main-thread state breakdown with blocked_function attribution, and a GC overlap annotation. Also reports an RSS-growth signal for memory pressure; treat it as a hint to confirm manually, not a confirmed leak. The target app must be debuggable or include <profileable android:shell="true"/> in its manifest for perf_sample callstacks to be captured.

3. Investigation Patterns

After native-profiler-analyze surfaces findings, use profiler-stack-query to drill into root causes:

  • Hang detected → profiler-stack-query mode=hang_stacks for full native call chains → mode=function_callers for the suspected function → read native source.
  • CPU hotspot → profiler-stack-query mode=thread_breakdown for per-thread distribution → mode=function_callers for the dominant function.
  • Memory leak → profiler-stack-query mode=leak_stacks filtered by object_type for responsible frames and libraries.
    • iOS: if leaks come back unattributed (responsible frame <Call stack limit reached>), re-run native-profiler-start with malloc_stack_logging: true. This cold-launches the app with Malloc Stack Logging so leaks carry a real allocation backtrace (responsible frame + library). It restarts the app and adds overhead, so use it only when you need leak attribution — not for CPU/hang passes.

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-profiler instructs to start native profiling automatically alongside React profiling. This skill's workflow and investigation patterns apply in both cases.


4. Workflow

Complete all steps in order — do not break mid-flow.

Step 0: Ensure the target app is running

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.

  1. If the app is already running on the device, skip to Step 1 (do not pass app_process).
  2. If the app is not running, use launch-app with the correct bundle ID first.
  3. Only pass 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.

Step 1: Start recording

Call native-profiler-start with device_id (iOS UDID or Android serial). 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).

Step 2: Stop and export

Call native-profiler-stop with device_id. iOS sends SIGINT to xctrace, waits for trace packaging, and exports CPU, hangs, and leaks data to XML — check exportDiagnostics for any export warnings. Android sends SIGTERM to the on-device perfetto daemon, polls /proc/<pid> until it exits, then adb pulls the .pftrace to the host.

Show full SKILL.md (424 more words)Show less
Step 3: Analyze

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.

Step 4: Present findings and ask about next steps

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.

Step 5: Drill-down investigation

Use profiler-stack-query to investigate specific findings. See §3 Investigation Patterns for chaining guidance.

Step 6: Reload previous sessions

To revisit a previous trace:

  1. Call profiler-load mode=list to see available sessions.
  2. Call profiler-load mode=load_native session_id=<timestamp> device_id=<UDID> to re-parse the XML files.
  3. Use profiler-stack-query to investigate the reloaded data.

5. Understanding Results

Bottlenecks are categorized by severity:

  • RED: CPU functions taking >15% of total time, all UI hangs, and attributed memory leaks (those with a resolved responsible frame). These require immediate attention.
  • YELLOW: CPU functions taking 3-15% of total time, and unattributed memory leaks (<Call stack limit reached>, no library — see the memory-leaks caveat below). Worth investigating but may be acceptable.

Each bottleneck type indicates a different class of problem:

  • CPU hotspots: Native functions consuming excessive CPU time. Look for tight loops, expensive computations, or redundant work.
  • UI hangs: Main thread blocked long enough to cause visible jank or unresponsiveness. Often caused by synchronous I/O, heavy layout passes, or lock contention.
  • Memory leaks: Objects allocated but never freed. Common causes include retain cycles, unclosed resources, or forgotten observers. Argent records via xctrace --attach, which has no malloc-stack history, so on the simulator most leaks come back unattributed (<Call stack limit reached>, no library) and are dominated by benign system allocations — these are reported as a low-confidence YELLOW summary, not confirmed RED leaks. For attributed stacks, capture with malloc stack logging enabled at launch.

6. Important Caveats

  • Simulator vs device: Simulator profiling reflects host Mac performance, not real device hardware. Use device profiling for accurate CPU timings and memory behavior.
  • xctrace availability (iOS): Requires Xcode command-line tools installed. Verify with xcrun xctrace version.
  • Profiler overhead: xctrace instrumentation adds CPU load. If 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.
  • Run-to-run variance: Small fluctuations in CPU percentages between runs are normal. Treat only consistent directional changes (across 2+ runs or >15% delta) as actionable signal.
  • Live data variability: If the app fetches live API data, different responses between runs change rendering workload independently of code changes. Note when data-dependent screens show variance.

© bbplayer-app, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/argent-native-profiler of bbplayer-app/BBPlayer.

Open the folder on GitHubat commit 1e1ae9f

Compare with similar skills

Argent Native Profiler next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Argent Native Profiler compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Argent Native Profiler this skillbbplayer-app/BBPlayer1.1k—~2kAutomated safety check: PassMIT
Mobile App Debuggingsecondsky/claude-skills227—~513Automated safety check: PassMIT
Xamarin Forms Migrationdavidortinau/maui-skills174—~1.8kAutomated safety check: PassMIT
jscpd Code Migration Trackerkucherenko/jscpd6.3k—~5kAutomated safety check: PassMIT
Code Guidelinesgetsentry/sentry-react-native1.8k—~3.2kAutomated safety check: PassMIT
DiagnoseCherryHQ/cherry-studio-app4k—~1.8kAutomated safety check: PassAGPL-3.0

Similar skills

  • Mobile App Debugging

    secondsky/claude-skills

    Mobile app debugging for iOS, Android, cross-platform frameworks.

    227 GitHub stars~513 tokensUpdated 9 days ago
    MobileAuto-check passed
  • Xamarin Forms Migration

    davidortinau/maui-skills

    WORKFLOW SKILL - Guide for migrating Xamarin.Forms apps to .NET MAUI.

    174 GitHub stars~1.8k tokensUpdated 3 mo ago
    MobileAuto-check passed
  • Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.

    6.3k GitHub stars~5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Code Guidelines

    getsentry/sentry-react-native

    Official

    Enforce Sentry React Native SDK code guidelines for implementation, refactoring, and review.

    1.8k GitHub stars~3.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Diagnose

    CherryHQ/cherry-studio-app

    Opt-in evidence-first causal diagnosis for bugs, browser or app/device failures, flaky behavior, and performance regressions.

    4k GitHub stars~1.8k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Design First

    getsentry/sentry-react-native

    Official

    Shape non-trivial work before writing it — decide the modules, the seams, and the public API surface up front.

    1.8k GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed

More from bbplayer-app/BBPlayer

All 19 skills in this repo
  • Expo Module

    bbplayer-app/BBPlayer

    Guide for creating and writing Expo native modules and views using the Expo Modules API (Swift, Kotlin, TypeScript).

    1.1k GitHub starsUsed in 3 repos~1.4k tokens
    Auto-check passed
  • Argent Metro Debugger

    bbplayer-app/BBPlayer

    Debug a JS runtime via CDP using argent debugger tools. An agent skill from bbplayer-app/BBPlayer.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues.

    1.1k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Argent Lens

    bbplayer-app/BBPlayer

    Propose multiple visual design variants for on-screen elements and let the human pick in the Argent Lens window.

    1.1k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Argent QA Flows

    bbplayer-app/BBPlayer

    Create repeatable QA regression E2E tests as Argent flows from test cases, tickets, or acceptance criteria.

    1.1k GitHub stars~3.2k tokensUpdated yesterday
    Auto-check passed
  • Argent Screenshot Diff

    bbplayer-app/BBPlayer

    Compare saved or live app screenshots with the argent screenshot-diff tool.

    1.1k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Argent Native Profiler

What does Argent Native Profiler do?

Native profiling for CPU hotspots, UI hangs, memory issues. An agent skill from bbplayer-app/BBPlayer. Argent Native Profiler is an agent skill from bbplayer-app/BBPlayer. Native profiling for CPU hotspots, UI hangs, memory issues.

When should I use Argent Native Profiler?

Argent Native Profiler fits situations like: diagnosing native-level performance issues; tasks that involve Performance optimization.

How do I install Argent Native Profiler in Claude Code?

Run `npx skills add bbplayer-app/BBPlayer --skill argent-native-profiler -a claude-code`. Or copy the skill folder (.agents/skills/argent-native-profiler in bbplayer-app/BBPlayer) into .claude/skills/argent-native-profiler in your project. Claude Code loads it when a task matches its description.

How do I install Argent Native Profiler in Codex?

Run `npx skills add bbplayer-app/BBPlayer --skill argent-native-profiler -a codex`. Or copy the skill folder (.agents/skills/argent-native-profiler in bbplayer-app/BBPlayer) into .agents/skills/argent-native-profiler in your project. Codex loads it when a task matches its description.

Can I use Argent Native Profiler in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bbplayer-app/BBPlayer --skill argent-native-profiler -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/argent-native-profiler, .gemini/skills/argent-native-profiler, .github/skills/argent-native-profiler and .opencode/skills/argent-native-profiler in your project.

What does Argent Native Profiler need to run?

Going by SKILL.md and its folder, Argent Native Profiler needs the command-line tools its instructions call (adb and xcrun).

Does Argent Native Profiler access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Argent Native Profiler safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Argent Native Profiler use?

Argent Native Profiler is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Argent Native Profiler use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Argent Native Profiler?

Skills that share tags, products or a category with Argent Native Profiler: Mobile App Debugging (secondsky/claude-skills, 227 stars), Xamarin Forms Migration (davidortinau/maui-skills, 174 stars), jscpd Code Migration Tracker (kucherenko/jscpd, 6.3k stars) and Code Guidelines (getsentry/sentry-react-native, 1.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Argent Native Profiler?

bbplayer-app (a GitHub organization) maintains it in bbplayer-app/BBPlayer, which has 1,126 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 6, 2026.

Source: bbplayer-app/BBPlayer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.