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 Hainrixz/claude-db --skill db-referential-integritygit clone --depth 1 https://github.com/Hainrixz/claude-dbWrote 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/hainrixz/claude-db/db-referential-integrity)<a href="https://agentmods.dev/skills/hainrixz/claude-db/db-referential-integrity"><img src="https://agentmods.dev/badge/skills/hainrixz/claude-db/db-referential-integrity.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.1 | $0.00075 | $0.01065 |
| Opus 5 | $0.00037 | $0.00532 |
| Sonnet 5 | $0.00015 | $0.00213 |
| Haiku 4.5 | $0.00007 | $0.00106 |
Grade A, and why
db-referential-integrity 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 7d 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 — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.
db-referential-integrity (M3)
Foreign keys are the database enforcing that a reference points at something real — the cheapest, most durable guarantee against orphan data. Missing them pushes integrity into application code, where it silently rots. This module is both-axis: integrity on design, and join/planning behaviour on performance. It applies to FK-supporting relational engines only; the document/KV profiles drop it entirely (no false penalty).
What it checks
- Missing FK: a column named/typed as a reference (
*_idmatching another table's PK) with noFOREIGN KEYconstraint. On financial or auth tables (orders, payments, sessions, memberships) an orphan-enabling missing FK is the severity-5 cap case. - ON DELETE / ON UPDATE action: FK with no explicit referential action where the default (
NO ACTION/RESTRICT) is wrong for the relationship, or a dangerousCASCADEthat can mass-delete (e.g. deleting a user cascades to invoices). Each action must be intentional. - Reference cycles: FK cycles (A→B→C→A) that block ordered insert/delete and complicate migrations — severity 4.
- Composite FK mismatch: multi-column FK whose column set/order does not match the referenced unique key, or partial composite references.
- Untrusted/NOT VALID FK left unvalidated after a backfill (Postgres
NOT VALID).
Axis & severity
- Missing FK enabling orphan financial/auth rows: severity 5,
fail, axisboth, confidenceestablished(caps). - FK cycle: severity 4,
warn, axisboth. - Missing/over-broad
ON DELETE(silentRESTRICTblocking, or unintendedCASCADE): severity 3–4,warn, axisdesign. - Composite-FK order mismatch: severity 3,
warn. - Note: FK columns lacking a supporting index are owned by M11 (indexing), not here — cross-reference, do not double-count.
Tier-0 static check
Parse DDL via scripts/parse-schema.mjs: for each *_id-style column, check whether a matching FOREIGN KEY/REFERENCES clause exists; enumerate declared FKs and flag those without an explicit ON DELETE/ON UPDATE action; build the FK graph and detect cycles. Directional ORM-source parses never raise the sev-5 orphan cap.
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.
- 7d ago First seen · 54 lines · 75 tokens per session scan A 7c6f5efa2b48
db-referential-integrity is a skill published in the GitHub repository Hainrixz/claude-db (19 stars, last pushed 2mo ago), licensed MIT. It adds 75 tokens to every session and 1,065 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-30.
Other skills, from other repositories
malloy-lookml-review
Analyze LookML files as prior art for Malloy modeling. Used during Step 1 (DISCOVER) when .lkml files are present. Coordinates reference files that extract business logic, relationships, and curation decisions. Works with or without a database connection.
review-prs
Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…
migration-review
Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.
malloy-review
Malloy semantic-model code review. Invoke when the user asks to review, audit, or critique a .malloy file, a folder of Malloy models, or a GitHub PR that touches Malloy. Enforces project modeling standards and emits a navigable review file.
migration-ready-schema
Data-model rules that make a schema importable from day one, so the migration-import-engineer is never blocked on missing columns. Every SMB Product-Builder product must let a customer bring their data from an incumbent (ServiceTitan/Toast/Mindbody/Shopify) — that requires provenance (sourceref) and rollback…
dynamodb
Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is postgresdb), NOT aggregation-pipeline document…