perf
/perf
Use when anything in a Phoenix app is slow, times out, or uses too much memory, even if the cause looks obvious. Load it before analyzing or fixing: it runs measured Ecto, LiveView and OTP checks and ranks fixes.
- Author
- oliver-kriska ↗
- Repository
- claude-elixir-phoenix ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when anything in a Phoenix app is slow, times out, or uses too much memory, even if the cause looks obvious. Load it before analyzing or fixing: it runs measured Ecto, LiveView and OTP checks and ranks fixes.
Arguments
/perf [page|context|module] [--focus ecto|liveview|otp]
Original author description
Use when anything in a Phoenix app is slow, times out, or uses too much memory, even if the cause looks obvious. Load it before analyzing or fixing: it runs measured Ecto, LiveView and OTP checks and ranks fixes.
How it works
- Usage
- Arguments
- Iron Laws
- Workflow
- Tidewave Integration
- References
SKILL.md preview
---
name: perf
description: "Use when anything in a Phoenix app is slow, times out, or uses too much memory, even if the cause looks obvious. Load it before analyzing or fixing: it runs measured Ecto, LiveView and OTP checks and ranks fixes."
effort: high
argument-hint: "[page|context|module] [--focus ecto|liveview|otp]"
---
# Performance Analysis
Analyze code for performance issues across Ecto, LiveView,
and OTP layers. Prioritize findings by impact and effort.
## Usage
```
/phx:perf # Analyze full project
/phx:perf lib/my_app/accounts.ex # Analyze specific module
/phx:perf --focus ecto # Ecto queries only
/phx:perf --focus liveview # LiveView memory only
/phx:perf --focus otp # OTP bottlenecks only
```
## Arguments
`$ARGUMENTS` = Optional module/context path and `--focus` flag.
## Iron Laws
1. **MEASURE BEFORE OPTIMIZING** — Never optimize without evidence of a problem
2. **DATABASE FIRST** — 90% of Elixir performance issues are query-related
3. **ONE CHANGE AT A TIME** — Isolate optimizations to measure impact
4. **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:
```bash
# Find hot paths: contexts, LiveViews, workers
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: `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 `phx: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 `phx: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."
### Step 3: Prioritize Findings
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.
### Step 4: Present Top 5
Present findings sorted by priority:
```markdown
## 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
...
```
### Step 5: Offer Next Steps
Always end with actionable next steps — findings without follow-up
get lost. Present options based on severity:
```
How would you like to proceed?
- `/phx:plan` — Create a plan from these findings (recommended for 3+ fixes)
- `/phx:quick` — Apply top priority fix directly (1-2 simple fixes)
- `/phx:investigate` — Deep-dive into a specific finding
```
## Tidewave Integration
If Tidewave MCP is available:
- Use `mcp__tidewave__project_eval` to run `Repo.query!("EXPLAIN ANALYZE ...")` on suspicious queries
- Use `mcp__tidewave__project_eval` to check `Process.info(pid, :message_queue_len)` for GenServer bottlenecks
- Use `mcp__tidewave__execute_sql_query` to check missing indexes
## References
- `${CLAUDE_SKILL_DIR}/references/benchmarking.md` — Benchee patterns, profiling, flame graphs
Files in this package (2)
- SKILL.md 4 KB
- references/benchmarking.md 5 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · oliver-kriska/claude-elixir-phoenix | 100 | MIT |
| duronext/jig | 100 | MIT |
| dxos/dxos | 100 | Apache-2.0 |
| anilsoylu/famiglia | 100 | Apache-2.0 |
| jisuzzzz/haechi | 100 | MIT |
| 8beeeaaat/touchdesigner-mcp | 100 | MIT |
| 8beeeaaat/touchdesigner-mcp | 100 | MIT |
| htlin222/dotfiles | 100 | MIT |
| qainsights/perf-skills | 100 | MIT |
Database snapshot: 13.11.2026 · package version 3063926bf8ce (SHA-256 digest of the entire package)
Downloads in the last 30 days: 2 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100phx-perf
Use when anything in a Phoenix app is slow, times out, or uses too much memory, even if the cause looks obvious. Load it before analyzing or fixing: it runs measured Ecto, LiveView and OTP checks and ranks fixes. - 100phx-perf
Use when anything in a Phoenix app is slow, times out, or uses too much memory, even if the cause looks obvious. Load it before analyzing or fixing: it runs measured Ecto, LiveView and OTP checks and ranks fixes. - 95elixir
Use this skill when building with Elixir — Phoenix framework, OTP, BEAM, LiveView, Ecto, supervision trees. This skill enforces: OTP design principles, Phoenix context boundaries, LiveView state management, Ecto schema conventions, supervision tree structure. Do NOT use for:… - 100phoenix
Use when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between domain logic and the web layer. Covers the classic LiveView over-rendering and Ecto N+1 traps. NOT pure… - 100phoenix
Expert Phoenix assistance covering Elixir web development, LiveView real-time reactive UIs, Ecto queries, and Channels. Use when building high-concurrency real-time web applications with minimal JavaScript. - 90staff-level-elixir
Use this skill when writing, reviewing, or refactoring Elixir, OTP, Ecto, or Phoenix/LiveView code. It corrects the staff-level judgment calls a capable model gets wrong by default — reaching for a GenServer as the universal tool, rescuing instead of letting processes crash, N+1…