ecto-essentials
Installation
SKILL.md
Ecto Essentials
RULES — Follow these with no exceptions
- Always use changesets for inserts and updates — never pass raw maps to Repo
- Preload associations before accessing them — avoid N+1 queries
- Use transactions for multi-step operations that must succeed together
- Add database constraints (unique_index, foreign_key, check_constraint) AND changeset validations
- Use contexts for database access — never call Repo directly from web layer
- Add indexes on foreign keys and frequently queried fields
- Use timestamps() in every schema — track when records were created/updated
Schema Definition
Define schemas with proper types and associations.
Related skills
More from j-morgan6/elixir-phoenix-guide
oban-essentials
MANDATORY for ALL Oban work. Invoke before writing workers or enqueuing jobs.
1phoenix-json-api
MANDATORY for ALL JSON API work. Invoke before writing API controllers, pipelines, or JSON responses.
1otp-essentials
MANDATORY for ALL OTP work. Invoke before writing GenServer, Supervisor, Task, or Agent modules.
1code-quality
Automated code quality detection — duplication, complexity, unused functions. Invoke when analyzing or refactoring Elixir code.
1phoenix-uploads
MANDATORY for file upload features. Invoke before implementing upload or file serving functionality.
1testing-essentials
MANDATORY for ALL test files. Invoke before writing any _test.exs file.
1