schema-review

schema-review is a command for Claude Code from sigistry/marketplace. It costs 16 tokens per session (701 once invoked), scanned A, original, MIT.

A static review command for SQL and ORM schema definitions, checking tables, columns, keys, constraints, and indexes for common relational design mistakes.

In plain words
What is it for?
Use it to review DDL, schema files, and migration directories and produce corrected database definitions grouped by severity.
Why use it?
It helps catch problems such as missing primary keys, foreign-key indexes, suitable data types, or relationship constraints before they affect the application.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: model in frontmatter.

Part of the sql-safety-net plugin — 3 skills, 5 commands, 2 agents shipped together

Good fit Use it to review DDL, schema files, and migration directories and produce corrected database definitions grouped by severity.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/sigistry/marketplace/schema-review
Install

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.

Clone the repo
git clone --depth 1 https://github.com/sigistry/marketplace

Made for: Claude Code.

Or install sql-safety-net, the plugin that ships this one along with the rest of its 3 skills, 5 commands, 2 agents.

Wrote 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.

agentmods badge for schema-review

README.md
[![agentmods](https://agentmods.dev/badge/commands/sigistry/marketplace/schema-review/github.svg)](https://agentmods.dev/commands/sigistry/marketplace/schema-review)
Your own site
<a href="https://agentmods.dev/commands/sigistry/marketplace/schema-review"><img src="https://agentmods.dev/badge/commands/sigistry/marketplace/schema-review/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.

agentmods 80×15 button for schema-review

Your own site · 80×15
<a href="https://agentmods.dev/commands/sigistry/marketplace/schema-review"><img src="https://agentmods.dev/badge/commands/sigistry/marketplace/schema-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 701 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.00701
Opus 5 $0.00008 $0.00351
Sonnet 5 $0.00003 $0.00140
Haiku 4.5 $0.00002 $0.00070

Measured 6d ago against content hash 845204e4b0a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

schema-review 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 6d 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.

plugins/sql-safety-net/commands/schema-review.md · 39 lines

How it starts

The opening of the file, as written. The whole thing — 39 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Review the DDL, schema files, or migration directory at $ARGUMENTS (default: the repo's schema/migration files) for relational design anti-patterns, and emit corrected DDL. This is a static review of the DDL text, no database connection required. Load the schema-antipatterns skill for the checklist.

Process

Step 1: Locate and parse the schema

Find the DDL source. Common locations: schema.sql, structure.sql, db/schema.rb, prisma/schema.prisma, Alembic/Django/Rails migration dirs, *.sql under migrations/. Detect the dialect (Postgres vs MySQL) from types and syntax. Build a mental model of tables, columns, types, keys, constraints, and indexes.

Step 2: Check against the anti-pattern catalog

Apply the schema-antipatterns skill's references/schema-checklist.md. Look for:

Category Anti-pattern to flag
Keys Missing primary key; natural key with no surrogate where churny; UUID PK stored as text
Foreign keys FK column with no supporting index; missing FK where a relationship clearly exists
Types Money as float/double; timestamps as timestamp without time zone; cargo-cult VARCHAR(255); enum stored as loose VARCHAR; boolean stored as int/char(1)
Constraints Nullable-everything; missing NOT NULL on required columns; missing UNIQUE/CHECK; no default where one is clearly intended
Indexing Over-indexing; duplicate/redundant indexes (one is a prefix of another); index on a low-selectivity boolean
Integrity No ON DELETE/ON UPDATE action stated; soft-delete without a partial unique index

Step 3: Assign severity

Rank each finding: Critical (data-loss or integrity risk, e.g. money as float, missing PK), High (correctness/perf, e.g. unindexed FK, missing NOT NULL), Medium (maintainability, e.g. VARCHAR(255), duplicate index), Low (style/naming).

Step 4: Report

Emit:

  • ## Findings: a table: Severity | Table.Column | Anti-pattern | Why it matters | Fix. Cite the file:line of each flagged DDL statement.
  • ## Corrected DDL: the fixed CREATE TABLE/ALTER TABLE for the Critical and High findings. If a fix requires a data migration (e.g. changing a live column type), note that it must go through /migration-safety rather than a raw ALTER.

Read the full file on GitHub · 39 lines

Changes

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.

  1. 6d ago First seen · 39 lines · 16 tokens per session scan A 845204e4b0a1

Subscribe to this mod's changes

schema-review is a command published in the GitHub repository sigistry/marketplace (3 stars, last pushed 5d ago), licensed MIT. It adds 16 tokens to every session and 701 once invoked, about $0.0001 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-09-03.