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 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/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/skills/tmj-90/gaffer/database-schema-designer"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/database-schema-designer.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.00075 | $0.01833 |
| Opus 5.5 | $0.00030 | $0.00733 |
| Sonnet 5.5 | $0.00015 | $0.00367 |
| Haiku 4.5 | $0.00007 | $0.00183 |
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 20d 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 — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Design schemas that survive production
A schema is the one place an invariant holds no matter which code path, process or
concurrent request writes. Normalise first, let constraints enforce the rules, index for
the real query patterns, and change it in steps that never block production. Sources:
PostgreSQL docs (constraints, CREATE INDEX, ALTER TABLE, transaction isolation, row
security); MySQL 8 reference (InnoDB locking, online DDL); Codd's normal forms as taught
in standard database texts.
Steps
- Read the existing schema and conventions.
search_lorefor the ORM, migration tool, naming, key strategy and tenancy model. Extend them; never introduce a second pattern. - Model entities and relationships. Nouns with attributes become tables. State cardinality before structure: 1:N → FK on the N side; M:N → junction table with a composite primary or unique key on the two FKs; 1:1 → FK with a UNIQUE constraint. Sketch the ERD (Mermaid is fine) in the plan or the evidence summary.
- Normalise to 3NF for transactional data. 1NF: atomic values, no repeating groups. 2NF: no column depends on part of a composite key. 3NF: no column depends on another non-key column. Denormalise only for a measured read need, and document who keeps the copy consistent (trigger, same-transaction write, or rebuild job).
- Write every invariant as a constraint — the application check alone is a race.
Under Read Committed (Postgres default) and Repeatable Read (MySQL InnoDB default),
two transactions can both "check, then insert" and both succeed:
- uniqueness →
UNIQUE; conditional ("one active subscription per user") → partial unique indexWHERE status = 'active'(Postgres) or a generated column (MySQL); - no overlapping ranges (bookings) → Postgres
EXCLUDE USING gist (room_id WITH =, during WITH &&)withbtree_gist, or serialise viaSELECT … FOR UPDATEon a parent; - value rules (
amount >= 0, allowed states) →CHECK; references → FK with an explicitON DELETE(RESTRICTunless cascade is truly intended); - counters and balances → a single
UPDATE … SET n = n + :d WHERE … AND n + :d >= 0, never read-modify-write in application code; concurrent edits to one row → optimisticversioncolumn (UPDATE … WHERE id = ? AND version = ?, 0 rows →409). Map constraint violations to a domain error (409/422), not a500. If you useSERIALIZABLE, retry on SQLSTATE40001.
- uniqueness →
- Choose types that cannot drift. Timestamps
timestamptz(MySQL: UTCDATETIMEby convention); money asnumeric/integer minor units, never float;textwith aCHECKlength over arbitraryvarchar(n)in Postgres; enums viaCHECKor a lookup table (easier to extend than a native enum). Keys:bigintidentity for single-node, UUIDv7 (time-ordered, index-friendly; Postgres 18 hasuuidv7()) when ids are generated outside the database.NOT NULLby default; nullable only with a meaning. Absent a repo convention:created_at/updated_at timestamptz NOT NULL DEFAULT now()on every table; soft delete as a nullabledeleted_atwith partial indexes and unique keysWHERE deleted_at IS NULL; and an append-only audit table (entity_type,entity_id,action,actor_id,changed_at,before,after) for user-facing data with compliance implications. - Tenancy.
tenant_id NOT NULLon every tenant-scoped table, leading in composite unique keys and indexes; composite FKs(tenant_id, parent_id)make cross-tenant references impossible. With Postgres RLS:ENABLEandFORCE ROW LEVEL SECURITY(owners bypass otherwise) and connect as a non-owner role. - Index for the query patterns in the ticket. Postgres does not index FK columns
automatically (InnoDB does): add them. Composite indexes: equality columns, then range,
then sort. Partial indexes for hot subsets. Every index costs every write; add none
without a query that needs it (the
sql-query-performanceskill). - Migrate without blocking (mechanics: the
add-db-migrationskill; review: themigration-reviewskill). Setlock_timeoutfor DDL. See the table below. - Generate types from the schema (Prisma/Drizzle/sqlc/SQLAlchemy/pydantic tooling the repo uses); never hand-write a parallel model.
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.
- 20d ago Changed · +19 lines 6917581d2adf
- 1mo 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 20d ago), licensed Apache-2.0. It adds 75 tokens to every session and 1,833 once invoked, about $0.0003 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-08-31.
Other skills, from other repositories
bulwark-brainstorm
Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.
plan-creation
Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.
anthropic-validator
Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.
code-review
Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.
create-subagent
Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.
test-audit
Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.