cc-changelog
CONTRIBUTOR TOOL - Track CC changelog, extract new versions since last check, analyze impact on plugin (breaking changes,…
Detect N+1 query anti-patterns specifically — Repo calls inside Enum/for
Claude Code
$ npx -y skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check --agent claude-code
Codex
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a codex -y
Cursor
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a cursor -y
Gemini CLI
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a gemini-cli -y
GitHub Copilot
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a github-copilot -y
OpenCode
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a opencode -y
Windsurf
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a windsurf -y
name: ecto-n1-check description: Detect N+1 query anti-patterns specifically — Repo calls inside Enum/for loops, missing preloads on associations. Use when N+1 is explicitly suspected, NOT for unrelated Ecto questions or wider database performance.
Identify and fix N+1 query anti-patterns in Ecto/Phoenix applications.
1. **Never access associations without preload** - Always preload before `Enum.map` 2. **No Repo calls inside loops** - Restructure to batch queries 3. **Preload at context boundary** - Load associations in context, not controllers/views 4. **Use joins for filtering** - Use `join` + `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`.
Use Grep to find all `Repo.` calls in a context module, then verify each query has appropriate preloads.
For detailed patterns, see:
Docs: phxagents.dev -- install guides per runtime, the runtime compatibility matrix, all 26 Iron Laws, and a browsable skill and agent catalog. Claude Code is great.
CONTRIBUTOR TOOL - Track CC changelog, extract new versions since last check, analyze impact on plugin (breaking changes,…
Run an A/B codex review experiment — holistic codex review vs 3 focused dimension passes (security, ecto, liveview) on the branch…
CONTRIBUTOR TOOL - Validate plugin against latest Claude Code documentation. Catches breaking changes, deprecations, discovers…
Guide plugin development workflow — editing skills, agents, hooks, or eval framework in this repo. Use when modifying files in…
Generate X/Twitter release promotion posts with ASCII tables and CodeSnap rendering. Use when writing release posts, promotion…
CONTRIBUTOR TOOL - Cut a plugin release: bump plugin.json version, finalize CHANGELOG, update README if needed, gate on make ci,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.