ecto-thinking
Originally fromgeorgeguimaraes/claude-code-elixir
Installation
SKILL.md
Ecto Thinking
Mental shifts for Ecto and data layer design. These insights challenge typical ORM patterns.
Context = Setting That Changes Meaning
Context isn't just a namespace—it changes what words mean. "Product" means different things in Checkout (SKU, name), Billing (SKU, cost), and Fulfillment (SKU, warehouse). Each bounded context may have its OWN Product schema/table.
Think top-down: Subdomain → Context → Entity. Not "What context does Product belong to?" but "What is a Product in this business domain?"
Cross-Context References: IDs, Not Associations
schema "cart_items" do
field :product_id, :integer # Reference by ID
# NOT: belongs_to :product, Catalog.Product
end