Ecto Schema Designer
Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.
- Type
- Subagent
- Repository
- oliver-kriska/claude-elixir-phoenix
- 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
- 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.
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.
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
- CHANGESETS FOR EXTERNAL DATA — cast/4 for user input, change/2 for internal
- NO FLOAT FOR MONEY — Use :decimal or :integer (cents)
- NO RAILS POLYMORPHIC — Multiple nullable FKs or separate join tables
- ALWAYS SPECIFY on_delete — Be explicit about cascade behavior
Design Process
- Understand the domain
- What entities are involved?
- What are the relationships?
- What constraints exist?
- Check existing schemas
find lib -name "*.ex" -path "*/schemas/*" -o -name "*.ex" | xargs grep -l "use Ecto.Schema"
ls priv/repo/migrations/ | tail -10- Design schema
- Fields and types
- Associations
- Constraints
- Indexes
- Plan changesets
- Registration vs update vs admin changesets
- Validation rules
- Constraints for race conditions
- 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
### Migrationdefmodule 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 DiagramUser 1-- Entity --1 Category
-- Tag (through entity_tags)
## Query PatternsComposable 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
- Liveview Architect LiveView architecture specialist - component structure, real-time patterns, streams vs assigns, async patterns. Use proactively when planning interactive features. Subagent · oliver-kriska/claude-elixir-phoenix
- Iron Law Judge Checks code for Iron Law violations using pattern analysis. Use proactively after code changes or as part of review. Subagent · oliver-kriska/claude-elixir-phoenix
- Parallel Reviewer Parallel code review using 4 specialist agents (elixir-reviewer, security-analyzer, testing-reviewer, verification-runner). Use for thorough review of significant changes. Subagent · oliver-kriska/claude-elixir-phoenix
- Planning Orchestrator Fans out and compresses parallel Elixir/Phoenix planning research (codebase patterns, libraries, schema/OTP/LiveView design) into one digest. Use when /phx:plan needs 3+ research agents; returns findings only, never plans or asks the user. Subagent · oliver-kriska/claude-elixir-phoenix
- Elixir Reviewer Expert Elixir/Phoenix code reviewer - idioms, patterns, performance, conventions. Use proactively after writing Elixir code. Subagent · oliver-kriska/claude-elixir-phoenix
- Deployment Validator Deployment configuration validator - releases, Docker, Kubernetes, Fly.io. Use proactively before deploying to production. Subagent · oliver-kriska/claude-elixir-phoenix
- Hex Deps Triager Triage Hex supply-chain audit findings in Elixir/Phoenix — review diff windows and metadata to produce structured security verdicts. Use after /phx:deps-audit. Subagent · oliver-kriska/claude-elixir-phoenix
- Deep Bug Investigator Deep bug investigation using 4 parallel subagents (reproduction, root cause, impact, fix strategy). Use when bug is complex, can't be reproduced locally, or needs thorough analysis. Spawns fresh-context subagents for each investigation track. Subagent · oliver-kriska/claude-elixir-phoenix