/claude-db:db-concurrencyfrom Claude DB
Audits database concurrency correctness: transaction isolation levels, lost-update/read-modify-write races, queue-worker contention with SKIP LOCKED, and idempotency for key-value/document/wide-column writes. Feeds Performance & Scale score.
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.
Correctness under concurrent writes is a Performance & Scale (axis performance) concern: it
governs both throughput and whether data stays consistent under load. Feeds relational Concurrencia
w12 (and the Idempotencia category in KV/document/wide-column profiles).
READ COMMITTED default vs
REPEATABLE READ/SERIALIZABLE) appropriate for its invariants? Money/inventory updates under
READ COMMITTED without locking are exposed to anomalies.SELECT balance; …app math…; UPDATE balance=$new without
SELECT … FOR UPDATE, atomic UPDATE … SET x = x - $n, or optimistic version check. Classic
double-spend race.SELECT … FOR UPDATE without SKIP LOCKED serialize
all workers onto one row; recommend FOR UPDATE SKIP LOCKED.pg_advisory_xact_lock() (transaction-scoped, auto-released at commit/rollback) for
leader election, single-runner cron jobs, and migration guards. Prefer the _xact_ variant over
session-scoped pg_advisory_lock() so the lock can't leak on a dropped connection. Note (cross-ref
M15): session-scoped advisory locks break transaction-mode pooling (PgBouncer) — the lock can land
on a different backend than the unlock; transaction-scoped advisory locks are pooling-safe.Feeds performance only (relational Concurrencia w12; Idempotencia in KV w18 / document / wide-column profiles).
Grep ORM/transaction source for isolation settings, read-then-write update sequences without locking,
FOR UPDATE lacking SKIP LOCKED, and missing conditional-write / idempotency keys on KV/doc/WC
writes. Static findings are directional — actual contention is runtime (needs_api / Tier-2).
Default isolation (Tier-1): SHOW transaction_isolation; (method connection_introspect).
Live contention (Tier-2):
SELECT wait_event_type, wait_event, count(*)
FROM pg_stat_activity WHERE state='active' GROUP BY 1,2 ORDER BY 3 DESC;
-- and deadlock/serialization rollback counts:
SELECT datname, deadlocks FROM pg_stat_database WHERE datname = current_database();
Method query_stat. Lock-wait / deadlock counts confirm a contention finding as established;
without sustained stats it stays directional.
Emit findings per schema/finding.schema.json. Examples:
M14.accounts.lost_update_balance — read-modify-write without locking/atomic update (severity:4,
fail, axis performance, confidence directional, fixable: proposed — atomic UPDATE or
FOR UPDATE).M14.jobs.no_skip_locked — worker poll without SKIP LOCKED (severity:3, warn, directional,
fixable: proposed).M14.payments.non_idempotent_write — KV/doc write with no idempotency key (severity:3, warn,
directional, fixable: advisory).Each finding: evidence.observed quotes the transaction/update code verbatim (secrets redacted);
verification.reproduce is the isolation/stat query above referencing $DATABASE_URL;
expected_impact is banded + confidence-tagged (no naked %).
directional and never cap.READ COMMITTED is correct for the majority of workloads; flag it only against an invariant that
demands stronger isolation, not as a blanket defect.proposed/
advisory, never auto.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
36 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-antipatternsUnified cross-paradigm anti-pattern catalog (M19) — relational and NoSQL smells that no single structural module owns cleanly: EAV / generic key-value tables, the "god table" with hundreds of columns, comma-separated lists in a column, polymorphic associations without FK, boolean-flag soup, Mongo unbounded array growth, deeply nested documents, the document fan-out / "join in app code" trap, Redis as a relied-on durable primary store. Each finding is re-homed to inherit the natural module's category. Feeds the Design & Integrity AND Performance & Scale scores depending on the smell.npx claudepluginhub hainrixz/claude-db --plugin claude-dbOther plugins' skills for the same job