PluginBench
Skill
Pass
Audit score 90

argent-react-native-optimization

software-mansion/argent

Profile first, then fix React Native performance bottlenecks systematically without shotgun optimizations.

What is argent-react-native-optimization?

Entry-point skill for React Native app optimization. Profiles to identify real bottlenecks, then applies targeted fixes in phases: lint sweep, semantic review, profiling & fixes, and regression verification. Use when the app feels slow, has excessive re-renders, jank, or slow startup.

  • Quick scan for hot components with react-profiler-renders
  • Deep measurement via argent-react-native-profiler integration
  • Lint sweep to catch mechanical issues (missing keys, inline styles, etc.)
  • Semantic review of memoization, list rendering, animations, and state patterns
  • One-fix-per-cycle validation with re-profiling to confirm improvements
  • Regression detection across device interaction and UI flows

How to install argent-react-native-optimization

npx skills add https://github.com/software-mansion/argent --skill argent-react-native-optimization
Prerequisites
  • React Native project with a running app or emulator/device
  • argent-react-native-profiler skill (delegated to for deep measurement)
  • ESLint configured for React Native performance rules
Claude Code
Cursor
Windsurf
Cline

How to use argent-react-native-optimization

  1. 1.Run Phase 1 lint sweep at project root to catch mechanical issues
  2. 2.Dispatch sub-agents to fix lint results per file
  3. 3.Run Phase 2 semantic sweep using the provided checklist (memoization, lists, animations, state)
  4. 4.Load argent-react-native-profiler and exercise key user flows while profiling
  5. 5.Analyze profiler output with react-profiler-analyze and native-profiler-analyze
  6. 6.Fix the highest-impact issue, re-profile to confirm improvement
  7. 7.Repeat profiling and fixing until no net benefit or acceptable tradeoffs reached
  8. 8.Run Phase 4 regression verification: navigate all screens to confirm no crashes or new jank

Use cases

Good for
  • Optimize a slow-feeling React Native app by profiling key user flows first
  • Fix excessive component re-renders identified in profiler output
  • Reduce jank and improve frame rate during animations or list scrolling
  • Improve app startup time by measuring and fixing initialization bottlenecks
  • Verify performance fixes don't introduce regressions in other screens
Who it's for
  • React Native developers optimizing app performance
  • Teams addressing user-reported slowness or jank
  • Engineers fixing re-render issues or startup delays
  • Developers verifying performance improvements are real, not assumed

argent-react-native-optimization FAQ

Should I apply multiple optimizations at once?

No. Apply one architectural fix per cycle and re-profile to confirm improvement. Mechanical batch fixes (inline styles, index keys) can be grouped, then re-profiled once. Always measure before and after.

When should I use useCallback, useMemo, or React.memo?

Only if the profiler confirms they help. If React Compiler is enabled (reactCompilerEnabled: true), do not propose these unless you confirmed compiler bail-out via react-profiler-fiber-tree.

What if re-profiling shows no improvement or a regression?

Revert the change. Profiling is for discovery—use it to find issues static analysis missed, not only to confirm fixes. If a flow breaks after a fix, repair it with argent-create-flow rather than discarding it.

Can sub-agents run profiling and device interaction?

No. Sub-agents handle lint and semantic fixes only. All profiling, E2E verification, and device interaction must happen in the main agent.

How do I know when optimization is done?

When the target metric (e.g., frame rate, startup time) meets your threshold, and re-profiling shows no regressions in other areas. Run lint again at the end to confirm no new issues were introduced.

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 scanreact-profiler-renders for a live render count table. Identifies hot components instantly.
  • Deep measure — load argent-react-native-profiler skill. react-profiler-start → interact → react-profiler-stopreact-profiler-analyze.
  • Inspectreact-profiler-component-source per finding. react-profiler-fiber-tree to 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-evaluate before 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-flow skill) before the first run so all subsequent cycles replay identical steps.
  • React Compiler: if react-profiler-analyze reports reactCompilerEnabled: true, do NOT propose useCallback/useMemo/React.memo unless you confirmed compiler bail-out via react-profiler-fiber-tree (absent useMemoCache).
  • 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

  1. Load argent-react-native-profiler skill, start dual profiling
  2. Exercise key user flows (navigate screens the user specified, or all major flows)
  3. Analyze with react-profiler-analyze + native-profiler-analyze + profiler-combined-report
  4. Cross-reference profiling results with Phase 1–2 findings
  5. 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-flow skill 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 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

  1. Phase 1: run lint centrally (one command), dispatch sub-agents to fix per-file in parallel
  2. Phase 2: one sub-agent per checklist item for semantic sweep
  3. Phase 3: main agent profiles top offending screens; fixes architectural issues top-down
  4. 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.