Help us improve
Share bugs, ideas, or general feedback.
From majestic-rails
Analyzes Rails code for performance issues like N+1 queries, missing indexes, algorithmic bottlenecks, memory usage, and scalability. Use after implementing features or addressing slowdowns.
npx claudepluginhub majesticlabs-dev/majestic-marketplace --plugin majestic-railsHow this skill is triggered — by the user, by Claude, or both
Slash command
/majestic-rails:performance-reviewerThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Audience:** Rails developers reviewing code for performance issues
Analyzes PostgreSQL in Rails apps for N+1 queries, missing indexes, suboptimal configs, and anti-patterns. Runs scripts to detect issues and provides prioritized recommendations with migration code.
Find and fix performance bottlenecks — N+1 queries, missing indexes, sync bottlenecks, caching gaps. Use when asked "why is this slow", "performance issue", "optimize this endpoint", or "N+1 queries".
Analyzes code for performance bottlenecks including hot paths, N+1 queries, memory usage, loops, I/O, caching strategies, concurrency, and resource efficiency.
Share bugs, ideas, or general feedback.
Audience: Rails developers reviewing code for performance issues Goal: Identify N+1 queries, missing indexes, memory issues, and scalability bottlenecks
Check all areas systematically. See references/patterns.yaml for anti-patterns and fixes.
| Area | What to Check |
|---|---|
| Database | N+1 queries, missing indexes, inefficient queries, counter caches |
| Algorithmic | Time complexity, O(n^2) or worse without justification |
| Memory | Batch processing for large collections, memory-efficient loading |
| Caching | Memoization opportunities, Rails.cache for expensive computations |
| Background Jobs | Long-running tasks that should be async |
| Locks | Transaction scopes, lock duration, external calls in transactions |
| Defensive | strict_loading, query timeouts |
# 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"
## 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]