--- name: upgrading-laravel-go description: Upgrades a Laravel for Go application to the latest (or a specified) go.laravel.com release, reads the new version's bundled upgrade guide, applies all applicable breaking-change migrations, and verifies the build and test suite. Use when asked to upgrade, update, or bump Laravel for Go / go.laravel.com. --- # Upgrading Laravel for Go Follow these steps in order whenever upgrading `go.laravel.com` in a Laravel for Go application. ## 1. Record the Current Version Check the currently installed version of `go.laravel.com` before changing `go.mod`: ```sh go list -m -f '{{.Version}}{{if .Replace}} (replaced by {{.Replace.Path}}){{end}}' go.laravel.com ``` Note this starting version so you know which release sections of the upgrade guide apply. ## 2. Upgrade `go.laravel.com` If `go.mod` does **not** have a local `replace go.laravel.com => ...` directive, bump the dependency to the latest release (or the specific version the user asked for, such as `v0.2.0`) and tidy: ```sh go get go.laravel.com@latest go mod tidy ``` Confirm the new version: ```sh go list -m -f '{{.Version}}' go.laravel.com ``` If `go.mod` uses a local `replace` directive pointing at a local framework checkout, do not overwrite it with `go get` unless the user explicitly asks to switch off the local replacement; proceed directly to reading the replacement's `docs/upgrade.md`. ## 3. Read the Installed Upgrade Guide Locate the bundled documentation directory for the **newly installed** `go.laravel.com` version: ```sh .agents/skills/writing-laravel-go-apps/scripts/docs-path.sh ``` (Or run `go list -m -f '{{.Dir}}/docs' go.laravel.com` directly.) Read `/upgrade.md` in full. Always read it *after* bumping `go.mod` so you are reading the new release's upgrade instructions, not the old version's. ## 4. Apply Applicable Changes in Order 1. Find every version section in `/upgrade.md` strictly newer than the starting version up through the new version. 2. Work through those sections **from oldest to newest** so multi-version jumps apply cleanly. 3. For each item in a section: - Search the application (`bootstrap/`, `routes/`, `handlers/`, `models/`, `policies/`, `actions/`, `services/`, `commands/`, `jobs/`, `events/`, `listeners/`, `workflows/`, `mails/`, `notifications/`, `database/`, `tests/`) using the item's search patterns. - Apply the migration wherever the codebase uses the changed API. Skip items that do not apply to this application. - Review any behavioral or default changes (such as config or middleware defaults) against `bootstrap/app.go`, `.env` / `.env.example`, and production settings, and call out anything the user should double-check in deployment environments. - Consult the relevant guide in `/` if you need full signature or behavior details for a migrated API. 4. Check `.agents/skills/` in this repository for any skill examples that reference changed APIs (for example, policy signatures in `.agents/skills/auth-and-authorization/SKILL.md`) and update them to stay in sync. ## 5. Verify the Application Run formatting, static analysis, tests, and a quick CLI smoke check: ```sh gofmt -w . go vet ./... go test ./... go run . route:list ``` Fix any remaining compilation errors, vet warnings, or failing tests caused by the upgrade until everything passes cleanly. ## 6. Summarize the Upgrade Report clearly to the user: - The version upgraded from and to (`vX.Y.Z` → `vA.B.C`). - Each upgrade item that applied to this application and which files were updated. - Any behavioral/default changes worth reviewing in `.env` or production config. - Verification results (`go vet`, `go test`).