schema

schema is a cursor rule for Cursor from GktuOktay/ai-skills. It costs 0 tokens per session (1,112 once invoked), scanned A, original, MIT.

A guide to designing data structures for relational databases, NoSQL databases, and APIs. It covers how to organize fields and relationships so data stays consistent and applications can grow.

In plain words
What is it for?
Use it when planning tables, indexes, NoSQL collections, or API request and response formats.
Why use it?
It helps avoid duplicated or inconsistent data, slow queries, and schema choices that become difficult to change later.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when planning tables, indexes, NoSQL collections, or API request and…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/gktuoktay/ai-skills/schema
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/GktuOktay/ai-skills

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/gktuoktay/ai-skills/schema.svg)](https://agentmods.dev/rules/gktuoktay/ai-skills/schema)
Your own site
<a href="https://agentmods.dev/rules/gktuoktay/ai-skills/schema"><img src="https://agentmods.dev/badge/rules/gktuoktay/ai-skills/schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,112 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.00000 $0.01112
Opus 5 $0.00000 $0.00556
Sonnet 5 $0.00000 $0.00222
Haiku 4.5 $0.00000 $0.00111

Measured 3d ago against content hash c766670540f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

schema 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 3d 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/cursor/rules/schema.mdc · 88 lines

How it starts

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

Database and API Schema Design

Effective schema design is foundational to application performance, data integrity, and future scalability. This guide covers relational, NoSQL, and API schema design principles.

1. Relational Database Schema Design (SQL)

Relational databases (PostgreSQL, MySQL) excel at structured data with complex relationships.

Normalization

The process of organizing data to reduce redundancy and improve data integrity.

  • 1NF: Eliminate repeating groups (each column contains atomic values).
  • 2NF: Eliminate partial dependencies (non-key columns depend on the entire primary key).
  • 3NF: Eliminate transitive dependencies (non-key columns depend only on the primary key, not on other non-key columns). Rule of thumb: Normalize to 3NF by default, denormalize only for specific read-performance bottlenecks.

Indexing

Indexes drastically speed up read operations but slow down writes and consume disk space.

  • Primary Keys: Automatically indexed.
  • Foreign Keys: Always index foreign keys to speed up JOIN operations.
  • Frequent Queries: Create B-Tree indexes on columns frequently used in WHERE, ORDER BY, or GROUP BY clauses.
  • Composite Indexes: Use for queries that filter on multiple columns simultaneously (order matters: put the most selective column first).

Constraints

Enforce data integrity at the database level.

  • NOT NULL, UNIQUE, CHECK (e.g., price > 0), FOREIGN KEY (referential integrity).

Migrations

Always use a migration tool (e.g., Prisma, Flyway, Alembic) to version control schema changes. Never modify the production schema manually.

2. NoSQL Schema Patterns

NoSQL databases (MongoDB, DynamoDB, Neo4j) are chosen for flexibility, horizontal scalability, or specific data models.

Document Databases (MongoDB)

  • Embedding vs. Referencing:
    • Embed data (sub-documents) if it is frequently accessed together and rarely changes (e.g., User addresses).
    • Reference data (store IDs) if the nested data is large, grows unbounded, or is accessed independently (e.g., Post comments).

Read the full file on GitHub · 88 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. 3d ago First seen · 88 lines · 1,112 tokens per session scan A c766670540f9

Subscribe to this mod's changes

schema is a cursor rule published in the GitHub repository GktuOktay/ai-skills (2 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,112 tokens. 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.