database-architecture

Enforce PostgreSQL 18 best practices for schema design and migrations.

10|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/troykelly/codex-skills --skill database-architecture-troykelly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-architecture
Source: https://github.com/troykelly/codex-skills/tree/main/skills/database-architecture
Command: npx skills add https://github.com/troykelly/codex-skills --skill database-architecture-troykelly

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures that all database schema designs, migrations, and architectural decisions strictly adhere to the advanced best practices and new features introduced in PostgreSQL 18, preventing performance issues and ensuring maintainability.

Core Features & Use Cases

  • PostgreSQL 18 Feature Adoption: Enforces the use of AIO, native UUIDv7, temporal constraints, virtual generated columns, and skip scan indexes.
  • Schema Design & Migrations: Guides the creation of robust, scalable, and efficient database schemas and migration scripts.
  • Use Case: When designing a new orders table, this Skill will ensure it uses uuidv7 for the primary key, timestamptz for all timestamps, and appropriate temporal constraints if needed, while also suggesting optimal indexing strategies for PostgreSQL 18.

Quick Start

Apply database-architecture to ensure PostgreSQL 18 best practices for the schema changes in db/schema.sql.

Frequently Asked Questions about database-architecture

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

FAQPage Schema
How do I design a PostgreSQL 18 database schema with native UUIDv7 primary keys?

To design a PostgreSQL 18 database schema with native UUIDv7 primary keys, apply best practices for table design, naming conventions, and optimal indexing strategies like skip scan indexes to ensure scalability and efficient queries.

What are PostgreSQL 18 best practices for zero-downtime database migrations?

PostgreSQL 18 best practices for zero-downtime database migrations involve using safe migration patterns that enforce temporal constraints and prevent performance issues, ensuring architectural changes maintain availability and strict schema integrity.

When should I use virtual generated columns in PostgreSQL 18?

Virtual generated columns in PostgreSQL 18 should be used during schema design when you need computed values without consuming disk space, adhering to architectural best practices for efficient and maintainable database structures.

Does PostgreSQL 18 support temporal constraints for schema design?

PostgreSQL 18 supports temporal constraints for schema design, allowing you to enforce time-based data validity rules and prevent overlaps, which ensures robust architectural decisions and strict data integrity.

What is the best way to adopt Asynchronous I/O and skip scan indexes in PostgreSQL 18?

The best way to adopt Asynchronous I/O and skip scan indexes in PostgreSQL 18 is to enforce their usage during architectural planning and schema design, significantly improving database performance and query optimization.

Can I enforce strict naming conventions and partitioning strategies for PostgreSQL 18 tables?

You can enforce strict naming conventions and partitioning strategies for PostgreSQL 18 tables by applying architectural best practices that guide optimal table design, ensuring maintainability and scalable performance.