database-design

Design PostgreSQL schemas, indexes, and reversible migration plans.

1|2|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/parisgroup-ai/imersao-ia-setup --skill database-design-parisgroup-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/parisgroup-ai/imersao-ia-setup/tree/main/skills/database-design
Command: npx skills add https://github.com/parisgroup-ai/imersao-ia-setup --skill database-design-parisgroup-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps teams design efficient, consistent database schemas and migration strategies to avoid performance regressions, naming inconsistencies, and risky irreversible changes.

Core Features & Use Cases

  • Conventions & Structure: Enforces naming conventions, required id and timestamp columns, and consistent foreign key patterns.
  • Indexing & Performance: Recommends indexes including composite and partial indexes, and advises strategies for creating large-table indexes with minimal locking.
  • Migrations & Governance: Guides reversible migrations, requires down migrations, and integrates ADR/PR reviewer workflows for structural changes.
  • Use Case: When adding a new orders feature, produce the table schema, index plan, migration steps, rollback SQL, and an ADR describing data impact and deploy coordination.

Quick Start

Use the database-design skill to evaluate a proposed schema change, list required indexes and migration steps, and produce an ADR with rollback and validation queries.

Frequently Asked Questions about database-design

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

FAQPage Schema
How do I design a PostgreSQL schema with proper indexing and normalization?

To design a PostgreSQL schema, create normalized tables with consistent naming, required id and timestamp columns, and foreign key relationships. Apply composite and partial indexes for performance optimization and consistent data storage.

What's the best way to plan reversible database migrations for new features?

Plan reversible database migrations by writing paired up and down SQL steps, ensuring the down migration undoes schema changes. Include validation queries and deploy coordination to manage data impact safely during new feature rollouts.

When do I need an ADR for database schema changes?

You need an Architecture Decision Record (ADR) for high-risk database schema changes and refactors. An ADR documents structural changes, data impact, rollback strategy, and deploy coordination, ensuring governance during PR reviews for risky modifications.

How do I create large-table indexes with minimal locking in PostgreSQL?

Create large-table indexes with minimal locking by applying specialized indexing strategies. The design process recommends composite and partial indexes and advises techniques to prevent performance regressions and long table locks during index creation.

What are the required columns and naming conventions for a reliable database schema?

Reliable database schemas require consistent naming conventions, mandatory id columns, and timestamp columns for tracking. Foreign key patterns must be standardized, and foreign key indexing is enforced to maintain referential integrity and query performance.

Does this database design approach work for refactoring existing tables?

Yes, this approach supports refactoring existing tables by evaluating proposed schema changes, listing required index adjustments, and planning reversible migration steps. It ensures structural changes maintain consistency and performance during refactors.