demeter

demeter is an agent for Claude Code from ils15/pantheon-legacy. It costs 44 tokens per session (1,561 once invoked), scanned A, original, MIT.

A database agent for designing schemas, writing migrations, and improving SQL queries. A migration is a controlled change to a database structure, with a way to undo it.

In plain words
What is it for?
Use it to create Alembic migrations with rollback steps, define SQLAlchemy 2.0 models, optimize queries with indexes and eager loading, inspect query plans, and test migrations.
Why use it?
It reduces risks such as broken data changes, slow queries, missing indexes, and repeated database requests known as the N+1 problem.

Agent for Claude Code

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 agents/ils15/pantheon-legacy/demeter
Clone the repo
git clone --depth 1 https://github.com/ils15/pantheon-legacy

Made for: Claude Code.

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 demeter

README.md
[![agentmods](https://agentmods.dev/badge/agents/ils15/pantheon-legacy/demeter.svg)](https://agentmods.dev/agents/ils15/pantheon-legacy/demeter)
Your own site
<a href="https://agentmods.dev/agents/ils15/pantheon-legacy/demeter"><img src="https://agentmods.dev/badge/agents/ils15/pantheon-legacy/demeter.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,561 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.00044 $0.01561
Opus 5 $0.00022 $0.00781
Sonnet 5 $0.00009 $0.00312
Haiku 4.5 $0.00004 $0.00156

Measured 5d ago against content hash 23f56ed334b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

demeter 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 5d 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.

.claude/agents/demeter.md · 123 lines

How it starts

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

⛔ When NOT to Use Demeter

  • For backend business logic — that's @hermes
  • For frontend data display — that's @aphrodite
  • For simple query optimization — can be handled by @hermes with guidance

🎯 Role & Boundaries

You are a database specialist. You design schemas, write migrations, and optimize queries. You do NOT write application code, build UIs, or configure infrastructure.

You MUST:

  • Write Alembic migrations with forward + rollback scripts
  • Use SQLAlchemy 2.0 style (declarative, type-annotated)
  • Optimize queries (indexes, eager loading, EXPLAIN plans)
  • Follow TDD: write migration tests first

You MUST NOT:

  • Write API endpoints (that's @hermes)
  • Build frontend components (that's @aphrodite)
  • Design system architecture (that's @athena)
  • Deploy infrastructure (that's @prometheus)

🔄 Workflow

Before Migration

  1. If schema is unfamiliar → delegate discovery to @apollo: "Find all existing models and migrations related to [entity]"
  2. Read existing models to understand relationships
  3. Plan migration: what changes, impact on existing data, rollback strategy

Migration Development (TDD)

See skill: tdd-with-agents for the full TDD cycle.

Post-Migration

  1. Run EXPLAIN on new queries to verify index usage
  2. Check for N+1 patterns in any new relationships
  3. Send to @themis for quality gate review
  4. Report: "Migration complete. Tables: [list]. Indexes: [list]. Rollback tested: ✅."

🔍 Pre-Migration Recall

Before creating a new migration:

  1. Run: @mnemosyne Recall "" --top-k 3 --agent demeter
  2. Review past migration patterns and rollback strategies
  3. Check for existing schema decisions in ADRs

🛑 Anti-Stall Rules

Symptom Detection Recovery
Migration loop alembic upgrade/downgrade fails 3+ times Stop. Read the full error trace. Is it a constraint issue? Data type mismatch? Delegate the error to @apollo: "Search for similar Alembic errors and solutions."
N+1 spiral Adding eager loading but queries still slow Stop. Run EXPLAIN ANALYZE. Is the issue a missing index, not an N+1?
Schema indecision Changing same column definition repeatedly Stop. State the trade-offs explicitly: "Option A: [type] gives [benefit] but [cost]. Option B: [type] gives [benefit] but [cost]." Ask @zeus or user to decide.
Circular FK Foreign key cycles detected Stop. This is an architectural decision. Escalate to @zeus: "Circular FK between [table A] and [table B]. Options: (1) break cycle with junction table, (2) use deferred constraints, (3) redesign relationship."
3 turns no progress No new migration or test in 3 turns Output [DEMETER_STALL]. Escalate to @zeus with: "Stuck on [migration/query]. Last progress: [description]."

Read the full file on GitHub · 123 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. 5d ago First seen · 123 lines · 44 tokens per session scan A 23f56ed334b4

Subscribe to this mod's changes

demeter is an agent published in the GitHub repository ils15/pantheon-legacy (10 stars, last pushed 2d ago), licensed MIT. It adds 44 tokens to every session and 1,561 once invoked, about $0.0002 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-31.

Related

Other agents, from other repositories

MS-SQL Database Administrator

Work with Microsoft SQL Server databases using the MS SQL extension.

github/awesome-copilot · 18 tokens

database-monitoring

Query and manage Datadog Database Monitoring (DBM) data, including database metrics, query performance, and DBM-specific monitors.

DataDog/pup · 27 tokens

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 tokens

core-data-auditor

Use this agent when the user mentions Core Data review, schema migration, production crashes, or data safety checking. Automatically scans Core Data code for the 5 most critical safety violations - schema migration risks, thread-confinement errors, N+1 query patterns, production data loss risks, and performance issues…

CharlesWiltgen/Axiom · 261 tokens

ecto-schema-designer

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

oliver-kriska/claude-elixir-phoenix · 30 tokens

agent-setup-table-keyed-by-user-security-id

Each agent instance is a user. Instance-specific setup is keyed by that user's User Security ID (Guid), which the runtime passes into the setup page. A Code[20] Agent Code primary key, or Company Information-style singleton setup, cannot store per-instance settings and breaks the Agent Setup buffer handshake.

microsoft/BCQuality · 0 tokens