Skip to content
Skill

Go modernize

Guides an agent to modernize Go code with newer language and stdlib features

Go modernize is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
90
Last commit
License
MIT
Listing updated

Similar skills

About Go modernize

Go Modernize helps an agent update existing Go code to use features added between Go 1.21 and 1.27, such as generics, log/slog, errors.Join, the slices and maps packages, iterators, and the stdlib uuid package. It works incrementally: the agent first checks the go directive in go.mod, since it should never adopt a feature newer than that version, and raising the directive is treated as a separate change with its own breakage checklist.

The skill walks the agent through a procedure that runs the official Go modernizers first (go fix on Go 1.26 and later, or the modernize analyzer on older toolchains) and then applies judgment-based migrations such as replacing interface{} with type parameters or replacing log calls with structured slog output. It defines three modes: inline changes limited to lines already being edited, a version bump mode, and a sweep mode that splits work into one commit per category.

It expects a Go project with the Go toolchain installed, and gopls is optional for the modernize analyzer. The agent is expected to run the build and test suite after each group of changes. Detailed before-and-after examples are kept in reference files that the agent loads only when needed.

When your agent uses it

Modernize Go code to use current language features and standard library additions, Go 1.21 through 1.27: generics and generic methods, log/slog, errors.Join, slices/maps, iterators, encoding/json/v2, stdlib uuid. Use when: "modernize", "update to modern Go", "use generics", "replace interface{}", "upgrade Go version", "slog", "errors.Join", "range over func", "iterators". Not for: general style (go-coding-standards), error philosophy (go-error-handling), logging architecture (go-observability).

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 5 files (33 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.

What it does

Incremental modernization workflow
Checks the go.mod directive first and applies changes in small, buildable steps.
Official modernizer integration
Runs go fix or the modernize analyzer to apply mechanical migrations automatically.
Version-by-version feature table
Lists which replacements apply from Go 1.13 through Go 1.27.
Go version bump checklist
Covers prerequisites and per-release breakage checks before raising the go directive.
Priority-ordered changes
Ranks correctness and security fixes above readability and gradual migrations.

Good for

  • Replace interface{} helpers with generics in a Go package
  • Convert log.Printf calls to structured log/slog output
  • Swap manual error accumulation for errors.Join
  • Replace hand-written slice and map loops with the slices and maps packages
  • Raise the go directive in go.mod and check for breakage

Go modernize FAQ

Which tools does the skill need?

It needs the Go toolchain. gopls is optional and is used for the modernize analyzer.

Will Go modernize change the go version in go.mod?

No. Raising the go directive is a separate version bump mode that the skill handles only deliberately, in its own commit.

Does Go modernize change every file in a project at once?

By default, inline mode only modernizes lines already being changed. A full sweep is done only when asked and is split into one commit per category.

Does Go modernize run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Go modernize?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Go modernize?

The closest alternatives to Go modernize are Go refactoring, Go dependency audit, Axiom modernize, Java upgrade and Modern cpp.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from eduardo-sl/go-agent-skills

  1. Guides Go agents in designing HTTP REST APIs, handlers, middleware and shutdown

    • Open source
    • 90 GitHub stars
    • Developer tools
  2. Reviews Go project structure, dependency direction and module boundaries

    • Open source
    • 90 GitHub stars
    • Developer tools
  3. Guides an AI agent to build Go command-line tools with clean flags, streams and exit codes

    • Open source
    • 90 GitHub stars
    • Developer tools
  4. Guides Go code toward constructor injection, explicit wiring and no global state

    • Open source
    • 90 GitHub stars
    • Developer tools
  5. Guides Go code toward idiomatic design patterns like functional options and factories

    • Open source
    • 90 GitHub stars
    • Developer tools
  6. Guides building Go GraphQL servers with gqlgen, covering N+1 batching and query limits

    • Open source
    • 90 GitHub stars
    • Developer tools