mcpField
G
go-goose

go-goose

github.com/metalagmanData & databases2653 installsUpdated 10w ago
Repository

About go-goose

go-goose guides Go developers in creating and running database migrations with pressly/goose, through either its CLI or Go library. It emphasizes matching drivers to dialects and following repository conventions for migration ordering and rollback safety.

Key features

  1. 01CLI and Go library migration workflows
  2. 02SQL and Go migration authoring guidance
  3. 03Database driver and dialect matching
  4. 04Version ordering and rollback considerations

Use cases

  1. 01Create database schema migrations
  2. 02Run migrations in Go services or tests
  3. 03Execute migration commands in CI/CD

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/metalagman/agent-skills --skill go-goose

After installing, type/go-goosein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
cli.md
go-migrations.md
library.md
sql-annotations.md
versioning.md

Details

From the project README

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

  1. Clarify context: target DB/dialect, driver, migration directory, SQL vs Go migration needs, and desired command (create/up/down/status/etc).
  2. Choose interface:
    • CLI for ad-hoc runs or CI/CD.
    • Library/Provider when migrations are executed inside Go services or tests.
  3. Author migrations:
  4. Run migrations:
  5. Versioning + ordering:
    • Use hybrid versioning during development and fix for production sequencing if required (see references/versioning.md).

Output expectations

  • Provide exact commands or code snippets that match the user's dialect and environment.
  • Warn about missing Down migrations when rollbacks are required.
  • If a migration requires special parsing or non-transactional execution, call it out explicitly.

References

Comments

Markdown supported