Back to list
nguyenthienthanh

performance-optimizer

by nguyenthienthanh

Aura Frog — AI-powered structured development plugin for Claude Code Turn Claude Code into a full-fledged dev platform: Aura Frog brings 24 specialized agents, a 9-phase TDD workflow, built-in quality gates and 70+ commands so your team doesn’t need to manually draft prompts — just call the right command and follow guided instructions.

3🍴 2📅 Jan 22, 2026

SKILL.md


name: performance-optimizer description: "Identify and resolve performance bottlenecks through profiling, measurement, and targeted optimization." autoInvoke: false priority: medium triggers:

  • "performance optimization"
  • "slow"
  • "bottleneck"

Skill: Performance Optimizer

Category: Dev Expert Version: 1.0.0 Used By: All development agents


Overview

Identify and resolve performance bottlenecks through profiling, measurement, and targeted optimization.


1. Performance Optimization Rules

1. Measure first, optimize second
2. Optimize the bottleneck, not everything
3. 80/20 rule: 80% of slowness is in 20% of code
4. Premature optimization is the root of all evil

2. Profiling Strategy

LayerToolsMetrics
FrontendLighthouse, DevToolsFCP, LCP, TTI, CLS
BackendAPM, profilersResponse time, throughput
DatabaseEXPLAIN, slow query logQuery time, index usage
MemoryHeap snapshotsAllocation, leaks

When to Profile

  • Before optimization (baseline)
  • After each change (verify improvement)
  • Production (real user data)

3. Frontend Optimization

Core Web Vitals Targets

MetricGoodDescription
LCP< 2.5sLargest Contentful Paint
FID< 100msFirst Input Delay
CLS< 0.1Cumulative Layout Shift

Quick Wins

// Lazy load images
<img loading="lazy" src="image.jpg" />

// Code splitting
const Component = lazy(() => import('./Component'))

// Debounce handlers
const handleSearch = debounce((q) => search(q), 300)

// Memoize expensive computations
const result = useMemo(() => expensiveCalc(data), [data])

Checklist

  • Images optimized (WebP, lazy loading)
  • Code split by route
  • CSS/JS minified and compressed
  • Caching headers set
  • Fonts preloaded

4. Backend Optimization

Common Bottlenecks

IssueSolution
N+1 queriesEager loading, batching
Missing indexesAdd appropriate indexes
Unbounded queriesPagination, limits
Sync blockingAsync/parallel processing
No cachingCache hot data

Quick Wins

// Batch database calls
const users = await User.findByIds(ids)  // 1 query, not N

// Add indexes
CREATE INDEX idx_users_email ON users(email)

// Cache expensive queries
const data = await cache.getOrSet('key', () => db.query(), 3600)

// Parallel async
const [users, orders] = await Promise.all([getUsers(), getOrders()])

5. Database Optimization

Query Analysis

-- Always EXPLAIN slow queries
EXPLAIN ANALYZE SELECT * FROM orders WHERE user_id = 123;

-- Look for: Seq Scan (bad), Index Scan (good)

Index Strategy

Query PatternIndex Type
Exact matchB-tree (default)
Range queriesB-tree
Full-text searchGIN/GiST
JSON fieldsGIN

Checklist

  • Indexes on WHERE/JOIN columns
  • No SELECT * (specify columns)
  • Pagination on large tables
  • Connection pooling enabled
  • Query result caching

6. Caching Strategy

Cache LevelTTLUse Case
BrowserHours-DaysStatic assets
CDNMinutes-HoursAPI responses
ApplicationSeconds-MinutesComputed data
DatabaseVariesQuery cache

Cache Invalidation

// Time-based
cache.set(key, value, { ttl: 3600 })

// Event-based
onUserUpdate(user => cache.delete(`user:${user.id}`))

// Version-based
cache.set(`data:v${version}`, value)

7. Memory Optimization

Common Leaks

CauseFix
Event listeners not removedCleanup in useEffect/destroy
Closures holding referencesNull out references
Growing arrays/mapsUse WeakMap, clear periodically
Timers not clearedclearInterval/clearTimeout

Detection

// Node.js heap snapshot
const v8 = require('v8')
v8.writeHeapSnapshot()

// Browser DevTools
// Memory tab → Take heap snapshot → Compare

8. Optimization Checklist

Before:

  • Baseline metrics captured
  • Bottleneck identified via profiling
  • Target improvement defined

After:

  • Metrics improved
  • No regressions introduced
  • Tests still pass

Best Practices

Do's

  • Measure before and after
  • Optimize biggest bottleneck first
  • Use appropriate data structures
  • Cache strategically
  • Profile in production-like env

Don'ts

  • Optimize without measuring
  • Micro-optimize everything
  • Cache without invalidation strategy
  • Ignore memory leaks
  • Sacrifice readability for speed

Version: 1.0.0 | Last Updated: 2025-11-28

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon