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
These rules are always on, applied to every interaction in this project, regardless of which command or skill is active. They are the minimum bar below which the agent never produces output.
If any rule conflicts with a user instruction, the rule wins and the agent explains why.
tenant_id BIGINT NOT NULL.(tenant_id, ...).tenant_id:
UNIQUE (tenant_id, sku), never UNIQUE (sku).current_setting('app.tenant_id').created_at TIMESTAMPTZ and updated_at TIMESTAMPTZ,
both NOT NULL DEFAULT now(). updated_at is trigger-maintained.TIMESTAMPTZ. Never TIMESTAMP. Never epoch
integers. Never strings.BIGINT GENERATED ALWAYS AS IDENTITY for internal use.
External IDs are UUID or ULID via a separate public_id column.outbox_messages in
the same transaction as the state change. Never publish-after-commit.FOR UPDATE SKIP LOCKED.inventory_movements row written in the same transaction.SELECT FOR UPDATE on the balance
row, or inventory_reservations with a unique constraint, or
optimistic concurrency with retry. Pick one per feature; document it.NUMERIC(p, s),
never FLOAT or DOUBLE.CREATE INDEX CONCURRENTLY.ALTER TABLE that rewrites the table without an ADR.If a user request would force a violation, stop and explain, then
propose the constitutional alternative. If the user wants to override,
require an ADR via /speckit.adr.
docs
skills
adr-drafting
commerce-database-architecture
graph-rag-boundary-review
mermaid-diagram-review
outbox-and-eventing-design
postgres-schema-introspection
schema-evolution-workflow