What problem does it solve?
The db Skill prevents accidental coupling between your generated code and your database schema by making migrations the single source of truth.
Core Features & Use Cases
- Enforces a migrations-first contract: database structure is defined and evolved only through SQL migrations in db/migrations/, while forge generate never edits the DB layer.
- Clarifies proto vs schema authority: supports greenfield mode (proto authoritative) and migrated mode (migrations authoritative) with forge audit to detect alignment and divergence.
- Guides safe schema evolution: provides patterns for adding entities, adding DB-only fields, updating entity types, writing queries, and recovering from broken migrations without running down migrations in prod.
Quick Start
Use the db Skill to guide schema changes by creating a new migration with forge db migration new <name>, writing up and down SQL, applying it with forge db migrate up --dsn "$DATABASE_URL", then updating internal/db/types.go and internal/db/<entity>_orm.go to match your new schema.