mcpbeat Sign in

Phx Perf Skill for Claude

Analyze Elixir/Phoenix performance — N+1 queries, assign bloat, ecto optimization, genserver bottlenecks. Use when slowness, timeouts, or high memory reported.

2k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
514
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill phx-perf

What comes with it

5 314 bytes besides the instruction
references/benchmarking.md

The instruction itself

12 sections, as written by the author

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 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:

## 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?

- `/skill:phx-plan` — Create a plan from these findings (recommended for 3+ fixes)
- `/skill:phx-quick` — Apply top priority fix directly (1-2 simple fixes)
- `/skill: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

  • references/benchmarking.md — Benchee patterns, profiling, flame graphs

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take oliver-kriska/claude-elixir-phoenix-pi-phx-perf from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.