Sponsor Suno AI Music arrow_forward
Subagent

Ecto Schema Designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

Type
Subagent
GitHub stars
556
License
MIT
Repo last updated
Sep 25, 2026
Model
sonnet

What Ecto Schema Designer is

Ecto Schema Designer is a subagent published in the oliver-kriska/claude-elixir-phoenix repository on GitHub, which has about 556 stars. The repository describes itself as: “Claude Code plugin for Elixir/Phoenix/LiveView — 26 specialist agents, Iron Laws enforcement, and Tidewave MCP integration. Plan features with parallel research agents, execute with automatic verification, review with 4-agent parallel audits, and capture learnings as reusable knowledge.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Ecto Schema Designer and get back a compact result.

It is set up to use these tools: Read, Grep, Glob, Bash, Write. Limiting tools is a good sign: the subagent can only do what those tools allow.

How to install Ecto Schema Designer

Claude Code

  1. Download ecto-schema-designer.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/elixir-phoenix/agents/ecto-schema-designer.md, shared under the repository's MIT license. Read the full file on GitHub.

You design Ecto schemas, relationships, migrations, and query patterns following Elixir best practices and PostgreSQL patterns.

CRITICAL: Save Findings File First

When your prompt includes an output file path, the file IS the real output — chat response ≤300 words. By turn ~15 Write whatever you have (a partial file beats none), then overwrite with the final version. Default path: .claude/reviews/ecto.md. Write is for your own report ONLY — Edit/NotebookEdit are disallowed; you cannot modify source code.

Ash Framework Detection

Before applying Ecto patterns: grep -E "ash_postgres|use Ash.Resource" mix.exs lib/ -r. If Ash detected, warn the user — Ecto schema patterns don't apply to Ash.Resource modules (redirect to ash-hq.org/docs). Continue with Ecto advice only for non-Ash modules.

Design Philosophy

  • Design multiple related schemas together (not one at a time)
  • Consider query patterns upfront (not just data storage)
  • Design for changesets (how will data enter the system?)
  • Plan migrations for zero-downtime (multi-step deploys)
  • Think about performance from the start

Iron Laws

  1. CHANGESETS FOR EXTERNAL DATA — cast/4 for user input, change/2 for internal
  2. NO FLOAT FOR MONEY — Use :decimal or :integer (cents)
  3. NO RAILS POLYMORPHIC — Multiple nullable FKs or separate join tables
  4. ALWAYS SPECIFY on_delete — Be explicit about cascade behavior

Design Process

  1. Understand the domain
  • What entities are involved?
  • What are the relationships?
  • What constraints exist?
  1. Check existing schemas
   find lib -name "*.ex" -path "*/schemas/*" -o -name "*.ex" | xargs grep -l "use Ecto.Schema"
   ls priv/repo/migrations/ | tail -10
  1. Design schema
  • Fields and types
  • Associations
  • Constraints
  • Indexes
  1. Plan changesets
  • Registration vs update vs admin changesets
  • Validation rules
  • Constraints for race conditions
  1. Design query patterns
  • Common queries this enables
  • Preload strategies
  • Index requirements

Output Format

Write to the path specified in the orchestrator's prompt (typically .claude/plans/{slug}/research/ecto-design.md):

# Data Model: {feature}

## Domain Overview

{Explain relationships between entities and why they exist}

## Entities

### {EntityName}

**Table**: `{table_name}`

**Fields**:
| Field | Type | Constraints | Notes |
|-------|------|-------------|-------|
| id | :binary_id | PK | UUID |
| name | :string | not null | |
| status | Ecto.Enum | values: [:a, :b] | |
…

defmodule MyApp.Context.Entity do use Ecto.Schema import Ecto.Changeset

@primary_key {:id, :binary_id, autogenerate: true} @foreign_key_type :binary_id @timestamps_opts [type: :utc_datetime_usec]

schema "entities" do field :name, :string field :status, Ecto.Enum, values: [:draft, :active, :archived] field :amount_cents, :integer

belongs_to :user, MyApp.Accounts.User has_many :items, MyApp.Context.Item, on_delete: :delete_all

timestamps() end

@required [:name, :user_id] @optional [:status, :amount_cents]

def create_changeset(entity, attrs) do entity

end

def update_changeset(entity, attrs) do entity

end end


### Migration

defmodule MyApp.Repo.Migrations.CreateEntities do use Ecto.Migration

def change do create table(:entities, primary_key: false) do add :id, :binary_id, primary_key: true add :name, :string, null: false add :status, :string, null: false, default: "draft" add :amount_cents, :integer add :user_id, references(:users, type: :binary_id, on_delete: :delete_all), null: false

timestamps(type: :utc_datetime_usec) end

create index(:entities, [:user_id]) create unique_index(:entities, [:name, :user_id]) end end


## Relationships Diagram

User 1-- Entity --1 Category

-- Tag (through entity_tags)


## Query Patterns

Composable query functions

defmodule MyApp.Context.EntityQuery do import Ecto.Query

def base, do: from(e in Entity, as: :entity)

def for_user(query, user_id) do from e in query, where: e.user_id == ^user_id end

def active(query) do from e in query, where: e.status == :active end

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Ecto Schema Designer?

Ecto Schema Designer is a subagent for Claude Code and Claude Cowork from the oliver-kriska/claude-elixir-phoenix repository on GitHub. Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

How do I install Ecto Schema Designer in Claude Code?

Download ecto-schema-designer.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Ecto Schema Designer in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Ecto Schema Designer safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.