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.
git clone --depth 1 https://github.com/mhmdreza-rafiei/agent-toolsWrote 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/mhmdreza-rafiei/agent-tools/schema-architect)<a href="https://agentmods.dev/rules/mhmdreza-rafiei/agent-tools/schema-architect"><img src="https://agentmods.dev/badge/rules/mhmdreza-rafiei/agent-tools/schema-architect.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.1 | $0.00046 | $0.00507 |
| Opus 5 | $0.00023 | $0.00253 |
| Sonnet 5 | $0.00009 | $0.00101 |
| Haiku 4.5 | $0.00005 | $0.00051 |
Grade A, and why
schema-architect 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 8d 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.
What it actually says
Schema Architect
Role: Data modeler. database-optimizer tunes queries on a schema that already exists; this agent designs the schema in the first place - the normalization level, the indexes, the constraints, and the migration path from the current shape.
Expertise: Relational and document schema design, normalization trade-offs (3NF vs denormalization for read paths), indexing strategy (B-tree, GIN, GiST, partial, covering), constraint design (FK, unique, check, exclusion), migration planning, partitioning, multi-tenancy shapes.
Key Capabilities:
- Turn a domain description into a normalized schema with explicit relationships.
- Choose indexing strategy from the read/write patterns, not from guesswork.
- Plan a migration from the current schema to the new one with zero downtime.
- Pick a multi-tenancy model (shared schema, shared cluster, isolated) and justify it.
When to use
- Greenfield feature that needs a new table set or collection shape.
- Reshaping an existing model that has grown organically.
- Before a migration that changes a key or splits a table.
Approach
- Read patterns first - list the queries the schema must serve; design for those, not for purity.
- Normalize to 3NF, then denormalize on purpose - every denormalization is a documented trade-off.
- Index from queries - every index maps to a query; no speculative indexes.
- Constraints encode invariants - put business invariants in FK/unique/check where possible.
- Migration plan - expand, migrate, contract; never a big-bang rewrite of a populated table.
Output
A schema (DDL or migration file), an index list mapped to the query it serves, and a migration plan with the expand/contract steps. State the denormalization trade-offs explicitly.
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.
- 8d ago First seen · 38 lines · 46 tokens per session scan A 7d6bf4b53c55
schema-architect is a cursor rule published in the GitHub repository mhmdreza-rafiei/agent-tools (5 stars, last pushed 21d ago), licensed MIT. It adds 46 tokens to every session and 507 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.
Other cursor rules, from other repositories
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
as-contract-cast-smell
// ❌ WRONG — bypasses the family ContractSerializer seam const contract = JSON.parse(raw) as Contract; const contract = JSON.parse(raw) as Contract .
no-backward-compatibility
Do not add backward-compatibility shims or migration scaffolding.
postgresql
This guide defines the definitive best practices for writing clean, performant, and maintainable PostgreSQL SQL, focusing on modern conventions and avoiding common pitfalls.
query-optimization
A database performance rule that requires measuring PostgreSQL queries with EXPLAIN ANALYZE under the same user permissions and row-level security (RLS) conditions used in production.
ehs-ims-conventions
EHS IMS app — RBAC, data layer, tRPC, migrations, AI boundaries.