elixir-phoenix-perf
Analyze Phoenix slowness, memory, N+1s, and bottlenecks.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Analyze Phoenix slowness, memory, N+1s, and bottlenecks.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Recommend the right `$elixir-phoenix-*` skill for the current task.
Elixir/Phoenix: Review lifecycle, state-machine, Oban, persistence, pause/resume, retry, and restart-sensitive changes before commit, push, or PR. Use for concurrency-sensitive runtime work to produce explicit blocking vs optional findings, require durability checks, and verify smoke plus restart resilience when applicable.
Capture a solved Phoenix problem as a reusable solution doc.
Audit LiveView assigns for memory bloat, dead assigns, and stream candidates.
Audit project health across architecture, security, performance, tests, and deps.
Analyze Phoenix context boundaries and coupling with `mix xref`.
| name | elixir-phoenix-perf |
| description | Analyze Phoenix slowness, memory, N+1s, and bottlenecks. |
| metadata | {"short-description":"Investigate Phoenix performance issues"} |
Analyze code for performance issues across Ecto, LiveView, and OTP layers. Prioritize findings by impact and effort.
`elixir-phoenix-perf` # Analyze full project
`elixir-phoenix-perf` lib/my_app/accounts.ex # Analyze specific module
`elixir-phoenix-perf` --focus ecto # Ecto queries only
`elixir-phoenix-perf` --focus liveview # LiveView memory only
`elixir-phoenix-perf` --focus otp # OTP bottlenecks only
$ARGUMENTS = Optional module/context path and --focus flag.
MIX_ENV=prod for performance measurements; dev mode includes code reloading, debug logging, and unoptimized compilation that invalidate resultsCheck specific file if provided. Otherwise scan full project:
# Find hot paths: contexts, LiveViews, workers
find lib/ -name "*.ex" | head -50
Spawn analysis agents in parallel based on focus:
Ecto Track (default or --focus ecto):
Spawn elixir-phoenix:elixir-reviewer with prompt:
"Analyze for N+1 queries, missing preloads, unindexed queries,
and inefficient patterns. Check: Repo.all in loops,
Enum.map with Repo calls, missing preload, queries without
indexes on WHERE/JOIN columns."
LiveView Track (default or --focus liveview):
Spawn elixir-phoenix:elixir-reviewer with prompt:
"Analyze LiveViews for memory issues: large assigns, missing
streams for lists, assigns that grow unbounded, heavy
handle_info processing, missing assign_async for slow ops."
OTP Track (only with --focus otp):
Spawn elixir-phoenix:otp-advisor with prompt:
"Analyze for OTP bottlenecks: GenServer mailbox growth,
synchronous calls in hot paths, missing Task.async for
parallel work, ETS opportunities for read-heavy state."
Score each finding on a 2x2 matrix:
| Low Effort | High Effort | |
|---|---|---|
| High Impact | DO FIRST | PLAN |
| Low Impact | QUICK WIN | SKIP |
High impact = affects response time, memory per user, or query count. Low effort = single file change, no migration needed.
Present findings sorted by priority:
## Performance Analysis: {scope}
### 1. {Finding} — DO FIRST
**Impact**: {what improves}
**Location**: {file}:{line}
**Current**: {problematic pattern}
**Fix**: {optimized pattern}
**Estimated gain**: {e.g., "eliminates N+1, reduces queries from O(n) to O(1)"}
### 2. {Finding} — PLAN
...
Always end with actionable next steps — findings without follow-up get lost. Present options based on severity:
How would you like to proceed?
- ``elixir-phoenix-plan`` — Create a plan from these findings (recommended for 3+ fixes)
- ``elixir-phoenix-quick`` — Apply top priority fix directly (1-2 simple fixes)
- ``elixir-phoenix-investigate`` — Deep-dive into a specific finding
If Tidewave MCP is available:
mcp__tidewave__project_eval to run Repo.query!("EXPLAIN ANALYZE ...") on suspicious queriesmcp__tidewave__project_eval to check Process.info(pid, :message_queue_len) for GenServer bottlenecksmcp__tidewave__execute_sql_query to check missing indexesreferences/benchmarking.md — Benchee patterns, profiling, flame graphs