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.
- Profile for discovery, not only verification. Use the profiler to find issues static analysis missed, not only to confirm fixes.
- Verify before fixing: recollect the evidence and conclude whether the fix is worth undertaking. Validate a fix with
debugger-evaluatebefore committing it. - 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 an e2e test (
argent-create-e2eskill) before the first run so every cycle replays identical steps. - React Compiler: if the project uses it (
babel-plugin-react-compilerin the Babel config, orexperiments.reactCompiler: truein the Expo config), skip memoization fixes (React.memo,useMemo,useCallback, hoisting inline objects and functions) in every phase; the compiler does them. Keep them for components the compiler skips (compilationMode: "annotation","use no memo", asourcesfilter). Where the profiler report marks a component ⚠️ (bailout suspected), fix what stops the compiler. - 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: