pg-schema-conventions

Enforce PostgreSQL 18 schema-per-tenant naming and column rules for new tables.

1|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/PremModhaOfficial/motadata-ai-pipeline --skill pg-schema-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pg-schema-conventions
Source: https://github.com/PremModhaOfficial/motadata-ai-pipeline/tree/main/.claude/skills/pg-schema-conventions
Command: npx skills add https://github.com/PremModhaOfficial/motadata-ai-pipeline --skill pg-schema-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes multi-tenant database design by enforcing PostgreSQL 18 naming conventions, data-type rules, and mandatory audit columns for every table, reducing drift and review time.

Core Features & Use Cases

  • Enforces tenant schema naming using t_{8hex} prefixes.
  • Mandates standard columns (id UUID, created_at, updated_at, created_by, updated_by, is_deleted, deleted_at, version).
  • Specifies allowed and forbidden data types and constraints to avoid risky migrations.
  • Enforces COMMENT ON conventions to document schemas and columns.
  • Use cases include onboarding new tables, auditing existing schemas, and validating migrations for compliance across tenants.

Quick Start

Activate this skill at the start of any new table design or migration to enforce the platform's multi-tenant schema conventions.

Frequently Asked Questions about pg-schema-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce multi-tenant naming conventions in a PostgreSQL schema?

You can enforce PostgreSQL schema-per-tenant naming conventions by applying rules that require the t_{8hex} prefix for tenant schemas, ensuring strict tenant isolation and standardizing database design.

What standard columns are required for PostgreSQL multi-tenant tables?

PostgreSQL multi-tenant tables require standard columns including id as UUID, created_at and updated_at as TIMESTAMPTZ, created_by, updated_by, is_deleted, deleted_at for soft-delete, and version for optimistic locking.

How do I document PostgreSQL schemas and columns without using foreign keys?

You can document PostgreSQL schemas and columns without foreign keys by enforcing COMMENT ON conventions, which mandates descriptive documentation directly on schemas and columns to maintain data model clarity.

When should I use schema-per-tenant isolation in PostgreSQL?

Schema-per-tenant isolation in PostgreSQL should be used during schema design, migrations, and reviews to guarantee strict tenant separation via schema naming while prohibiting forbidden data types that risk migration failures.

Does this PostgreSQL schema convention skill support soft-delete and optimistic locking?

Yes, this PostgreSQL schema convention enforces both soft-delete and optimistic locking by mandating the is_deleted, deleted_at, and version columns for every new table, ensuring safe concurrent updates and record recovery.