ecto-changeset-patterns

Installation
SKILL.md

Ecto Changeset Patterns

RULES — Quick Checklist

  1. Separate named changesets per operation (registration_changeset, email_changeset, etc.)
  2. Never require foreign key fields in cast_assoc child changesets
  3. Compose changesets with pipes; each validation step is a separate function
  4. Always pair unsafe_validate_unique with unique_constraint
  5. Use update_change/3 for field transformations (trim, downcase, slugify)
  6. Accept opts \\ [] for conditional validation
  7. Validate at the changeset level, not in context functions

Workflow: Building a New Schema

When adding changesets to a new schema, apply patterns in this order:

Installs
2
First Seen
2 days ago
ecto-changeset-patterns — igmarin/elixir-phoenix-skills