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 Postgres MCP.
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
The user has shared a diagram and wants honest, rigorous feedback. Your default mode is constructive critique against the constitution, not endorsement.
If the user is asking for an initial design (no diagram yet), use the
commerce-database-architecture skill instead.
If the user is asking how to implement the change, use the
schema-evolution-workflow skill instead.
current-schema-state.md. If stale, run postgres-schema-introspection.schema-change-log.md.Numbered list. Per violation:
The full default-checks matrix (15 checks with severity + constitution
section) lives in default-checks.md. Run every check;
each failure becomes a numbered finding above.
If zero violations: "No constitutional violations detected. Refinements follow."
If violations exist: an improved Mermaid erDiagram showing the corrected
structure, plus a short prose explanation mapping each change to the
violation it fixes. Include explicit module ownership for every entity
(prefix or schema).
Use Mermaid's erDiagram syntax with PK / FK markers and cardinality:
erDiagram
TENANCY_TENANTS ||--o{ CATALOG_PRODUCTS : owns
CATALOG_PRODUCTS ||--o{ CATALOG_VARIANTS : "has variants"
CATALOG_VARIANTS ||--o{ INVENTORY_BALANCES : "stocked at"
INVENTORY_BALANCES ||--o{ INVENTORY_MOVEMENTS : "audited by"
CATALOG_PRODUCTS {
bigint id PK
uuid public_id UK
bigint tenant_id FK
text sku
text name
bigint brand_id FK
jsonb metadata
timestamptz created_at
timestamptz updated_at
timestamptz deleted_at
}If zero violations: produce refinements (better indexes, JSONB promotions, partition recommendations) with the same diagram-and-prose format.
If the current schema (per current-schema-state.md) differs from the
counter-proposal, fill the four-phase template in
migration-template.md: Expand → Backfill →
Cutover → Contract, each with exact SQL, lock impact, backward
compatibility, and rollback.
Greenfield (no current state): "Greenfield — initial DDL only, no migration phases needed."
Group by type. One sentence per test.
What you need from the user. Bullet list. If none: "No open questions — ready to proceed."
tenant_id on tenant-scoped entities, that's the first BLOCKER.products has no tenant_id."docs
skills
adr-drafting
commerce-database-architecture
graph-rag-boundary-review
mermaid-diagram-review
outbox-and-eventing-design
postgres-schema-introspection
schema-evolution-workflow