database

Review relational database schema migrations for safety and performance.

18|1|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/kid-sid/codex-spellbook --skill database-kid-sid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/kid-sid/codex-spellbook/tree/main/skills/database
Command: npx skills add https://github.com/kid-sid/codex-spellbook --skill database-kid-sid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates the risk of production outages, data loss, and performance bottlenecks caused by inconsistent database schema naming, unsafe migration patterns, unoptimized queries, and poorly chosen deletion strategies.

Core Features & Use Cases

  • Schema & Naming Standards: Enforce consistent snake_case naming for tables, columns, and foreign keys to improve team readability and long-term maintainability.
  • Safe Migration Guidance: Provide additive, backward-compatible migration workflows to avoid downtime and data loss during schema changes.
  • Query & Index Optimization: Identify N+1 query issues, recommend targeted indexes aligned with real access patterns, and define clear transaction boundaries to boost query performance.
  • Deletion Strategy Support: Help teams choose between soft and hard delete based on audit requirements, compliance rules, and data retention needs.
  • Use Case Example: If you need to add an org_id column to the invoices table, this skill will guide you to add the column first, backfill existing rows, and dual-write during the rollout to avoid breaking existing functionality.

Quick Start

Ask the database skill to review your planned user table migration for safety, naming consistency, and performance best practices.

Frequently Asked Questions about database

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

FAQPage Schema
How do I write safe database migrations without causing production downtime?

Safe database migrations require additive, backward-compatible patterns like adding columns first, backfilling existing rows, and dual-writing during rollouts to avoid downtime and data loss.

What is the best way to detect and resolve N+1 query issues in SQL?

Resolving N+1 query issues involves identifying redundant sequential SQL fetches and optimizing them through targeted index recommendations aligned with real access patterns and clear transaction boundaries.

When should I use soft delete versus hard delete in schema design?

Choosing between soft delete and hard delete in schema design depends on your specific audit requirements, compliance rules, and data retention needs for the relational database.

How do I enforce consistent naming conventions across database schemas?

Enforcing consistent database schema naming involves applying snake_case conventions to tables, columns, and foreign keys to improve team readability and long-term maintainability.

What are the limitations of additive migration patterns for relational databases?

Additive migration patterns for relational databases require careful transaction boundary definition and may complicate schema design if existing columns must be deprecated or removed safely.