From elixir-phoenix
Detects N+1 query anti-patterns in Ecto code: Repo calls in loops, missing preloads, unpreloaded associations. Use for excessive queries or N+1 audits.
npx claudepluginhub oliver-kriska/claude-elixir-phoenix --plugin elixir-phoenixThis skill is limited to using the following tools:
Identify and fix N+1 query anti-patterns in Ecto/Phoenix applications.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Identify and fix N+1 query anti-patterns in Ecto/Phoenix applications.
Enum.mapjoin + preload when filtering by association# BAD: N+1 queries
users
|> Enum.map(fn user -> Repo.get(Order, user.order_id) end)
# GOOD: Single query with preload
users
|> Repo.preload(:orders)
# BAD: Lazy loading triggers N queries
for user <- users do
user.posts # Triggers query for each user!
end
# GOOD: Eager load first
users = Repo.all(User) |> Repo.preload(:posts)
for user <- users do
user.posts # Already loaded
end
# BAD: N+1 for nested associations
user.posts |> Enum.map(fn post -> post.comments end)
# GOOD: Nested preload
Repo.preload(user, posts: :comments)
Use Grep with context lines (-B 5 -A 5) to find Enum.map near Repo. calls in lib/**/*.ex.
Use Grep to find association access patterns (.posts, .comments, .orders) in lib/**/*.ex.
Use Grep with context (-B 3) to find Repo.get or Repo.one near loop patterns (for, Enum) in lib/**/*.ex.
For a context module, run:
Use Grep to find all Repo. calls in the context module, then verify each has appropriate preloads.
Then verify each query has appropriate preloads.
For detailed patterns, see:
${CLAUDE_SKILL_DIR}/references/preload-patterns.md - Efficient preloading strategies${CLAUDE_SKILL_DIR}/references/query-optimization.md - Query batching techniques