Use this skill to plan, write, or run database migrations with the pressly/goose CLI and Go library (SQL/Go migrations, env vars, provider API, embedded migrations).
SKILL.md
go-goose
Expert guidance for using pressly/goose to create and run database migrations via the CLI or Go library.
When to trigger
The user mentions goose, pressly/goose, database migrations in Go, or asks how to run SQL/Go migrations.
The task involves embedding migrations, provider API usage, or CI workflows with goose.
Core rules
Follow the repository's existing migration layout, dialect, and naming conventions first.
Ensure the database driver and goose dialect match (e.g., postgres driver with postgres dialect).
Prefer SQL migrations for schema changes; use Go migrations for complex data backfills or code-driven steps.
Keep migrations deterministic and idempotent within goose's rules (one Up, optional Down).
Workflow
Clarify context: target DB/dialect, driver, migration directory, SQL vs Go migration needs, and desired command (create/up/down/status/etc).
Choose interface:
CLI for ad-hoc runs or CI/CD.
Library/Provider when migrations are executed inside Go services or tests.