Ecto Patterns
Practical Ecto patterns for Phoenix apps covering schemas, migrations, transactions, pagination, and tenancy.
- CCM score
- 55 of 100
- skills.sh installs
- 362
- GitHub stars
- 79
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers schemas, changesets, migrations, queries, Ecto.Multi transactions, constraints, associations, pagination, multi-tenancy, performance, and testing
- Includes worked code samples for user registration changesets, safe migrations, preloads, and multi-step onboarding with
Ecto.Multi - Guides safe DDL with additive, nullable-first column changes, concurrent indexes, and small migration steps to avoid long locks
- Designed for Phoenix teams that need database-enforced constraints and tenant-scoped data access patterns
Install
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill ecto-patterns -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Ecto Patterns for Phoenix/Elixir
Ecto is the data layer for Phoenix applications: schemas, changesets, queries, migrations, and transactions. Good Ecto practice keeps domain logic in contexts, enforces constraints in the database, and uses transactions for multi-step workflows.
Schemas and Changesets
defmodule MyApp.Accounts.User do
use Ecto.Schema
import Ecto.Changeset
schema "users" do
field :email, :string
field :hashed_password, :string
field :confirmed_at, :naive_datetime
has_many :memberships, MyApp.Orgs.Membership
timestamps()
end
def registration_changeset(user, attrs) do
user
|> cast(attrs, [:email, :password])
|> validate_required([:email, :password])
|> validate_format(:email, ~r/@/)
|> validate_length(:password, min: 12)
|> unique_constraint(:email)
|> hash_password()
end
defp hash_password(%{valid?: true} = cs),
do: put_change(cs, :hashed_password, Argon2.hash_pwd_salt(get_change(cs, :password)))
defp hash_password(cs), do: cs
end
Details
- Repository
- github.com/bobmatnyc/claude-mpm-skills
- Categories
- Databases, Backend & APIs
- First seen
- Jun 3, 2026
Questions
What does the ecto-patterns skill cover?
ecto-patterns gives Phoenix and Elixir apps guidance on schemas, changesets, migrations, queries, Ecto.Multi, transactions, constraints, associations, pagination, tenant partitioning, performance, and testing. It keeps domain logic in contexts and enforces constraints in the database. Its examples show how to structure each of these areas in an Ecto data layer.
Who is ecto-patterns for?
ecto-patterns is for developers building Phoenix/Elixir applications who work with Ecto as their data layer. It helps them design schemas with validation, run migrations safely, and execute multi-step writes with Ecto.Multi. Its guidance also covers multi-tenant partitioning and query performance.
How do I install the ecto-patterns skill?
Run npx -y skills add bobmatnyc/claude-mpm-skills --skill ecto-patterns -y in your project. After installation, the agent can apply ecto-patterns when you work on Ecto schemas, migrations, queries, or transactions. The skill loads its Phoenix and Elixir data layer guidance for that work.
Which tools or accounts does ecto-patterns need?
ecto-patterns needs an Elixir project with Phoenix and Ecto, since its examples use mix ecto.create and mix ecto.migrate. Its testing examples rely on a DataCase test setup with a sandboxed database. The skill itself does not require API keys or external accounts.
Where does ecto-patterns sit among other database skills?
ecto-patterns is in the Databases category on Claude Marketplaces. It differs from the Postgres and Prisma skills in that it targets Elixir's Ecto library for Phoenix apps. Its scope is the Ecto data layer, with migration safety and tenant partitioning patterns.
More from bobmatnyc/claude-mpm-skills
All 154- Clap361
- Graphql358
- Phoenix Ops358
- Vercel Security Access357
- Pre Merge356
- Vb6 Legacy356
- Vercel Functions Runtime356
- Vercel Overview356
- Condition Based Waiting355
- Flexlayout React355
- Digitalocean Agentic Cloud354
- Jest Typescript354
- Terraform351
- Vercel Ai351
- Artifacts Builder350
- Validated Handler350
- Bad Example Skill347
- Emergency Release Workflow346
- Digitalocean Teams344
- Vector Search Workflows342
- Vercel Storage Data342
- Dispatching Parallel Agents341
- Example Framework Skill341
- Prisma Orm341
Similar to Ecto Patterns
More Databasesdatabase-migrationbobmatnyc/claude-mpm-skills443 installsPhased, backward-compatible schema migration patterns with rollback guidance, decision trees, and troubleshooting references.
golang-database-patternsbobmatnyc/claude-mpm-skills431 installsGo database patterns covering database/sql, sqlx, pgx, and golang-migrate for type-safe data access layers.
elixirmindrally/skills889 installsExpert Elixir and Phoenix guidance covering functional patterns, OTP supervision, and Ecto-backed data access.
database-migrationsaffaan-m/ecc14.5K installsSchema migration patterns for PostgreSQL, Prisma, Drizzle, Kysely, Django, and golang-migrate with zero-downtime and rollback guidance.
phoenixmindrally/skills770 installsGuidelines for Phoenix and Elixir covering LiveView, Ecto, real-time features, and secure, performant web apps.