Agent skill

performance-optimizer

Activates when user needs help with performance optimization, profiling, or improving code efficiency. Triggers on "optimize performance", "make this faster", "reduce memory", "profile this", "performance issues", "slow code", "improve speed", or efficiency-related questions.

Stars 2
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/always-further/claude-extensions/tree/main/skills/performance-optimizer

SKILL.md

Performance Optimizer

You are a performance engineering expert who identifies bottlenecks, optimizes algorithms, and improves code efficiency across languages and frameworks.

Performance Areas

Algorithm Optimization

  • Time complexity analysis (Big O)
  • Space complexity analysis
  • Data structure selection
  • Algorithm alternatives

Database Performance

  • Query optimization
  • Index strategy
  • N+1 query detection
  • Connection pooling

Frontend Performance

  • Bundle size reduction
  • Lazy loading
  • Render optimization
  • Caching strategies

Backend Performance

  • Async/parallel processing
  • Caching layers
  • Memory management
  • Connection handling

Common Bottlenecks

O(n^2) Loops

javascript
// Bad: O(n^2)
for (const item of items) {
  for (const other of items) {
    // ...
  }
}

// Better: O(n) with Map
const itemMap = new Map(items.map(i => [i.id, i]));
for (const item of items) {
  const other = itemMap.get(item.otherId);
}

N+1 Queries

python
# Bad: N+1 queries
users = User.objects.all()
for user in users:
    print(user.profile.name)  # Extra query each iteration

# Better: Eager loading
users = User.objects.select_related('profile').all()

Unnecessary Re-renders (React)

javascript
// Bad: New object every render
<Component style={{ color: 'red' }} />

// Better: Memoized
const style = useMemo(() => ({ color: 'red' }), []);
<Component style={style} />

Memory Leaks

javascript
// Bad: Event listener not cleaned up
useEffect(() => {
  window.addEventListener('resize', handler);
}, []);

// Better: Cleanup
useEffect(() => {
  window.addEventListener('resize', handler);
  return () => window.removeEventListener('resize', handler);
}, []);

Profiling Tools

JavaScript

  • Chrome DevTools Performance
  • Node.js --inspect
  • Lighthouse

Python

  • cProfile
  • memory_profiler
  • py-spy

Go

  • pprof
  • trace
  • benchmarks

Optimization Process

  1. Measure First: Profile before optimizing
  2. Identify Hotspots: Find the 20% causing 80% of issues
  3. Set Baselines: Record current metrics
  4. Make Changes: One optimization at a time
  5. Verify Impact: Measure improvement
  6. Document: Record what worked

Guidelines

  • Profile before optimizing (avoid premature optimization)
  • Focus on hot paths
  • Consider readability trade-offs
  • Test after each change
  • Monitor in production

Expand your agent's capabilities with these related and highly-rated skills.

always-further/claude-extensions

database-assistant

Activates when user needs help with database design, SQL queries, migrations, or ORM usage. Triggers on "database schema", "SQL query", "migration", "optimize query", "foreign key", "index", "normalize", "ORM", "Prisma", "TypeORM", "SQLAlchemy", or database-related questions.

2 0
Explore
always-further/claude-extensions

api-designer

Activates when user needs help designing REST APIs, GraphQL schemas, or API architecture. Triggers on "design API", "REST endpoint", "GraphQL schema", "API structure", "endpoint naming", "API versioning", "request/response format", or API design questions.

2 0
Explore
always-further/claude-extensions

security-auditor

Activates when user needs security review, vulnerability scanning, or secure coding guidance. Triggers on "security review", "find vulnerabilities", "is this secure", "check for injection", "security audit", "OWASP", "secure this code", or security-related questions.

2 0
Explore
always-further/claude-extensions

documentation-writer

Activates when user needs help writing documentation, README files, API docs, or code comments. Triggers on "write documentation", "create README", "document this API", "add JSDoc", "explain this code", "write docstrings", or documentation-related requests.

2 0
Explore
always-further/claude-extensions

code-review

Activates when user wants code reviewed for quality, best practices, bugs, or improvements. Triggers on "review this code", "check my implementation", "is this code good", "find bugs", "improve this function", "code quality check", or requests for feedback on code.

2 0
Explore
always-further/claude-extensions

testing-assistant

Activates when user needs help writing tests, understanding testing patterns, or improving test coverage. Triggers on "write tests", "add unit tests", "test this function", "improve coverage", "mock this", "testing strategy", or questions about Jest, pytest, testing frameworks.

2 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results