A skill your agent uses when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields.

MITAuto-check passed

Install Ecto Patterns

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

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

GitHub CLI
$ gh skill install oliver-kriska/claude-elixir-phoenix ecto-patterns --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-patterns .claude/skills/ecto-patterns && 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-patterns
GitHub stars
565
Token cost
~859 tokens
SKILL.md length
282 words
Files
6 (incl. references)
Skills in repo
105
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields.

  • Works in 9 steps: CHANGESETS ARE FOR EXTERNAL DATA — Use… → NEVER USE :float FOR MONEY — Always use… → NO RAILS-STYLE POLYMORPHIC ASSOCIATIONS… → …
  • A task touches Ecto
  • SKILL.md covers Iron Laws — Never Violate These, Quick Schema Template, Quick Decisions and Common Anti-patterns, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Ecto Patterns is an agent skill from oliver-kriska/claude-elixir-phoenix. Use when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields. Load it before writing Ecto code. Skip for Ash.

Its SKILL.md is about 860 tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/changesets.md`, `references/fulltext-search.md` and `references/migrations.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

  • A task touches Ecto
  • Even a how-to question: schemas

Example prompts

  • “/ecto-patterns”

Workflow steps

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

  1. CHANGESETS ARE FOR EXTERNAL DATA — Use cast/4 for user/API input, change/2 or put_change/3 for internal trusted data
  2. NEVER USE :float FOR MONEY — Always use :decimal or :integer (cents)
  3. NO RAILS-STYLE POLYMORPHIC ASSOCIATIONS — They break foreign key constraints; use multiple nullable FKs or separate join tables
  4. ALWAYS PIN VALUES IN QUERIES — u.name == ^user_input is safe, string interpolation causes SQL injection
  5. PRELOAD COLLECTIONS, NOT INDIVIDUALS — Preloading in loops = N+1 queries
  6. CONSTRAINTS BEAT VALIDATIONS FOR RACE CONDITIONS — Validations provide quick feedback, constraints provide DB-level safety
  7. SEPARATE QUERIES FOR has_many, JOIN FOR belongs_to — Avoids row multiplication
  8. NO IMPLICIT CROSS JOINS — from(a in A, b in B) without on: creates Cartesian product
  9. DEDUP BEFORE cast_assoc WITH SHARED DATA — When multiple parents share child data, deduplicate child records BEFORE building changesets…

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 Patterns loads about 859 tokens when it runs, and up to ~6.9k if it reads all its reference files. Until then it costs about 54 tokens; SKILL.md has 282 words of instructions outside code blocks.

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

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). 282 words, ~859 tokens.

Download SKILL.mdSave it as .claude/skills/ecto-patterns/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
ecto-patterns
description
Use when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields. Load it before writing Ecto code. Skip for Ash.

Ecto Patterns Reference

Reference for working with Ecto schemas, queries, and migrations.

Iron Laws — Never Violate These

  1. CHANGESETS ARE FOR EXTERNAL DATA — Use cast/4 for user/API input, change/2 or put_change/3 for internal trusted data
  2. NEVER USE :float FOR MONEY — Always use :decimal or :integer (cents)
  3. NO RAILS-STYLE POLYMORPHIC ASSOCIATIONS — They break foreign key constraints; use multiple nullable FKs or separate join tables
  4. ALWAYS PIN VALUES IN QUERIES — u.name == ^user_input is safe, string interpolation causes SQL injection
  5. PRELOAD COLLECTIONS, NOT INDIVIDUALS — Preloading in loops = N+1 queries
  6. CONSTRAINTS BEAT VALIDATIONS FOR RACE CONDITIONS — Validations provide quick feedback, constraints provide DB-level safety
  7. SEPARATE QUERIES FOR has_many, JOIN FOR belongs_to — Avoids row multiplication
  8. NO IMPLICIT CROSS JOINS — from(a in A, b in B) without on: creates Cartesian product
  9. DEDUP BEFORE cast_assoc WITH SHARED DATA — When multiple parents share child data, deduplicate child records BEFORE building changesets. Dedup only works within a single changeset

Quick Schema Template

elixir
defmodule MyApp.Context.Entity do
  use Ecto.Schema
  import Ecto.Changeset

  @primary_key {:id, :binary_id, autogenerate: true}
  @foreign_key_type :binary_id

  schema "entities" do
    field :name, :string
    field :status, Ecto.Enum, values: [:draft, :active, :archived]
    field :amount_cents, :integer  # Never :float for money!
    belongs_to :user, MyApp.Accounts.User
    timestamps(type: :utc_datetime_usec)
  end

  def changeset(entity, attrs) do
    entity
    |> cast(attrs, [:name, :status, :amount_cents])
    |> validate_required([:name])
    |> foreign_key_constraint(:user_id)
  end
end

Quick Decisions

cast vs put_change vs change
FunctionUse When
cast/4External data (user input, API)
put_change/3Internal trusted data (timestamps, computed)
change/2Internal data from existing struct
Preload Strategy
RelationshipStrategy
belongs_toJOIN (single query)
has_manySeparate queries (avoid row multiplication)

Common Anti-patterns

WrongRight
field :amount, :floatfield :amount_cents, :integer
"SELECT * WHERE name = '#{name}'"from(u in User, where: u.name == ^name)
Repo.all(User) |> Enum.filter(& &1.active)from(u in User, where: u.active)
Preloading in loopsRepo.preload(posts, :comments)
Repo.get!(User, user_id) with user inputRepo.get(User, id) + handle nil
{:ok, _} = Repo.update(cs) inside Repo.transactioncase/with + Repo.rollback(cs) (see transactions.md)

References

For detailed patterns, see:

  • references/changesets.md - cast vs put_change, custom validations, prepare_changes
  • references/queries.md - Composable queries, dynamic, subqueries, preloading
  • references/migrations.md - Safe migrations, concurrent indexes, NOT NULL
  • references/transactions.md - Repo.transact, Ecto.Multi, upserts

© 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 5 other files (references) in targets/pi/skills/ecto-patterns of oliver-kriska/claude-elixir-phoenix.

  • SKILL.md
  • references/changesets.md
  • references/fulltext-search.md
  • references/migrations.md
  • references/queries.md
  • references/transactions.md

Open the folder on GitHubat commit 9767a82

Compare with similar skills

Ecto Patterns 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 Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ecto Patterns this skilloliver-kriska/claude-elixir-phoenix565—~859Automated safety check: PassMIT
Schema Markupalirezarezvani/claude-skills28k1 repos~2.9kAutomated safety check: PassMIT
Database Schema Designeralirezarezvani/claude-skills28k1 repos~1.9kAutomated safety check: PassMIT
GEO Schema Auditorzubair-trabzada/geo-seo-claude11k2 repos~3.7kAutomated safety check: NotesMIT
Schema Noindex Conflictthedaviddias/Front-End-Checklist74k—~550Automated safety check: PassMIT
Schema.org Markup Detector and GeneratorAgriciDaniel/claude-seo18k—~1.8kAutomated safety check: PassMIT

Similar skills

  • Schema Markup

    alirezarezvani/claude-skills

    When the user wants to implement, audit, or validate structured data (schema markup) on their website.

    28k GitHub starsUsed in 1 repo~2.9k tokens
    Marketing & SEOAuto-check passed
  • Database Schema Designer

    alirezarezvani/claude-skills

    A skill your agent uses when the user asks to create ERD diagrams, normalize database schemas, design table relationships, or plan schema migrations.

    28k GitHub starsUsed in 1 repo~1.9k tokens
    DatabasesAuto-check passed
  • GEO Schema Auditor

    zubair-trabzada/geo-seo-claude

    Audits a page's Schema.org structured data for AI discoverability, validates it, generates JSON-LD to fill gaps and writes a GEO-SCHEMA-REPORT.md.

    11k GitHub starsUsed in 2 repos~3.7k tokens
    Marketing & SEOAuto-check: notes
  • Schema Noindex Conflict

    thedaviddias/Front-End-Checklist

    A skill your agent uses when applies to any site that uses structured data for rich results.

    74k GitHub stars~550 tokensUpdated 2 days ago
    Marketing & SEOAuto-check passed
  • Detects, validates and generates Schema.org JSON-LD for a page, flagging deprecated or retired rich-result types using an actively updated status list.

    18k GitHub stars~1.8k tokensUpdated 3 days ago
    Marketing & SEOAuto-check passed
  • JSON Schema Manual

    sickn33/agentic-awesome-skills

    JSON Schema Manual: draft 2020-12 validation schema from a confirmed field list, with required and enum values only where confirmed.

    47k GitHub starsUsed in 1 repo~2.9k tokens
    Auto-check passed

More from oliver-kriska/claude-elixir-phoenix

All 105 skills in this repo
  • Phx Brief

    oliver-kriska/claude-elixir-phoenix

    Interactive briefing of a plan file — explains reasoning, schema decisions, component choices.

    565 GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • 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 3 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 3 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 3 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 3 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 3 days ago
    Auto-check passed

Questions about Ecto Patterns

What does Ecto Patterns do?

A skill your agent uses when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields. Ecto Patterns is an agent skill from oliver-kriska/claude-elixir-phoenix. Use when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields.

When should I use Ecto Patterns?

Ecto Patterns fits situations like: A task touches Ecto; even a how-to question: schemas.

How do I install Ecto Patterns in Claude Code?

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

How do I install Ecto Patterns in Codex?

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

Can I use Ecto Patterns 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-patterns -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-patterns, .gemini/skills/ecto-patterns, .github/skills/ecto-patterns and .opencode/skills/ecto-patterns in your project.

What does Ecto Patterns need to run?

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

Does Ecto Patterns 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 Patterns 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 Patterns use?

Ecto Patterns 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 Patterns use?

About 859 tokens (SKILL.md is roughly 3.4k 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 6k tokens, read only when the agent opens those files.

What are the alternatives to Ecto Patterns?

Skills that share tags, products or a category with Ecto Patterns: Schema Markup (alirezarezvani/claude-skills, 28k stars), Database Schema Designer (alirezarezvani/claude-skills, 28k stars), GEO Schema Auditor (zubair-trabzada/geo-seo-claude, 11k stars) and Schema Noindex Conflict (thedaviddias/Front-End-Checklist, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ecto Patterns?

oliver-kriska (a GitHub user) maintains it in oliver-kriska/claude-elixir-phoenix, which has 565 GitHub stars. The repository holds 105 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.