ecto-thinking

Design Ecto data models and context boundaries for Elixir applications.

167|14|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/georgeguimaraes/claude-code-elixir --skill ecto-thinking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ecto-thinking
Source: https://github.com/georgeguimaraes/claude-code-elixir/tree/main/plugins/elixir/skills/ecto-thinking
Command: npx skills add https://github.com/georgeguimaraes/claude-code-elixir --skill ecto-thinking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps Elixir developers design and reason about Ecto-based data models, schemas, contexts, and their interactions. It guides decisions on where to place responsibilities, how to model associations, and how to structure data access across bounded contexts.

Core Features & Use Cases

  • Context-oriented design: Define bounded contexts and map domain concepts to Ecto schemas, migrations, and Repo interactions.
  • Association & queries guidance: Plan has_many/belongs_to relationships, preload strategies, and query composition with Ecto.Query.
  • Migration & changeset best practices: Recommend migrations, changesets, and transactions (Ecto.Multi) to enforce invariants.
  • Use Case Scenarios: When adding a new table, creating a context, or optimizing data access patterns to avoid N+1 queries.

Quick Start

Request a high-level plan for adding a new table and a context, including schemas, associations, and a sample query, without writing full implementation details.

Frequently Asked Questions about ecto-thinking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design Ecto contexts and schemas for a new table in Elixir?

To design Ecto contexts and schemas for a new table in Elixir, map domain concepts to bounded contexts, define schema associations, and plan Repo interactions to structure data access boundaries across your application.

What's the best way to avoid N+1 queries with Ecto preloads?

To avoid N+1 queries with Ecto preloads, plan has_many and belongs_to relationships carefully and implement strategic preload strategies using Ecto.Query composition for scalable data access patterns in BEAM-based systems.

How does Ecto.Multi handle transactions for enforcing database invariants?

Ecto.Multi handles transactions by grouping multiple database operations into a single atomic transaction, enforcing invariants through changeset validations and ensuring all operations succeed or roll back together.

When should I separate data access into bounded contexts in an Elixir application?

You should separate data access into bounded contexts in an Elixir application when domain concepts map to distinct schemas and migrations, requiring clear boundaries to structure Repo interactions and isolate responsibilities.

Can I compose complex queries with Ecto.Query to optimize data access patterns?

Yes, you can compose complex queries with Ecto.Query to optimize data access patterns by combining query fragments, planning preload strategies, and structuring scalable data retrieval for BEAM-based systems.