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.
npx agentmods add skills/soulcodex/agentic/relational-database-designnpx skills add soulcodex/agentic --skill relational-database-designgit clone --depth 1 https://github.com/soulcodex/agenticWhat 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 | $0.00055 | $0.01192 |
| Opus 5 | $0.00028 | $0.00596 |
| Sonnet 5 | $0.00011 | $0.00238 |
| Haiku 4.5 | $0.00006 | $0.00119 |
Grade A, and why
relational-database-design 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.
How it starts
The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Relational Database Design Skill
Step 1 — Gather Requirements
Ask (or infer from context) before designing anything:
- What are the core domain entities and their relationships?
- What are the primary access patterns (queries the application must answer)?
- What are the expected data volumes (rows per table, growth rate)?
- What are the SLA and consistency requirements (read latency, write throughput, ACID)?
- Are there regulatory or retention requirements (GDPR deletion, audit trails)?
- Which database engine will be used (PostgreSQL, MySQL, SQLite, …)?
Step 2 — Draft Entity List and Relationships
Enumerate entities and classify relationships:
- One-to-many: a parent row owns many child rows (
orders→line_items). - Many-to-many: resolve via a join table (
users↔rolesviauser_roles). - One-to-one: split tables only when the subset is queried independently or has different access control requirements.
Sketch an ERD in text or ASCII before writing DDL:
users (id, email, created_at)
└── orders (id, user_id FK, status, placed_at)
└── line_items (id, order_id FK, product_id FK, quantity, unit_price)
products (id, sku, name, price)
Step 3 — Apply Normalization
Normalize to 3NF as the default:
- 1NF: atomic values per column, no repeating groups.
- 2NF: every non-key column depends on the entire primary key (relevant for composite PKs).
- 3NF: no transitive dependencies — non-key columns depend only on the primary key.
Document any intentional denormalization with a comment explaining the trade-off:
-- Denormalized: product_name copied at order time so historical orders
-- remain readable even if the product is later renamed or deleted.
line_items.product_name TEXT NOT NULL
Step 4 — Define Indexes
Map each identified access pattern to an index strategy:
| Access pattern | Index type | Example |
|---|---|---|
| Equality lookup by FK | B-tree | CREATE INDEX ON orders(user_id) |
| Range query on timestamp | B-tree | CREATE INDEX ON orders(placed_at) |
| Partial: active records only | Partial B-tree | CREATE INDEX ON orders(user_id) WHERE status = 'active' |
| Case-insensitive lookup | Expression | CREATE INDEX ON users(lower(email)) |
| Avoid heap fetch on hot query | Covering | CREATE INDEX ON orders(user_id) INCLUDE (status, placed_at) |
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.
- 3d ago First seen · 124 lines · 55 tokens per session scan A 6692d6c856db
relational-database-design is a skill published in the GitHub repository soulcodex/agentic (10 stars, last pushed 3d ago), licensed MIT. It adds 55 tokens to every session and 1,192 once invoked, about $0.0003 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 skills, from other repositories
Database Schema Reviewer
Reviews database schemas for normalization issues, missing indexes, naming inconsistencies, and scalability risks.
SQL Query Optimizer
Reviews SQL queries for performance issues and rewrites them with optimized execution plans.
sql-agent
Write, optimize, and explain SQL queries. Use when user needs to write a query, debug slow SQL, understand a query plan, or design a schema.
database-design
Design efficient database schemas with proper indexing, relationships, normalization, and migration strategies. Use when creating or modifying database structures. Triggers on: database schema, tables, migrations, indexes, SQL, queries, data modeling.
sql-sentinel
Audit SQL for the cost & performance anti-patterns that burn warehouse credits. Catches SELECT , full-table scans, non-sargable predicates, Cartesian joins, NULL-trap NOT IN, and 17 more rules. Scores warehouse health 0-100 and outputs a prioritized cost-reduction plan for BigQuery, Snowflake, Redshift, and Postgres.
sql-expert
Expert-level SQL database design, querying, optimization, and administration across PostgreSQL, MySQL, and SQL Server.