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/tmj-90/gaffer/database-schema-designernpx skills add tmj-90/gaffer --skill database-schema-designergit clone --depth 1 https://github.com/tmj-90/gafferWrote 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/skills/tmj-90/gaffer/database-schema-designer)<a href="https://agentmods.dev/skills/tmj-90/gaffer/database-schema-designer"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/database-schema-designer.svg" alt="Measured on agentmods" 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 | $0.00075 | $0.01136 |
| Opus 5 | $0.00037 | $0.00568 |
| Sonnet 5 | $0.00015 | $0.00227 |
| Haiku 4.5 | $0.00007 | $0.00114 |
Grade A, and why
database-schema-designer 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 5d 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 — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Design schemas that survive production
Normalise first. Index for query patterns. Never sacrifice data integrity for convenience.
Design process
Step 1 — Requirements → Entities
Extract nouns from the requirement. Each noun that has attributes and participates in relationships is likely an entity. Resist making everything a single wide table.
Step 2 — Relationships
Identify cardinality before choosing the table structure:
| Relationship | Implementation |
|---|---|
| 1:1 | Foreign key on the less-common side (or same table if always loaded together) |
| 1:N | Foreign key on the N side |
| M:N | Junction table with FK to both sides; add attributes to the junction if needed |
Step 3 — Normalisation
Target 3NF for transactional data:
- 1NF — atomic values; no repeating groups; primary key identifies each row.
- 2NF — no partial dependencies (non-key column depends on the whole PK, not a subset).
- 3NF — no transitive dependencies (non-key column depends only on the PK, not on another non-key column).
Denormalise deliberately for read-heavy analytics tables — document the trade-off.
Standard conventions
- Primary key:
id(UUID v7 for distributed systems; BIGSERIAL for single-node). - Timestamps:
created_at TIMESTAMPTZ DEFAULT now(),updated_at TIMESTAMPTZ DEFAULT now(). - Soft delete:
deleted_at TIMESTAMPTZnullable — add a partial indexWHERE deleted_at IS NULL. - Audit trail: separate
audit_logtable withentity_type,entity_id,action,actor_id,changed_at,before,after. - Multi-tenancy:
tenant_idon every tenant-scoped table; composite primary key or FK constraint; RLS policy.
Index strategy
- Index every foreign key (databases do not do this automatically).
- Add composite indexes for the most common
WHERE col1 = ? AND col2 = ?patterns. - Partial indexes for filtered queries (
WHERE deleted_at IS NULL,WHERE status = 'active'). - Covering indexes (
INCLUDE (col)) to avoid heap lookups on hot read paths. - Drop indexes that are never used — they slow writes.
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.
- 5d ago First seen · 93 lines · 75 tokens per session scan A f1c39d70b532
database-schema-designer is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 4d ago), licensed Apache-2.0. It adds 75 tokens to every session and 1,136 once invoked, about $0.0004 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-query-profiler
Profile database query profiler operations. Auto-activating skill for Performance Testing. Triggers on: database query profiler, database query profiler Part of the Performance Testing skill category. Use when working with database query profiler functionality. Trigger with phrases like "database query profiler"…
database-schema-designer
Build database schema designer operations. Auto-activating skill for Backend Development. Triggers on: database schema designer, database schema designer Part of the Backend Development skill category. Use when working with database schema designer functionality. Trigger with phrases like "database schema designer"…
database-schema-visualizer
Generate database schema visualizer operations. Auto-activating skill for Visual Content. Triggers on: database schema visualizer, database schema visualizer Part of the Visual Content skill category. Use when working with database schema visualizer functionality. Trigger with phrases like "database schema…
database-test-helper
Assist with database test helper operations. Auto-activating skill for Test Automation. Triggers on: database test helper, database test helper Part of the Test Automation skill category. Use when writing or running tests. Trigger with phrases like "database test helper", "database helper", "database".
dbt-test-creator
Create dbt test creator operations. Auto-activating skill for Data Pipelines. Triggers on: dbt test creator, dbt test creator Part of the Data Pipelines skill category. Use when writing or running tests. Trigger with phrases like "dbt test creator", "dbt creator", "dbt".
database-operations
Instructions on how to write database queries with SQLAlchemy.