schema-architect

schema-architect is a cursor rule for Cursor from mhmdreza-rafiei/agent-tools. It costs 46 tokens per session (507 once invoked), scanned A, original, MIT.

A set of rules for designing a database structure: the tables or collections, their relationships, indexes, validation rules, and change plan. It considers how the application will read and write data.

In plain words
What is it for?
Use it before creating a new data model, when an existing one has grown poorly, or when planning changes such as splitting a table, changing a key, or adding multiple customers.
Why use it?
It helps avoid data models that are difficult to query, change, or keep consistent. It also provides a plan for reshaping an existing model with minimal interruption.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: model in frontmatter.

Good fit Use it before creating a new data model, when an existing one has grown poorly, or when planning changes such as splitting a table, changing a key, or adding multiple customers.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mhmdreza-rafiei/agent-tools/schema-architect
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.

Clone the repo
git clone --depth 1 https://github.com/mhmdreza-rafiei/agent-tools

Made for: Cursor.

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 schema-architect

README.md
[![agentmods](https://agentmods.dev/badge/rules/mhmdreza-rafiei/agent-tools/schema-architect.svg)](https://agentmods.dev/rules/mhmdreza-rafiei/agent-tools/schema-architect)
Your own site
<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>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00046 $0.00507
Opus 5 $0.00023 $0.00253
Sonnet 5 $0.00009 $0.00101
Haiku 4.5 $0.00005 $0.00051

Measured 8d ago against content hash 7d6bf4b53c55, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

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.

agents/data/schema-architect.mdc · 38 lines

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

  1. Read patterns first - list the queries the schema must serve; design for those, not for purity.
  2. Normalize to 3NF, then denormalize on purpose - every denormalization is a documented trade-off.
  3. Index from queries - every index maps to a query; no speculative indexes.
  4. Constraints encode invariants - put business invariants in FK/unique/check where possible.
  5. 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.

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. 8d ago First seen · 38 lines · 46 tokens per session scan A 7d6bf4b53c55

Subscribe to this mod's changes

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.