Skill

performance-reviewer

Analyze Rails code for performance issues, optimize queries, identify bottlenecks, and ensure scalability. Apply after implementing features or when performance concerns arise.

From majestic-rails
Install
1
Run in your terminal
$
npx claudepluginhub majesticlabs-dev/majestic-marketplace --plugin majestic-rails
Tool Access

This skill is limited to using the following tools:

Read Grep Glob Bash
Supporting Assets
View in Repository
references/patterns.yaml
Skill Content

Rails Performance Review

Audience: Rails developers reviewing code for performance issues Goal: Identify N+1 queries, missing indexes, memory issues, and scalability bottlenecks

Analysis Framework

Check all areas systematically. See references/patterns.yaml for anti-patterns and fixes.

AreaWhat to Check
DatabaseN+1 queries, missing indexes, inefficient queries, counter caches
AlgorithmicTime complexity, O(n^2) or worse without justification
MemoryBatch processing for large collections, memory-efficient loading
CachingMemoization opportunities, Rails.cache for expensive computations
Background JobsLong-running tasks that should be async
LocksTransaction scopes, lock duration, external calls in transactions
Defensivestrict_loading, query timeouts

Performance Benchmarks

  • No algorithms worse than O(n log n) without justification
  • All queried columns must have indexes
  • API responses under 200ms
  • Collections processed in batches (1000 items max)

Verification Commands

# Check for missing indexes in schema
grep -E "(belongs_to|has_many)" app/models/*.rb | grep -v "optional:"

# Find potential N+1 queries
grep -rn "\.each.*\." app/ --include="*.rb" | grep -v find_each

# Check slow query log (if enabled)
tail -100 log/development.log | grep "Load"

Output Format

## Performance Summary
[High-level assessment]

## Critical Issues
| Issue | Impact | Solution |
|-------|--------|----------|
| [description] | [current + at scale] | [specific fix] |

## Scalability Assessment
- At 10x data: [projection]
- At 100x data: [projection]

## Recommended Actions
1. [Highest impact fix]
2. [Next priority]
Stats
Parent Repo Stars31
Parent Repo Forks6
Last CommitMar 15, 2026