ecto-thinking

ecto-thinking is a skill for Claude Code from georgeguimaraes/claude-code-elixir. It costs 95 tokens per session (1,154 once invoked), scanned A, original, Apache-2.0.

A set of guidance for designing Elixir data layers with Ecto, the library used to work with databases. It explains how to separate business areas, database schemas, validation, and queries.

In plain words
What is it for?
Use it when adding tables or fields, creating contexts, writing migrations and queries, validating input, fixing N+1 queries, or designing Ecto data flows.
Why use it?
It helps avoid tightly connected database code and unclear boundaries between parts of an application. It also highlights common issues such as cross-context associations and inefficient queries.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the elixir plugin — 6 skills, 1 hook shipped together

Good fit Use it when adding tables or fields, creating contexts, writing migrations and queries, validating input, fixing N+1 queries, or designing Ecto data flows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/georgeguimaraes/claude-code-elixir/ecto-thinking
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add georgeguimaraes/claude-code-elixir --skill ecto-thinking
Clone the repo
git clone --depth 1 https://github.com/georgeguimaraes/claude-code-elixir

Made for: Claude Code.

Or install elixir, the plugin that ships this one along with the rest of its 6 skills, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ecto-thinking

README.md
[![agentmods](https://agentmods.dev/badge/skills/georgeguimaraes/claude-code-elixir/ecto-thinking/github.svg)](https://agentmods.dev/skills/georgeguimaraes/claude-code-elixir/ecto-thinking)
Your own site
<a href="https://agentmods.dev/skills/georgeguimaraes/claude-code-elixir/ecto-thinking"><img src="https://agentmods.dev/badge/skills/georgeguimaraes/claude-code-elixir/ecto-thinking/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ecto-thinking

Your own site · 80×15
<a href="https://agentmods.dev/skills/georgeguimaraes/claude-code-elixir/ecto-thinking"><img src="https://agentmods.dev/badge/skills/georgeguimaraes/claude-code-elixir/ecto-thinking.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,154 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00095 $0.01154
Opus 5.5 $0.00038 $0.00462
Sonnet 5.5 $0.00019 $0.00231
Haiku 4.5 $0.00010 $0.00115

Measured 2mo ago against content hash 1dc7d5b33069, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ecto-thinking scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/elixir/skills/ecto-thinking/SKILL.md · 144 lines

How it starts

The opening of the file, as written. The whole thing — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Query through the context, not across associations. Keeps contexts independent and testable.

DDD Patterns as Pipelines

def create_product(params) do
  params
  |> Products.build()       # Factory: unstructured → domain
  |> Products.validate()    # Aggregate: enforce invariants
  |> Products.insert()      # Repository: persist
end

Use events (as data structs) to compose bounded contexts with minimal coupling.

Schema ≠ Database Table

Use Case Approach
Database table Standard schema/2
Form validation only embedded_schema/1
API request/response Embedded schema or schemaless

Multiple Changesets per Schema

def registration_changeset(user, attrs)  # Full validation + password
def profile_changeset(user, attrs)       # Name, bio only
def admin_changeset(user, attrs)         # Role, verified_at

Different operations = different changesets.

Multi-Tenancy: Composite Foreign Keys

add :post_id, references(:posts, with: [org_id: :org_id], match: :full)

Use prepare_query/3 for automatic scoping. Raise if org_id missing.

Preload vs Join Trade-offs

Approach Best For
Separate preloads Has-many with many records (less memory)
Join preloads Belongs-to, has-one (single query)

Read the full file on GitHub · 144 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 144 lines · 95 tokens per session scan A 1dc7d5b33069

Subscribe to this mod's changes

ecto-thinking is a skill published in the GitHub repository georgeguimaraes/claude-code-elixir (168 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 95 tokens to every session and 1,154 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

elixir

Use when writing or refactoring Elixir/OTP on the BEAM — GenServers, supervision trees and restart strategies, pattern matching, mix projects and releases — or when processes misbehave (restart loops, mailbox growth, call timeouts). NOT a Phoenix web app, LiveView, Ecto or channels (that is phoenix).

ericrisco/rsc-harness · 72 tokens

phoenix

Use when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between domain logic and the web layer. Covers the classic LiveView over-rendering and Ecto N+1 traps. NOT pure OTP work with no web or Ecto layer …

ericrisco/rsc-harness · 89 tokens

phpunit-migration-test-generation

Use this skill when the user asks to generate, write, or create migration tests for a Shopware 6 migration class — phrases like "generate migration tests", "write a migration test", "create migration test", "test this migration", "test Migration1234Foo". Analyzes the source migration's SQL operations to pick an…

shopwareLabs/ai-coding-tools · 141 tokens

elixir-expert

Expert-level Elixir, Phoenix, OTP, and concurrent systems. Use when the user mentions Phoenix, OTP, Erlang, concurrent, or functional, or when the task involves Elixir Fundamentals or Phoenix Framework.

personamanagmentlayer/pcl · 47 tokens

offensive-sqli

SQL injection testing skill for offensive security assessments and bug bounty hunting. Covers error-based, UNION-based, boolean/time-based blind, out-of-band, second-order, NoSQL, GraphQL, WebSocket, and JSON-operator SQLi. Includes WAF bypass techniques, database-specific exploitation (MySQL, MSSQL, PostgreSQL…

Miosa-osa/OSA · 117 tokens

readonly-review

Run a no-network read-only review practice with two explorer steps and one synthesis step.

Ranvier-Technologies/pixir · 20 tokens