go-goose
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.,
postgresdriver withpostgresdialect). - 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.
- Author migrations:
- SQL: use goose annotations and statement rules (see references/sql-annotations.md).
- Go: register migrations in init and wire into a custom binary or Provider (see references/go-migrations.md).
- Run migrations:
- CLI usage, commands, and env vars in references/cli.md.
- Library/Provider patterns in references/library.md.
- Versioning + ordering:
- Use hybrid versioning during development and
fixfor production sequencing if required (see references/versioning.md).
- Use hybrid versioning during development and
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
- CLI usage and env vars: references/cli.md
- SQL annotations and parsing rules: references/sql-annotations.md
- Go migration registration patterns: references/go-migrations.md
- Library and Provider API usage: references/library.md
- Versioning and ordering: references/versioning.md
More from metalagman/agent-skills
github-flow
Use this skill when working with the lightweight GitHub Flow branching model. Ideal for projects with continuous deployment where 'main' is always deployable.
17go-senior-developer
Expert senior-level Go guidance for architecture, API-first design/codegen, advanced concurrency, performance tuning, testing/quality, cloud-native 12-factor practices, and Go 1.24+ tooling for large-scale systems.
17go-adk
Use this skill to build, run, deploy, evaluate, and troubleshoot Go agents with Google's Agent Development Kit (`google.golang.org/adk`), including `llmagent` config, toolsets/skills, callbacks/plugins, sessions/state/memory, workflows, MCP/A2A, and current runtime/deployment patterns.
14skill-writer
Use this skill to design, document, and structure AI agent skills for Gemini, Claude, and Codex. It provides architectural rules, directory standards, and writing best practices.
13go-fx
Use this skill to build, refactor, or review Go applications using the Uber Fx dependency injection framework. It ensures idiomatic use of Fx for lifecycle management, module-based architecture, and boilerplate reduction.
11golangci-lint-strict
Use this skill to install and use the upstream powerman/golangci-lint-strict config for an exact golangci-lint version by fetching the versioned config file unchanged.
10