argent-react-native-optimization
Installation
SKILL.md
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: