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/j4flmao/agent-skillsWrote 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/j4flmao/agent-skills/database-design-standards)<a href="https://agentmods.dev/rules/j4flmao/agent-skills/database-design-standards"><img src="https://agentmods.dev/badge/rules/j4flmao/agent-skills/database-design-standards/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/j4flmao/agent-skills/database-design-standards"><img src="https://agentmods.dev/badge/rules/j4flmao/agent-skills/database-design-standards.svg" alt="Reviewed on agentmods" width="80" 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.00021 | $0.00596 |
| Opus 5.5 | $0.00008 | $0.00238 |
| Sonnet 5.5 | $0.00004 | $0.00119 |
| Haiku 4.5 | $0.00002 | $0.00060 |
Grade A, and why
database-design-standards 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 27 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Design Standards
Cursor/AI MUST follow these rules when writing SQL, Prisma schemas, TypeORM entities, or Database migrations.
1. Primary Key Generation (Avoid Random UUIDv4 by Default)
- Rule: Do not use fully random
UUIDv4as the primary key of a large, write-heavy relational table unless there is a stated reason. - Why: Random keys insert into random B-tree leaf pages, which causes page splits, poor cache locality, and extra WAL/full-page writes. The cost is worst in clustered-index engines (MySQL InnoDB, SQL Server), where the table itself is ordered by the PK.
- Action: Use
BIGINT GENERATED ALWAYS AS IDENTITY(PostgreSQL; preferred overBIGSERIAL),UUIDv7(time-ordered, RFC 9562; nativeuuidv7()in PostgreSQL 18+),ULID, or Snowflake-style IDs. If IDs are exposed publicly and must not leak volume or creation time, keep an internal sequential PK and a separate random public ID.
2. Soft Deletes via Timestamps, Not Booleans
- Rule: Avoid
is_deleted BOOLEANfor soft deletes. - Action: Use
deleted_at TIMESTAMPTZ NULL. It records when the row was deleted and filters withWHERE deleted_at IS NULL. Keep uniqueness correct with a partial index:CREATE UNIQUE INDEX ... ON users (email) WHERE deleted_at IS NULL;. - Note: Soft delete is not erasure. Data subject to GDPR/CCPA deletion requests still needs a hard-delete or anonymization path.
3. Rely on the Database for Integrity
- Rule: Never enforce data integrity only in application code. "Check if the username exists, then insert" is a race condition.
- Action: Use
NOT NULL,UNIQUE,FOREIGN KEY, andCHECKconstraints (e.g.CHECK (price > 0)). Handle the conflict atomically (INSERT ... ON CONFLICT, catch the unique-violation error) instead of pre-checking.
4. N+1 Query Prevention
- Rule: When fetching a list of entities and their children, you MUST batch the child loads: SQL
JOINs orWHERE id = ANY($1), ORM eager loading (Prismainclude, Djangoselect_related/prefetch_related, SQLAlchemyselectinload, TypeORMrelations), orDataLoaderin GraphQL resolvers. - Rule: Index every foreign key column used in joins or filters. PostgreSQL does not create these indexes automatically.
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.
- 1mo ago Changed · +2 lines 084beba050f7
- 3mo ago First seen · 25 lines · 21 tokens per session scan A 62a63c0d09da
database-design-standards is a cursor rule published in the GitHub repository j4flmao/agent-skills (47 stars, last pushed 17d ago), licensed MIT. It adds 21 tokens to every session and 596 once invoked, about $0.0001 per session on Opus 5.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-05.
database-design-standards compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| database-design-standardsj4flmao/agent-skills | Cursor rule | 47 | 17d ago | MIT | A | 21 | Cursor |
| as-contract-cast-smellprisma/orm | Cursor rule | 48k | today | Apache-2.0 | A | 937 | Cursor |
| no-backward-compatibilityprisma/orm | Cursor rule | 48k | today | Apache-2.0 | A | 0 | Cursor |
| postgresqlsanjeed5/awesome-cursor-rules-mdc | Cursor rule | 3.6k | 11d ago | CC0-1.0 | A | 2,337 | Cursor |
| ehs-ims-conventionsSafetyMP/Autonomous-EHS-Management | Cursor rule | 9 | 5d ago | Apache-2.0 | A | 722 | Cursor |
| sync-timedb-archive-janitor-contractTACC/HPCPerfStats | Cursor rule | 60 | yesterday | LGPL-2.1 | A | 0 | Cursor |
| java-springboot-jpa-cursorrules-prompt-fileXD3an/awesome-ai-coding-all-in-one | Cursor rule | 14 | 2d ago | none | A | 1,006 | Cursor |