Database architecture skills, docs, and rules for high-demand multi-tenant commerce platforms (PostgreSQL source of truth, Neo4j as derived GraphRAG projection, transactional outbox, RLS-based tenant isolation). Includes live schema introspection workflow via explicit Supabase MCP/read-only schema sources.
77
97%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Run every check on every diagram. Each finding contributes one numbered entry to Section 1 of the review output.
| # | Check | Severity | Constitution |
|---|---|---|---|
| 1 | Every tenant-scoped entity has tenant_id | BLOCKER | § IV |
| 2 | Composite uniques include tenant_id (e.g. UNIQUE (tenant_id, sku)) | BLOCKER | § IV |
| 3 | Foreign keys present on every relationship | HIGH | § V |
| 4 | No transactional truth on non-Postgres entities (orders, inventory, payments, prices, tenancy, audit) | BLOCKER | § X |
| 5 | Inventory has append-only inventory_movements paired with inventory_balances | BLOCKER | § VI |
| 6 | Orders have status history + idempotency keys | HIGH | § VII |
| 7 | Domain events leave via outbox, not direct publish | HIGH | § VIII |
| 8 | No prices, stock, totals, FK-bearing identifiers in JSONB | HIGH | § V |
| 9 | Every table stays under ~40 columns | MEDIUM | § V |
| 10 | FK ON DELETE policy is explicit (no implicit NO ACTION) | MEDIUM | § V |
| 11 | Soft-delete (deleted_at) only on entities with explicit principle approval | MEDIUM | principles |
| 12 | Every relationship's cardinality is meaningful (no decorative arrows) | LOW | clarity |
| 13 | RLS policy implied for every tenant-scoped table | BLOCKER | § IV |
| 14 | Numeric monetary fields use numeric(p,s), never float/double | HIGH | § VII |
| 15 | Timestamp columns are timestamptz, never timestamp or epoch integer | MEDIUM | principles |
Per finding, fill: severity, section, finding (one sentence), why it matters (one sentence), evidence (specific table/relationship in the user's diagram).
docs
skills
adr-drafting
commerce-database-architecture
graph-rag-boundary-review
mermaid-diagram-review
outbox-and-eventing-design
postgres-schema-introspection
schema-evolution-workflow