ecto-essentials
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.
More from j-morgan6/elixir-claude-optimization
phoenix-uploads
MANDATORY for file upload features. Invoke before implementing upload or file serving functionality.
14elixir-essentials
MANDATORY for ALL Elixir code changes. Invoke before writing any .ex or .exs file.
14phoenix-liveview-essentials
MANDATORY for ALL LiveView work. Invoke before writing LiveView modules or .heex templates.
10phoenix-liveview
INVOKE BEFORE implementing any LiveView feature. REQUIRED for mount, handle_event, handle_info callbacks, file uploads, navigation, PubSub, streams, and LiveView testing. Essential for all LiveView development.
7elixir-patterns
INVOKE BEFORE writing any Elixir code. REQUIRED for pattern matching, pipe operators, with statements, guards, list comprehensions, and naming conventions. Use this skill to ensure idiomatic Elixir patterns.
6testing-essentials
MANDATORY for ALL test files. Invoke before writing any _test.exs file.
6