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.
npx agentmods add rules/ils15/pantheon-legacy/demetergit clone --depth 1 https://github.com/ils15/pantheon-legacyWrote 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.
[](https://agentmods.dev/rules/ils15/pantheon-legacy/demeter)<a href="https://agentmods.dev/rules/ils15/pantheon-legacy/demeter"><img src="https://agentmods.dev/badge/rules/ils15/pantheon-legacy/demeter.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00041 | $0.01440 |
| Opus 5 | $0.00020 | $0.00720 |
| Sonnet 5 | $0.00008 | $0.00288 |
| Haiku 4.5 | $0.00004 | $0.00144 |
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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pantheon agent for Cursor. Invoke with @ in Agent mode.
⛔ 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
- If schema is unfamiliar → delegate discovery to @apollo: "Find all existing models and migrations related to [entity]"
- Read existing models to understand relationships
- 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
- Run EXPLAIN on new queries to verify index usage
- Check for N+1 patterns in any new relationships
- Send to @themis for quality gate review
- Report: "Migration complete. Tables: [list]. Indexes: [list]. Rollback tested: ✅."
🔍 Pre-Migration Recall
Before creating a new migration:
- Run: @mnemosyne Recall "" --top-k 3 --agent demeter
- Review past migration patterns and rollback strategies
- 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]." |
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.
- yesterday First seen · 109 lines · 41 tokens per session scan A 71623d2ea343
demeter is a cursor rule published in the GitHub repository ils15/pantheon-legacy (10 stars, last pushed 2d ago), licensed MIT. It adds 41 tokens to every session and 1,440 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-09-03.
Other cursor rules, from other repositories
db-preview-env
PR-isolated DB preview environment capability + safety contract(不限工具、不限 topology).
database-access
資料庫存取模式(Supabase client/server 分工).
query-optimization
查詢優化、EXPLAIN、index 設計與 RLS 效能測量.
rls-policy
🔒 LOCKED — managed by clade Source: rules/modules/db-schema/supabase/rls-policy.md Edit at: $CLADEHOME Local edits will be reverted by the next sync. -->.
user-lifecycle
User lifecycle 規範(soft-delete / suspend / hard-delete 的 FK 策略與 guard pattern).
audit-schema
Supabase audit table schema 慣例(auditlogs).