Detect N+1 query anti-patterns specifically — Repo calls inside Enum/for loops, missing preloads on associations.

MITAuto-check passed

Install Ecto N1 Check

skills CLI
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install oliver-kriska/claude-elixir-phoenix ecto-n1-check --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/oliver-kriska/claude-elixir-phoenix.git skills-src && mkdir -p .claude/skills && cp -r skills-src/targets/pi/skills/ecto-n1-check .claude/skills/ecto-n1-check && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ecto-n1-check
GitHub stars
565
Token cost
~525 tokens
SKILL.md length
161 words
Files
3 (incl. references)
Skills in repo
109
Repo updated
First seen
Licence
MIT

At a glance

Detect N+1 query anti-patterns specifically — Repo calls inside Enum/for loops, missing preloads on associations.

  • Works in 4 steps: Never access associations without… → No Repo calls inside loops - Restructure… → Preload at context boundary - Load… → …
  • N+1 is explicitly suspected
  • SKILL.md covers Iron Laws - Never Violate These, Detection Patterns, Quick Detection Commands and Analysis Command, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Ecto N1 Check is an agent skill from oliver-kriska/claude-elixir-phoenix. 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.

Its SKILL.md is about 530 tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/preload-patterns.md` and `references/query-optimization.md`).

The repository describes itself as: Claude Code plugin for Elixir/Phoenix/LiveView — 26 specialist agents, Iron Laws enforcement, and Tidewave MCP integration. Plan features with parallel research agents, execute… The licence is MIT.

When your agent uses it

  • N+1 is explicitly suspected
  • NOT for unrelated Ecto questions
  • Wider database performance

Example prompts

  • “/ecto-n1-check”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  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

What it can do on your machine

Read from SKILL.md and the folder at commit 9767a82. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are elixir).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ecto N1 Check loads about 525 tokens when it runs, and up to ~2.2k if it reads all its reference files. Until then it costs about 57 tokens; SKILL.md has 161 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~525
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from oliver-kriska/claude-elixir-phoenix at commit 9767a82, republished under its MIT licence (© oliver-kriska). 161 words, ~525 tokens.

Download SKILL.mdSave it as .claude/skills/ecto-n1-check/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
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.

N+1 Query Detection

Identify and fix N+1 query anti-patterns in Ecto/Phoenix applications.

Iron Laws - Never Violate These

  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

Detection Patterns

Pattern 1: Enum.map with Repo
elixir
# 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)
Pattern 2: Association Access Without Preload
elixir
# 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
Pattern 3: Nested Association Access
elixir
# BAD: N+1 for nested associations
user.posts |> Enum.map(fn post -> post.comments end)

# GOOD: Nested preload
Repo.preload(user, posts: :comments)

Quick Detection Commands

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.

Analysis Command

Use Grep to find all Repo. calls in a context module, then verify each query has appropriate preloads.

References

For detailed patterns, see:

  • references/preload-patterns.md - Efficient preloading strategies
  • references/query-optimization.md - Query batching techniques

© oliver-kriska, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in targets/pi/skills/ecto-n1-check of oliver-kriska/claude-elixir-phoenix.

  • SKILL.md
  • references/preload-patterns.md
  • references/query-optimization.md

Open the folder on GitHubat commit 9767a82

Compare with similar skills

Ecto N1 Check next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ecto N1 Check compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ecto N1 Check this skilloliver-kriska/claude-elixir-phoenix565—~525Automated safety check: PassMIT
Agent Specificationruvnet/ruflo74k2 repos~1.8kAutomated safety check: PassMIT
Threat Detectionalirezarezvani/claude-skills28k—~3.5kAutomated safety check: PassMIT
Resemble Detectgithub/awesome-copilot40k3 repos~4.1kAutomated safety check: PassApache-2.0
Pii Detectruvnet/ruflo74k—~350Automated safety check: NotesMIT
Specificity Managementthedaviddias/Front-End-Checklist74k—~477Automated safety check: PassMIT

Similar skills

  • Agent skill for specification - invoke with $agent-specification

    74k GitHub starsUsed in 2 repos~1.8k tokens
    Product & Project ManagementAuto-check passed
  • Threat Detection

    alirezarezvani/claude-skills

    A skill your agent uses when hunting for threats in an environment, analyzing IOCs, or detecting behavioral anomalies in telemetry.

    28k GitHub stars~3.5k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Resemble Detect

    github/awesome-copilot

    Official

    Deepfake detection and media safety — detect AI-generated audio, images, video, and text, trace synthesis sources, apply watermarks, verify speaker identity, and analyze media intelligence using…

    40k GitHub starsUsed in 3 repos~4.1k tokens
    Media & CreativeAuto-check passed
  • Pii Detect

    ruvnet/ruflo

    Detect and flag personally identifiable information (PII) in text, code, and configurations.

    74k GitHub stars~350 tokensUpdated yesterday
    Auto-check: notes
  • Specificity Management

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing stylesheets, component styles, and responsive behavior related to Keep CSS specificity low and flat.

    74k GitHub stars~477 tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Detecting Dnp3 Protocol Anomalies

    mukul975/Anthropic-Cybersecurity-Skills

    Detect anomalies in DNP3 communications used in SCADA/ICS systems by monitoring unauthorized control commands, firmware update attempts, protocol violations, and deviations from baseline traffic…

    34k GitHub stars~3.6k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed

More from oliver-kriska/claude-elixir-phoenix

All 109 skills in this repo
  • Codex Ab

    oliver-kriska/claude-elixir-phoenix

    Run an A/B codex review experiment — holistic codex review vs 3 focused dimension passes (security, ecto, liveview) on the branch diff, classify findings, report a panel-value verdict.

    565 GitHub stars~977 tokensUpdated 5 days ago
    Auto-check passed
  • Audit

    oliver-kriska/claude-elixir-phoenix

    Project health audit and health check — architecture, performance, tests, dependencies, code quality.

    565 GitHub stars~2k tokensUpdated 5 days ago
    Auto-check passed
  • Compound Docs

    oliver-kriska/claude-elixir-phoenix

    Searchable Elixir/Phoenix/Ecto solution documentation system with; Use when consulting past solutions…

    565 GitHub stars~528 tokensUpdated 5 days ago
    Auto-check passed
  • Compound Docs

    oliver-kriska/claude-elixir-phoenix

    Searchable Elixir/Phoenix/Ecto solution documentation system with YAML frontmatter.

    565 GitHub stars~547 tokensUpdated 5 days ago
    Auto-check passed
  • Deploy

    oliver-kriska/claude-elixir-phoenix

    Elixir/Phoenix deployment patterns — Dockerfile, fly.toml, runtime.exs, mix release, rel/ overlays.

    565 GitHub stars~1.1k tokensUpdated 5 days ago
    Auto-check passed
  • Deps Update

    oliver-kriska/claude-elixir-phoenix

    Bump outdated Hex deps — inventory, snapshot changelogs, update, fix breaks, split reviewable PRs (patches bundled, majors solo).

    565 GitHub stars~1.4k tokensUpdated 5 days ago
    Auto-check passed

Questions about Ecto N1 Check

What does Ecto N1 Check do?

Detect N+1 query anti-patterns specifically — Repo calls inside Enum/for loops, missing preloads on associations. Ecto N1 Check is an agent skill from oliver-kriska/claude-elixir-phoenix. Detect N+1 query anti-patterns specifically — Repo calls inside Enum/for loops, missing preloads on associations.

When should I use Ecto N1 Check?

Ecto N1 Check fits situations like: N+1 is explicitly suspected; NOT for unrelated Ecto questions; wider database performance.

How do I install Ecto N1 Check in Claude Code?

Run `npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a claude-code`. Or copy the skill folder (targets/pi/skills/ecto-n1-check in oliver-kriska/claude-elixir-phoenix) into .claude/skills/ecto-n1-check in your project. Claude Code loads it when a task matches its description.

How do I install Ecto N1 Check in Codex?

Run `npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a codex`. Or copy the skill folder (targets/pi/skills/ecto-n1-check in oliver-kriska/claude-elixir-phoenix) into .agents/skills/ecto-n1-check in your project. Codex loads it when a task matches its description.

Can I use Ecto N1 Check in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add oliver-kriska/claude-elixir-phoenix --skill ecto-n1-check -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ecto-n1-check, .gemini/skills/ecto-n1-check, .github/skills/ecto-n1-check and .opencode/skills/ecto-n1-check in your project.

What does Ecto N1 Check need to run?

SKILL.md names no scripts, command-line tools or credentials: Ecto N1 Check is instructions for the agent only.

Does Ecto N1 Check access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Ecto N1 Check safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ecto N1 Check use?

Ecto N1 Check is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ecto N1 Check use?

About 525 tokens (SKILL.md is roughly 2.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.7k tokens, read only when the agent opens those files.

What are the alternatives to Ecto N1 Check?

Skills that share tags, products or a category with Ecto N1 Check: Agent Specification (ruvnet/ruflo, 74k stars), Threat Detection (alirezarezvani/claude-skills, 28k stars), Resemble Detect (github/awesome-copilot, 40k stars) and Pii Detect (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ecto N1 Check?

oliver-kriska (a GitHub user) maintains it in oliver-kriska/claude-elixir-phoenix, which has 565 GitHub stars. The repository holds 109 skills in this directory. The repository was last updated on October 5, 2026.

Source: oliver-kriska/claude-elixir-phoenix on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.