conventions-db

Enforce consistent database schemas, queries, and migrations across the codebase.

163|43|Updated May 3, 2026
One-click install
npx skills add https://github.com/stella/stella --skill conventions-db
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: conventions-db
Source: https://github.com/stella/stella/tree/main/.agents/skills/conventions-db
Command: npx skills add https://github.com/stella/stella --skill conventions-db

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database schema, query, and migration conventions often drift across teams, causing unsafe changes and maintenance headaches.

Core Features & Use Cases

  • Schema guardrails: guidelines for writing modular, upgrade-friendly Drizzle migrations and additive schema changes.
  • Safe migrations: rules to deploy in steps, backfill, and avoid destructive operations without explicit safety notes.
  • Auditing and consistency: ensures cascade/right-FK ordering and consistent JSONB usage to prevent orphaned data.

Quick Start

Apply these conventions when editing database schemas, queries, or migrations to maintain consistency and safety.

Frequently Asked Questions about conventions-db

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

FAQPage Schema
How do I enforce database schema conventions across multiple teams?

To enforce database schema conventions across teams, apply modular, upgrade-friendly Drizzle migrations with strict rules for additive changes, proper FK ordering, and consistent JSONB usage. This prevents unsafe schema modifications and orphaned data.

What are the best practices for safe database migrations in SQL?

Safe database migrations require deploying in steps, backfilling data, and avoiding destructive operations without explicit safety notes. Following these SQL best practices ensures the data model evolves safely without causing downtime or data loss.

How does JSONB usage affect database schema consistency?

Consistent JSONB usage prevents orphaned data and maintains database schema consistency. Enforcing conventions ensures JSONB columns are applied uniformly across the codebase, making queries and data auditing more reliable.

How do I avoid destructive operations when writing Drizzle migrations?

To avoid destructive operations in Drizzle migrations, enforce additive schema changes and require explicit safety notes for any potentially damaging SQL commands. Deploying migrations in steps and backfilling data minimizes risks.

Why do I need foreign key ordering conventions for database schemas?

Foreign key ordering conventions are needed to prevent orphaned data and ensure safe data model evolution. Proper cascade and right-FK ordering maintains referential integrity during schema migrations and complex queries.

Can I use these database conventions for auditing SQL queries?

Yes, these database conventions can be applied for auditing SQL queries to ensure consistency and safety. They enforce proper FK ordering, JSONB usage, and safe migration workflows, preventing unsafe changes across the codebase.