/claude-db:db-antipatternsfrom Claude DB
Detects cross-paradigm database anti-patterns: EAV, god tables, CSV-in-column, polymorphic associations, boolean-flag soup, Mongo unbounded arrays, deep nesting, app-side joins, and Redis-as-primary-store. Routes findings to design or performance scoring modules.
Ships in Claude DB. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
M19 is the catch-all for recognized anti-patterns that span paradigms and don't sit cleanly inside one
structural module. It does not own a weight of its own. Findings inherit the category of the most
natural module: an EAV smell is a modeling/normalization problem → it scores under M1 (Modelado,
design); a Mongo unbounded-array smell scores under document Crecimiento-doc (performance); polymorphic
associations without an FK score under M3 (Integridad referencial, both). The finding's module stays
M19 for provenance, but expected_impact.axis and the rule id's intent route it to the owning
category at scoring time. This avoids double-counting — a single smell contributes to exactly one
category per axis. See references/scoring-model.md for the category map per paradigm.
Relational / SQL:
(entity, attribute, value) tables replacing real columns →
re-homes to M1 (design). Defeats types, constraints, indexing.tags VARCHAR holding "a,b,c" instead of a child table/array/jsonb → M1/M4.commentable_type + commentable_id, no constraint) → M3 (both).is_* booleans that should be a state enum/lookup → M4 (design).jsonb/text blob used as schema evasion → re-homes to M4 (design).
NoSQL:Parse the schema/ORM (scripts/parse-schema.mjs, parse-orm-python.py). Flag: a table whose columns
are literally (entity_id, attribute, value); column count above a high threshold with mostly-nullable
columns; string columns named tags/roles/csv; *_type + *_id pairs with no matching FK; ≥N
is_*/has_* booleans on one table; Mongoose schemas with array-of-subdocument fields and no cap.
SELECT relname, count(*) AS cols FROM information_schema.columns JOIN pg_class ON relname=table_name GROUP BY relname ORDER BY cols DESC;db.coll.aggregate([{$project:{n:{$size:"$items"}}},{$group:{_id:null,max:{$max:"$n"},avg:{$avg:"$n"}}}])
and db.coll.stats() for avg doc size trending toward 16 MB.CONFIG GET save and CONFIG GET appendonly (needs live; else needs_api).Emit per schema/finding.schema.json. Example ids:
M19.events.eav_table — generic EAV table (warn, severity 3, axis design, confidence directional,
re-homes to Modelado/M1).M19.comments.polymorphic_no_fk — commentable_type/commentable_id with no FK (fail, severity 4,
axis both, re-homes to M3).M19.feed.unbounded_array — Mongo array trending toward 16 MB (warn, severity 4, axis performance,
re-homes to document Crecimiento-doc; sev-5 only with live size evidence).
Each finding: evidence.observed quotes the real DDL/Mongoose schema/query verbatim with secrets
redacted; verification.reproduce is one of the runnable commands above (referencing $DATABASE_URL);
verification.method is ddl_parse, schema_introspect, or manual_review;
expected_impact is {axis, confidence, magnitude (high|medium|low), rationale} — banded, never a naked %.directional structural smell (e.g. app-side fan-out inferred from ORM source) never caps a
score. Redis-undurable and unbounded-array sev-5 require live evidence; otherwise directional or
needs_api, never a silent pass.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
SQL, MongoDB, Redis, PostgreSQL, MySQL
database-design, anti-patterns, sql-smells, nosql-smells, schema-review
npx claudepluginhub hainrixz/claude-db --plugin claude-db36 skills in this plugin
/auditAudit a database schema, ORM model, or migrations for design and performance — produces two independent 0-100 scores (Design & Integrity + Performance & Scale) plus a prioritized, evidence-backed report. Read-only; never writes or migrates. Use when the user asks to audit, analyze, review, check, or score a database, schema, data model, migrations, indexes, keys, referential integrity, types, constraints, query patterns, partitioning, or connection pooling — for Postgres, MySQL, Mongo, DynamoDB, Cassandra, pgvector, ClickHouse, Neo4j, and friends./checklistRender a production-readiness GO/NO-GO grid for a database — runs a read-only audit, then maps the findings onto a fixed launch checklist (PITR/backups, RLS on tenant tables, FK indexes, money-as-numeric, timestamptz/UTC, connection pooling sized, migration reversibility, secrets-not-in-schema, charset/utf8mb4). Each row is PASS/WARN/FAIL/NEEDS-LIVE with the finding id, topped by a plain-language verdict. Read-only. Use when the user asks if a database is production-ready, ready to launch/ship, a go/no-go, a pre-launch or readiness checklist, or what to fix before going live./db-concurrencyAudit concurrency correctness — transaction isolation level, lost-update / read-modify-write races, queue-worker contention (SKIP LOCKED), and idempotency for key-value / document / wide-column writes. Module M14. Feeds the Performance & Scale score./db-connection-poolingAudit connection management — serverless functions opening direct Postgres connections, transaction-mode pooler misuse (PgBouncer / Supabase / prepared statements), and pool sizing against backend max_connections. Module M15. Feeds the Performance & Scale score./db-constraintsAudit data-integrity constraints — missing NOT NULL on required columns, absent CHECK constraints for domain rules, missing UNIQUE on natural keys, and the over-nullable UNIQUE trap where NULLs silently permit duplicates. Module M5. Feeds the Design & Integrity score (Constraints category)./db-defaults-generatedAudit column defaults and generated columns — application-side timestamps that should be DB defaults, non-deterministic or wrong defaults, derived values that should be GENERATED ALWAYS / computed columns instead of drift-prone duplicated data, and identity/sequence defaults. Module M6. Feeds the Design & Integrity score (Tipos category, shared with M4).Other plugins' skills for the same job