schema-antipatterns

schema-antipatterns is a skill for Claude Code from sigistry/marketplace. It costs 93 tokens per session (909 once invoked), scanned A, original, MIT.

A reference guide to common relational database and ORM design mistakes, including weak keys, missing constraints, unsuitable data types, and inefficient queries.

In plain words
What is it for?
Use it when reviewing schemas or ORM code for issues such as missing primary keys, unindexed foreign keys, poor normalization, or N+1 queries.
Why use it?
It gives consistent checks for database designs that can cause broken relationships, inaccurate data, storage waste, or slow access.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it when reviewing schemas or ORM code for issues such as missing primary keys, unindexed foreign keys, poor normalization, or N+1 queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sigistry/marketplace/schema-antipatterns
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.

Any agent
npx skills add sigistry/marketplace --skill schema-antipatterns
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-antipatterns

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sigistry/marketplace/schema-antipatterns"><img src="https://agentmods.dev/badge/skills/sigistry/marketplace/schema-antipatterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 909 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.00093 $0.00909
Opus 5 $0.00046 $0.00454
Sonnet 5 $0.00019 $0.00182
Haiku 4.5 $0.00009 $0.00091

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

Security

Grade A, and why

schema-antipatterns 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 8d 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/skills/schema-antipatterns/SKILL.md · 43 lines

How it starts

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

Schema Antipatterns

Purpose

Provide a standardized catalog of relational schema design anti-patterns and ORM query anti-patterns, so schema reviews and N+1 hunts are consistent and grounded, statically, from DDL and source, with no database connection. These are the recurring mistakes that a DBA would flag on sight and that a team without one re-introduces every sprint.

Schema anti-pattern catalog

Category Anti-pattern Why it bites Correct choice
Keys No primary key No stable row identity; replication/tooling breaks Surrogate bigint/identity or uuid PK
Keys UUID stored as varchar(36) 2–3× storage, slow joins uuid (PG) / BINARY(16) (MySQL)
Foreign keys FK column with no index Every parent delete/join scans the child Index every FK column
Foreign keys Relationship with no FK constraint Orphan rows, no referential integrity Declare the FK (+ ON DELETE action)
Types Money as float/double Rounding errors on cents numeric(12,2) / DECIMAL
Types timestamp without time zone Ambiguous instants across zones/DST timestamptz (PG) / store UTC + document
Types Cargo-cult VARCHAR(255) Arbitrary cap, no real meaning text (PG) or a length that models a real rule
Types Enum as loose varchar Typos, no validation Native ENUM/CHECK-constrained or lookup table
Types Boolean as int/char(1) 2 and 'Y' sneak in Native boolean / TINYINT(1) with CHECK
Constraints Nullable-everything NULL means "unknown" everywhere; buggy logic NOT NULL on required columns
Constraints Missing UNIQUE/CHECK Duplicate/invalid data Add the business-rule constraint
Indexing Over-indexing / duplicate index Write amplification, wasted storage One index per access pattern; drop prefixes
Indexing Index on low-selectivity boolean Rarely used, still maintained Partial index or none
Integrity Soft-delete without partial unique UNIQUE(email) blocks re-signup after delete UNIQUE ... WHERE deleted_at IS NULL

Read the full file on GitHub · 43 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 43 lines · 93 tokens per session scan A fcd3bf773b8f

Subscribe to this mod's changes

schema-antipatterns is a skill published in the GitHub repository sigistry/marketplace (3 stars, last pushed 2d ago), licensed MIT. It adds 93 tokens to every session and 909 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

ddia-systems

Design data systems by understanding storage engines, replication, partitioning, transactions, and consistency models. Use when the user mentions "database choice", "which database should I use", "SQL or NoSQL", "replication lag", "partitioning strategy", "consistency vs availability", "stream processing", "ACID…

wondelai/skills · 138 tokens

safe-migrations

Zero-downtime schema and data migration discipline — expand → migrate → contract, never destructive in the release that ships the code, backfills as jobs, every step reversible. INVOKE PROACTIVELY when creating or editing a migration in any framework, writing ALTER TABLE / index / enum / constraint changes, planning a…

PrabhdeepSingh/claude-plugins · 100 tokens

elasticsearch

Interact with Elasticsearch and Kibana via REST API using curl. Use when querying, indexing, managing indices, checking cluster health, writing aggregations, deploying dashboards, or troubleshooting Elasticsearch. Requires cluster URL and API key. Covers: search (Query DSL), CRUD operations, index management…

NikiforovAll/claude-code-rules · 97 tokens

docker-dev-environment

Use when setting up local development services or running the project locally. Establishes the "stateful services in Docker, app runs native" pattern with Postgres, Redis, MinIO, and Mailpit.

martian56/claude-engineer · 46 tokens

top-design

Create award-winning, immersive web experiences at the level of Awwwards-featured agencies. Use when the user mentions "Awwwards quality", "make my site stunning", "scroll animations", "parallax storytelling", "cinematic web design", "portfolio site", or "brand experience". Also trigger when elevating a standard…

wondelai/skills · 113 tokens

traction-eos

Implement the Entrepreneurial Operating System (EOS) to align vision and execution across a company. Use when the user mentions "EOS", "Entrepreneurial Operating System", "V/TO", "quarterly rocks", "Level 10 meetings", "accountability chart", "IDS process", "my company feels chaotic", "we keep having the same…

wondelai/skills · 147 tokens