agentleFS
vasceannievasceannie/slopgate/.cursor/rules/database.mdc

slopgate / rules

Cursor rule1 starsChanged 51 days agoMITView on GitHub

Database schema design, normalization, indexing, and integrity standards for SQL, NoSQL, and vector databases

We split this database.mdc into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document ACID expectations for relational transactions.

    line 16
  2. Distinctive:

    Always document the three schema layers: external schema, conceptual schema, internal schema.

    line 17
  3. Distinctive:

    Treat integrity as first-class: entity, domain, referential, and business-rule integrity must be explicit.

    line 18
  4. Distinctive:

    Never treat vector search as a drop-in for lexical search.

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
database.mdc
---
description: "Database schema design, normalization, indexing, and integrity standards for SQL, NoSQL, and vector databases"
globs: "**/*.{sql,prisma}"
alwaysApply: false
---

<!-- Generated by oh-my-agent. Source: .agents/rules/database.md -->

# Database Standards

## Core Rules

1. Choose model first, engine second: workload, access pattern, consistency, and scale drive DB selection.
2. For relational workloads, enforce at least **3NF** by default. Break 3NF only with explicit performance justification.
3. For distributed/non-relational workloads, model around aggregates and access paths; document **BASE** and consistency tradeoffs.
4. Document **ACID** expectations for relational transactions. For distributed tradeoffs, document consistency compromises explicitly.
5. Always document the three schema layers: **external schema**, **conceptual schema**, **internal schema**.
6. Treat integrity as first-class: entity, domain, referential, and business-rule integrity must be explicit.
7. Concurrency is never implicit: define transaction boundaries, locking strategy, and isolation level per critical flow.
8. Data standards are mandatory: naming, definition, format, allowed values, and validation rules.
9. Maintain living artifacts: glossary, schema decision log, and capacity estimation — update whenever the model changes.
10. Proactively flag anti-patterns and insecure shortcuts instead of silently implementing them.
11. Vector DBs are retrieval infrastructure, not source-of-truth databases. Store embeddings and metadata there; keep canonical documents elsewhere.
12. Never treat vector search as a drop-in for lexical search. Default to hybrid retrieval when exact match or explainability matters.
13. Embeddings are schema-like assets: version model, dimension, chunking, and preprocessing. Plan re-embedding migrations explicitly.
14. Schema or data changes on live tables follow expand-contract: additive expand, dual-write + batched backfill, verified read switch, delayed contract. Use lock-aware DDL with timeouts; ship destructive steps in a separate deploy after a soak window.
15. Tune queries from measurement and execution plans, never guesswork: measure, explain, nominate the dominant cost node, optimize, re-measure p95.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.