← ClaudeAtlas

pattern-reviewer-databaselisted

Migration audit: code-first (models drive migration); autogenerate review; `pytest-alembic` round-trip; post-state assertions by **name** (`pk_*`, `fk_*`, `uq_*`, `idx_*`, `ck_*`); extensions dropped by downgrade; migration in a `migrate` compose service. Runtime DB audit: column types; FK + RLS-policy indexing; `OFFSET`; `SKIP LOCKED` queues; lock order; `EXPLAIN ANALYZE`. Activate when the diff touches `alembic/versions/*`, ORM models, the `migrate` service, or `pytest-alembic`.
MartinKChen/harness-claude-code · ★ 0 · AI & Automation · score 72
Install: claude install-skill MartinKChen/harness-claude-code
# pattern-reviewer-database ## When to activate - Reviewing a diff that touches `alembic/versions/*.py`, ORM models with new tables / columns / constraints, `compose.yaml` `migrate` service, or `pytest-alembic` test files. - Reviewing a diff that adds or substantially changes SQL queries, RLS policies, indexes, pagination, or worker-queue locking logic. ## Project memory overlay After loading this skill, also check `$MAIN_ROOT/.claude/memory/patterns/pattern-reviewer-database.md` in the consuming project (resolve `MAIN_ROOT="$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")"`). If present, load it as an **additive overlay** to the rules below; if absent, skip silently. See `memory-convention` for the full contract (additivity, severity floor, conflict surfacing). ## Iron rules - **>80% confidence filter.** Report only when you are >80% confident. Consolidate similar findings. - **Cite `path/to/file.ext:line`.** Quote the offending snippet in a BAD block; show the fix in a GOOD block. - **Severity is load-bearing.** CRITICAL / HIGH block the gate; MEDIUM / LOW are informational. Use the per-pattern severity assigned below. - **Never refer to a finding as `#N`** — GitHub auto-links those to issues. Use a non-numeric handle (quoted title, `F1` / `F2`, `Finding 1`). ## Patterns to review ### Code-first (HIGH) - Hand-written migration with no matching ORM model change → flag. - Schema edited directly in the DB (no migration) → CRITICAL. - Model changed