performance-optimizer

Review code for performance issues and apply optimization patterns across React Native, databases, and caching layers.

2|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/Gamaroff/agent-skills --skill performance-optimizer-gamaroff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: performance-optimizer
Source: https://github.com/Gamaroff/agent-skills/tree/main/skills/performance-optimizer
Command: npx skills add https://github.com/Gamaroff/agent-skills --skill performance-optimizer-gamaroff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Slow renders, N+1 database queries, bloated bundles, and memory leaks degrade application quality, but diagnosing and fixing them requires deep knowledge of React Native internals, database indexing, and caching strategies. ## Core Features & Use Cases - React Native Optimization: Apply React.memo, useMemo, useCallback, FlatList tuning with getItemLayout, FastImage caching, and memory leak prevention for timers and listeners. - Database Optimization: Detect and eliminate N+1 queries with Prisma includes or DataLoader, design composite and partial indexes, and implement cursor-based pagination. - Bundle & Caching Strategies: Reduce bundle size with lazy loading and tree shaking, and implement React Query, Redis, and in-memory caching with proper invalidation. - Use Case: A mobile banking app renders transaction lists sluggishly. Use this Skill to memoize list items, add getItemLayout to the FlatList, index the transactions table on user_id and created_at, and cache balance lookups in Redis. ## Quick Start Ask the agent to review your transaction list screen and its database queries for performance issues and apply the recommended optimizations.

Frequently Asked Questions about performance-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize FlatList performance in React Native?▼

Optimize FlatList by providing getItemLayout for fixed-height items, setting maxToRenderPerBatch, windowSize, and initialNumToRender, and enabling removeClippedSubviews on Android. Use stable renderItem and keyExtractor callbacks via useCallback instead of inline functions.

How to fix N+1 query problems with Prisma?▼

Fix N+1 queries in Prisma by using include to fetch related records in a single query instead of looping over results with separate findMany calls. For GraphQL resolvers, use the DataLoader pattern to batch and group related queries by foreign key.

When should I use React.memo, useMemo, and useCallback?▼

Use React.memo for expensive components that re-render unnecessarily, useMemo for expensive calculations that should only recompute when dependencies change, and useCallback to keep function references stable for memoized children. Avoid memoizing trivial components where overhead exceeds benefit.

What database indexes improve query performance?▼

Create composite indexes matching common WHERE and ORDER BY clauses, such as (user_id, created_at DESC) for paginated history queries. Use partial indexes for filtered subsets like active records, and verify usage with pg_stat_user_indexes to drop unused indexes.

Why does my React Native app have memory leaks?▼

Memory leaks commonly come from uncleared setInterval timers and unremoved event listeners in useEffect hooks. Always return a cleanup function from useEffect that clears timers and removes listeners when the component unmounts.

How do I reduce React Native bundle size?▼

Reduce bundle size by lazy loading heavy screens with React.lazy and Suspense, importing specific functions or subpaths from libraries like lodash instead of the whole package, and removing unused dependencies from package.json.