go-modernize

Modernize legacy Go code with Go 1.21+ features and standard library practices.

Updated May 2, 2026
One-click install
npx skills add https://github.com/Qunnnn/agents --skill go-modernize-qunnnn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-modernize
Source: https://github.com/Qunnnn/agents/tree/main/skills/go/go-modernize
Command: npx skills add https://github.com/Qunnnn/agents --skill go-modernize-qunnnn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers update outdated Go codebases by replacing legacy patterns with modern Go 1.21+ language features and standard library improvements.

Core Features & Use Cases

  • Modern Go Migration Guidance: Provides recommendations for adopting features such as any, generics, built-in min/max, slices, maps, and structured logging.
  • Legacy Pattern Replacement: Helps identify deprecated approaches and migrate toward current Go APIs like log/slog and math/rand/v2.
  • Use Case: Apply this Skill when reviewing an older Go service to incrementally modernize its code style, dependencies, and tooling practices.

Quick Start

Use the go-modernize skill to review my Go codebase and suggest updates needed for compatibility with modern Go versions.

Frequently Asked Questions about go-modernize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I modernize legacy Go code to use generics and the standard library?

To modernize legacy Go code, you replace outdated patterns with current Go 1.21+ language features and standard library improvements. This involves adopting generics, built-in min/max functions, and collection utilities from the slices and maps packages.

What is the best way to migrate an old Go service to structured logging?

Migrating an old Go service to structured logging involves replacing legacy logging approaches with the modern log/slog package. This standard library improvement provides structured logging capabilities natively available in Go 1.21+.

Can I use this approach for incremental code refactoring during a version upgrade?

Yes, you can apply incremental code refactoring during a Go version upgrade. This approach helps identify deprecated APIs and incrementally modernizes code style, dependencies, and tooling practices without requiring a full rewrite.

Does modernizing Go code require updating to specific standard library versions?

Modernizing Go code requires targeting Go 1.21+ to access updated APIs like math/rand/v2 and log/slog. Adopting these current standard library practices ensures compatibility with modern Go versions and replaces deprecated approaches.

How does code review help identify deprecated Go patterns?

Code review helps identify deprecated Go patterns by evaluating an older codebase against current language features. It targets outdated practices and recommends migrating toward modern APIs, updated collection utilities, and current tooling workflows.