argent-react-native-optimization
software-mansion/argent
Profile React Native apps to find real bottlenecks, then fix mechanical issues systematically.
What is argent-react-native-optimization?
Entry point for React Native performance optimization. Guides you through profiling to identify actual bottlenecks, then applies fixes methodically—lint sweep, semantic review, profiling, and regression verification. Use when the app feels slow, has excessive re-renders, jank, or slow startup.
- Quick render profiling with react-profiler-renders to identify hot components
- Deep measurement workflow: start profiler, interact with app, analyze results
- Inspection tools to trace component ancestry and render costs
- Systematic fix-and-verify cycle: apply one fix, re-profile, check for regressions
- Lint sweep for deterministic mechanical issues (inline styles, missing keys)
- Semantic checklist for judgment calls (memoization, list rendering, animations, context)
How to install argent-react-native-optimization
npx skills add https://github.com/software-mansion/argent --skill argent-react-native-optimization- React Native project with a running app or simulator
- argent-react-native-profiler skill (delegated to for measurement)
- Device or simulator connected for profiling and interaction
How to use argent-react-native-optimization
- 1.Run Phase 1 lint sweep at project root with ESLint performance ruleset; dispatch sub-agents to fix per-file results
- 2.Execute Phase 2 semantic sweep using the provided checklist (memoization, lists, animations, async patterns); one sub-agent per item
- 3.Load argent-react-native-profiler, start dual profiling, exercise key user flows, then analyze with react-profiler-analyze and native-profiler-analyze
- 4.Identify top offender from profiling results; apply one fix, validate with debugger-evaluate, then re-profile to confirm improvement
- 5.Navigate all screens to verify no regressions (crashes, errors, red screens); check debugger-log-registry for runtime errors
- 6.Run lint again after all fixes to ensure no new issues were introduced
Use cases
- User reports the app feels sluggish; profile to find which screens or components are slow
- Fix excessive re-renders in a specific screen by profiling, identifying hot components, then applying targeted memoization
- Optimize startup time by profiling app initialization and reducing work on critical path
- Batch fix mechanical issues (missing keys, inline styles) after lint sweep
- Verify no regressions after applying performance fixes across multiple screens
- React Native developers optimizing app performance
- Teams addressing user-reported slowness or jank
- Developers working on startup time or memory usage
- Anyone building performance-sensitive mobile apps
argent-react-native-optimization FAQ
No. The skill enforces measure-first discipline: profile to define a target metric and threshold, identify the top offender, fix it, then re-measure. Shotgun optimizations waste effort and risk regressions.
Mechanical batch fixes (inline styles, missing keys) can be grouped and re-profiled once. Architectural changes require one fix per cycle and re-profiling after each to isolate impact.
Do not propose useCallback, useMemo, or React.memo unless you confirm compiler bail-out via react-profiler-fiber-tree (look for absent useMemoCache). The compiler handles memoization automatically in most cases.
After applying a fix, re-profile the same user flow. Check that the target metric improved and scan other metrics for regressions (CPU, memory, jank in other screens). Use debugger-log-registry to check for new runtime errors.
Use argent-create-flow skill to repair the flow rather than discarding it. This ensures subsequent optimization cycles replay identical steps.
Full instructions (SKILL.md)
Source of truth, from software-mansion/argent.
name: argent-react-native-optimization description: Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup. Delegates to argent-react-native-profiler for measurement.
Rules
- Do not apply shotgun optimizations. Measure first, define what "good enough" looks like (target metric + threshold), fix the top offender, re-measure honestly.
- Quick scan —
react-profiler-rendersfor a live render count table. Identifies hot components instantly. - Deep measure — load
argent-react-native-profilerskill.react-profiler-start→ interact →react-profiler-stop→react-profiler-analyze. - Inspect —
react-profiler-component-sourceper finding.react-profiler-fiber-treeto trace component ancestry and render cost. - Verify correctness - before fixing, recollect information from steps above and make a logical conclusion whether the approach is worth undertaking.
- Fix — apply one fix. Validate with
debugger-evaluatebefore committing. - Re-measure — report whether the target metric improved, regressed, or stayed flat. Check for regressions in other areas. If no net benefit or unacceptable tradeoffs, revert.
- Profile for discovery, not only verification. Use the profiler to find issues static analysis missed, not only to confirm fixes.
- One fix per cycle for architectural changes. Mechanical batch fixes (inline styles, index keys) can be grouped — re-profile once after the batch. When the measurement involves device interaction, record it as a flow (
argent-create-flowskill) before the first run so all subsequent cycles replay identical steps. - React Compiler: if
react-profiler-analyzereportsreactCompilerEnabled: true, do NOT proposeuseCallback/useMemo/React.memounless you confirmed compiler bail-out viareact-profiler-fiber-tree(absentuseMemoCache). - Sub-agents: Phases 1–2 dispatch sub-agents — one per file for lint results, one per checklist item for semantic. Sub-agents CANNOT touch the device - all profiling and E2E verification must happen in the main agent.
Pipeline
Lint and semantic sweeps catch deterministic issues cheaply. Profiling finds runtime bottlenecks that static analysis misses. Do both.
Copy this checklist into your TODO list:
Optimization Progress:
- [ ] Phase 1: Lint sweep (deterministic — catch mechanical issues without a running app)
- [ ] Phase 2: Semantic sweep (judgment — memoization, lists, animations, etc.)
- [ ] Phase 3: Baseline profile (find real bottlenecks, fix top offenders)
- [ ] Phase 4: Verify no regressions (crashes, errors, red screens)
Phase 1: Lint sweep
Run ESLint once at the project root with a comprehensive RN performance ruleset. Dispatch sub-agents to fix results — one per file. See references/lint-rules.md for ruleset and procedure.
Phase 2: Semantic sweep
Review each area requiring judgment — memoization, list rendering, animations, async patterns, effect cleanup, state hygiene, context architecture. Dispatch one sub-agent per checklist item. See references/semantic-checklist.md for full checklist.
Phase 3: Visual profiling
- Load
argent-react-native-profilerskill, start dual profiling - Exercise key user flows (navigate screens the user specified, or all major flows)
- Analyze with
react-profiler-analyze+native-profiler-analyze+profiler-combined-report - Cross-reference profiling results with Phase 1–2 findings
- Fix highest-impact issues. Re-profile after architectural changes; batch mechanical fixes. If a recorded flow breaks after a fix (e.g., UI layout changed), follow
argent-create-flowskill to repair the flow rather than silently discarding it.
Phase 4: Verify no regressions
Navigate every screen and UI flow within scope, confirm each renders without errors. If no scope was specified, verify the entire app — cover all reachable screens via argent-device-interact. Use debugger-log-registry to check for runtime errors (if it returns status: "not_connected" there is no log file — follow its guidance to reconnect first) and take screenshots to check for red/yellow error screens. Check for regressions introduced by fixes (e.g., fewer re-renders but higher CPU, or new jank in a different screen). Main agent only.
App-wide optimization
- Phase 1: run lint centrally (one command), dispatch sub-agents to fix per-file in parallel
- Phase 2: one sub-agent per checklist item for semantic sweep
- Phase 3: main agent profiles top offending screens; fixes architectural issues top-down
- Phase 4: main agent navigates all screens to verify nothing crashes
After the entire run, run lint again to verify no new issues were introduced with your changes. This also helps ensure you haven't missed any issues which could've been fixed.
Related skills
More from software-mansion/argent and the wider catalog.

argent-react-native-profiler
Profile React Native Hermes apps to measure re-render and CPU performance with ranked issue reports.

argent-screen-recording
Record video of iOS simulator or Android device screens with touch visualization and automatic static-frame trimming.

argent-screenshot-diff
Compare app screenshots to detect visual regressions and UI changes pixel-by-pixel.

argent-settings-permissions
Control iOS and Android app permissions directly without navigating Settings—for test setup when the app can't change them itself.

argent-test-ui-flow
Autonomously test iOS/Android app UI flows with interact-screenshot-verify loops using argent MCP tools.

argent-tv-interact
Control Apple TV, Android TV, and Fire TV apps via focus-driven remote navigation and debugging.