ecto-thinking

ecto-thinking is a skill for Claude Code, Codex 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 CodeCodex

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

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.

agentmods
npx agentmods add skills/georgeguimaraes/claude-code-elixir/ecto-thinking
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00095 $0.01154
Opus 5 $0.00048 $0.00577
Sonnet 5 $0.00019 $0.00231
Haiku 4.5 $0.00010 $0.00115

Measured 4d ago against content hash 1dc7d5b33069, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 4mo ago), licensed Apache-2.0. It adds 95 tokens to every session and 1,154 once invoked, about $0.0005 per session on Opus 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

koko

Develop and extend Koko — the Elixir/OTP agent living alongside joelclaw. Covers OTP patterns, Redis bridge protocol, shadow execution, and workload implementation.

joelhooks/joelclaw · 37 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

pixir-delegate

Use Pixir as a headless subagent runtime from Claude Code or any harness with skill ! preprocessing (Codex roots and other no-hydration hosts use pixir-delegate-codex instead) — one-shot workers (pixir --json), parallel fan-out to N children (pixir delegate --spec), resumable steering (pixir resume), evidence…

Ranvier-Technologies/pixir · 126 tokens

pixir-delegate-codex

Use when a Codex CLI/Desktop root should fan out subagents, delegate to Pixir workers, run parallel workers, or manage a resident delegation daemon via Pixir Delegate; covers Codex preflight, AGENTS.md, approvals/sandbox, dry-run, daemon start/status/attach/cancel, closure evidence, and audited single-run execution…

Ranvier-Technologies/pixir · 89 tokens

pixir-diagnostics

Diagnose Pixir and T3 Code Pixir incidents from local canonical evidence. Use when a Pixir run, ACP/T3 thread, subagent/workflow, provider replay, or daily-driver dogfood session appears stuck, inconsistent, missing tool output, or hard to classify.

Ranvier-Technologies/pixir · 61 tokens

readonly-review

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

Ranvier-Technologies/pixir · 20 tokens