golang-modernize

Modernize Go source code with version-aware replacements for outdated constructs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Go codebases often accumulate outdated patterns, missed standard-library improvements, and security/performance regressions that linger as the language evolves.

Core Features & Use Cases

  • Targeted Go modernization: Updates code toward recent Go language features and idiomatic patterns while prioritizing safety and correctness.
  • Version-aware recommendations: Reads the project’s Go version (from go.mod/go.work) and suggests changes appropriate for that target.
  • Lint- and tooling-informed fixes: Uses golangci-lint’s modernize linter (when available) and aligns guidance with a structured migration priority.

Use Case: You’re reviewing a Go service that compiles today but still uses older constructs (manual defaults, legacy packages, brittle concurrency, or non-idiomatic slices/maps patterns). Use this skill to produce prioritized, review-ready modernization suggestions that match your Go version.

Quick Start

Ask an AI coding agent: Modernize my Go codebase using /golang-modernize, respecting our current go.mod target and prioritizing safety-critical fixes first.

Frequently Asked Questions about golang-modernize

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

FAQPage Schema
How do I modernize Go source code to use latest standard library improvements?

To modernize Go code safely, scan your codebase for outdated constructs and missed standard-library improvements, then apply version-correct replacements. This skill reads your project's Go version from go.mod and generates prioritized, review-ready suggestions appropriate for your target range.

What outdated Go patterns should I look for when upgrading a codebase?

Outdated Go patterns include manual defaults, legacy packages, brittle concurrency, and non-idiomatic slices and maps usage. A modernization scan identifies these alongside deprecated APIs and standard-library upgrades to produce prioritized recommendations that safely align your code with recent language features.

Does golangci-lint work with Go code modernization tools?

Yes, golangci-lint's modernize linter is utilized when available to inform fixes during the modernization process. It aligns guidance with a structured migration priority, using lint-driven refactors to identify opportunities and propose safe, version-aware code improvements.

Can I use this Go modernization approach for a specific Go version range?

Yes, the modernization process is version-aware, reading your project's Go version from go.mod or go.work files. It scans for opportunities appropriate to your target range, supporting Go 1.21 through 1.26 by default, and suggests changes suited for that specific version.

How do I exclude specific files from a Go codebase modernization scan?

You can exclude specific files or directories from a Go modernization scan by configuring a .modernize exclusions file. The scanning process honors these exclusions while analyzing your codebase for outdated patterns and proposing safe, version-correct replacements.

What is the best way to safely refactor Go concurrency patterns?

Safely refactoring Go concurrency patterns requires identifying brittle or outdated constructs and proposing idiomatic replacements prioritized by safety-critical fixes. A structured modernization approach avoids unrelated refactors, focusing on version-correct standard-library upgrades and lint-informed improvements.