golang-modernize

Identify Go code modernization opportunities with version-compatible change proposals.

2.9k|191|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/samber/cc-skills-golang --skill golang-modernize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-modernize
Source: https://github.com/samber/cc-skills-golang/tree/main/skills/golang-modernize
Command: npx skills add https://github.com/samber/cc-skills-golang --skill golang-modernize

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeps Go code current by automatically applying modern idioms, language features, and standard library improvements, reducing technical debt and improving readability, safety, and performance.

Core Features & Use Cases

  • Continuous Go modernization guided by Go version milestones (Go 1.21–Go 1.26) to surface appropriate patterns such as min/max, slices/maps, and modern error handling, while advising on tooling upgrades (linting, security checks, and CI pipelines).
  • Guidance for upgrading Go versions, migrating to idiomatic constructs, and adopting standard library replacements to future-proof code bases.
  • Use Case: When writing or reviewing Go code, the skill suggests concrete modernizations during refactors or code reviews and helps plan long-term modernization roadmaps.

Quick Start

Describe one concrete modernization you would apply to the current Go file or project and outline the expected impact.

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 code to use newer standard library features?

Modernizing Go code involves identifying idiomatic patterns and standard library replacements, such as using built-in min and max functions or the slices and maps packages, guided by your project's Go version. This improves safety and performance while reducing technical debt.

What are the most common Go idioms to upgrade in older projects?

Upgrading older Go projects often involves adopting modern error handling, replacing custom utility functions with slices and maps packages, and using built-in min and max. These idiomatic upgrades are surfaced by checking compatibility against Go 1.21 through 1.26 milestones.

Can I get Go code recommendations that respect my current Go version compatibility?

Yes, the modernization process applies Go version compatibility checks to propose safe, version-appropriate changes. It avoids recommending refactors beyond your current context unless explicitly requested, ensuring code remains stable and compatible.

Does Go modernization include suggestions for linting and CI tooling upgrades?

Yes, modernizing Go code includes advising on tooling and CI pipeline upgrades, such as integrating updated linting and security checks. These tooling changes support ongoing modernization by automatically enforcing idiomatic patterns and standard library usage.

When should I avoid applying Go modernization refactors?

You should avoid broad Go modernization refactors when they extend beyond the current task scope. The process deliberately avoids suggesting refactors beyond the immediate context unless explicitly requested, keeping changes focused, safe, and reviewable.

What is the best way to plan a long-term Go modernization roadmap?

Planning a long-term Go modernization roadmap involves mapping version milestones from Go 1.21 to 1.26 to schedule the adoption of new language features, standard library improvements, and CI tooling upgrades. This systematically future-proofs the codebase against technical debt.