database-guidelines

Enforce safe Prisma/PostgreSQL migrations with Expand & Contract and CONCURRENTLY indexing.

Updated Dec 13, 2025
One-click install
npx skills add https://github.com/imehr/vet --skill database-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-guidelines
Source: https://github.com/imehr/vet/tree/main/.claude/skills/database-guidelines
Command: npx skills add https://github.com/imehr/vet --skill database-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guardrails and best practices for Database Reliability Engineering, focusing on data integrity, performance, and zero-downtime migrations, ensuring teams avoid common pitfalls.

Core Features & Use Cases

  • Indexing & Performance Guidance: guidelines to optimize queries, indexing, and avoid N+1 queries.
  • Migration Safety Patterns: zero-downtime migration strategies and safe schema changes.
  • Operational Playbooks: standard practices for testing, backups, and rollout.

Quick Start

To begin, instruct the AI to review the project’s Prisma/schema and apply safe migration and indexing recommendations across existing models and migrations.

Frequently Asked Questions about database-guidelines

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

FAQPage Schema
How do I perform zero-downtime migrations in PostgreSQL using Prisma?

To perform zero-downtime migrations in PostgreSQL using Prisma, apply the Expand & Contract pattern to safely evolve schemas without service interruptions. This approach ensures backward compatibility throughout the migration process.

How do I create indexes concurrently in PostgreSQL to avoid locking tables?

To create indexes concurrently in PostgreSQL and avoid locking tables, use the CONCURRENTLY index creation pattern. The database guidelines skill provides procedural requirements for this operation to maintain database reliability and uptime.

What is the Expand & Contract pattern for database schema changes?

The Expand & Contract pattern for database schema changes is a zero-downtime migration strategy that separates schema expansion from contraction. It enables safe data migrations and backfilling data while maintaining application stability.

How do I prevent N+1 queries and optimize indexing in a Prisma stack?

Prevent N+1 queries and optimize indexing in a Prisma stack by applying database reliability engineering guidelines. These guardrails help optimize queries and indexing to improve overall database performance.

What is the best way to backfill data during a database migration?

The best way to backfill data during a database migration is to follow audit-ready migration checklists and zero-downtime patterns. This ensures data integrity and performance optimization during schema changes.

Are there operational playbooks for testing and rolling out PostgreSQL schema changes?

Yes, operational playbooks for testing and rolling out PostgreSQL schema changes provide standard practices for backups and safe migrations. These playbooks ensure teams avoid common pitfalls during database reliability engineering.