| name | phx-perf |
| description | Analyze Elixir/Phoenix performance — N+1 queries, assign bloat, ecto optimization, genserver bottlenecks. Use when slowness, timeouts, or high memory reported. |
Performance Analysis
Analyze code for performance issues across Ecto, LiveView,
and OTP layers. Prioritize findings by impact and effort.
Usage
/skill:phx-perf # Analyze full project
/skill:phx-perf lib/my_app/accounts.ex # Analyze specific module
/skill:phx-perf --focus ecto # Ecto queries only
/skill:phx-perf --focus liveview # LiveView memory only
/skill:phx-perf --focus otp # OTP bottlenecks only
Arguments
$ARGUMENTS = Optional module/context path and --focus flag.
Iron Laws
- MEASURE BEFORE OPTIMIZING — Never optimize without evidence of a problem
- DATABASE FIRST — 90% of Elixir performance issues are query-related
- ONE CHANGE AT A TIME — Isolate optimizations to measure impact
- NEVER benchmark in dev mode — Always use
MIX_ENV=prod for performance measurements; dev mode includes code reloading, debug logging, and unoptimized compilation that invalidate results
Workflow
Step 1: Identify Scope
Check specific file if provided. Otherwise scan full project:
find lib/ -name "*.ex" | head -50
Step 2: Run Analysis Tracks
Spawn analysis agents in parallel based on focus:
Ecto Track (default or --focus ecto):
Spawn phx:elixir-reviewer with prompt:
"Analyze for N+1 queries, missing preloads, unindexed queries,
and inefficient patterns. Check: in loops,
with Repo calls, missing , queries without
indexes on WHERE/JOIN columns."