New to Claude Skills? Learn how to install them →

software-mansion on GitHub

React Native Optimization

Free

Optimize your React Native app's performance effectively.

Get this skill

Free · Opens the source repo

What React Native Optimization does

The React Native Optimization skill is designed to help developers improve the performance of their React Native applications by systematically identifying and addressing bottlenecks. This skill emphasizes a methodical approach to optimization, starting with profiling to pinpoint real issues before applying fixes. The process begins with a quick scan using react-profiler-renders, which provides a live render count table to quickly identify hot components that may be causing performance issues. For deeper analysis, developers can leverage the argent-react-native-profiler skill to perform comprehensive profiling, allowing for detailed insights into component behavior and rendering costs.

The optimization process is broken down into four key phases. Phase 1 involves a lint sweep to catch deterministic issues without running the app, while Phase 2 focuses on a semantic sweep that requires judgment on areas such as memoization and state management. Phase 3 is where the real profiling occurs, allowing developers to analyze user flows and identify the highest-impact issues. Finally, Phase 4 ensures that no regressions have been introduced by validating that all screens render correctly and without errors.

This skill is particularly useful for developers who are looking to enhance the performance of existing applications, especially when users report sluggishness or when there is a need to optimize re-renders and reduce jank. By following the outlined phases and leveraging the profiling tools, developers can make informed decisions about which optimizations to pursue, ensuring that their efforts lead to tangible improvements in app performance.

When to use it

Use this skill when your app feels slow, users request optimizations, or you need to fix excessive re-renders and improve startup times.

When not to use it

This skill may not be suitable for applications that are already performing well or for developers who are unfamiliar with React Native profiling tools.

What you can build with it

Identifying Slow Components

Use the quick scan feature to pinpoint components that render too frequently, allowing for targeted optimization.

Conducting a Performance Audit

Perform a full profiling session to analyze user flows and discover hidden performance issues that static analysis might miss.

Validating Fixes

After applying optimizations, use the verification phase to ensure that changes did not introduce new errors or regressions.

How to install React Native Optimization

View source

1. Install with the skills CLI

npx skills add software-mansion/argent/argent-react-native-optimization --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by software-mansion

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 (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

  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.

Frequently asked questions about React Native Optimization

Similar skills