modern-go

Modernize Go source code with version-appropriate idioms and APIs.

207|30|Updated May 16, 2026
One-click install
npx skills add https://github.com/smallnest/goal-workflow --skill modern-go
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modern-go
Source: https://github.com/smallnest/goal-workflow/tree/main/skills/modern-go
Command: npx skills add https://github.com/smallnest/goal-workflow --skill modern-go

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers modernize existing Go code by replacing outdated patterns, APIs, and language constructs with version-appropriate idioms, reducing manual refactoring effort and keeping codebases aligned with current Go releases.

Core Features & Use Cases

  • Version-aware modernization: Detects the project's Go version from go.mod and only applies transformations that are compatible with that release.
  • Idiomatic refactoring: Updates common patterns such as time handling, string building, slices and maps utilities, context helpers, and newer concurrency helpers where appropriate.
  • Codebase upgrade workflows: Useful when cleaning up legacy repositories, preparing a version bump, or standardizing code after a large migration across packages or files.

Quick Start

Ask the skill to modernize the current Go project or a specific folder so it can scan the code, apply compatible upgrades, and summarize the changes.

Frequently Asked Questions about modern-go

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

FAQPage Schema
How do I modernize legacy Go code to use newer idioms and APIs?

To modernize Go code, this Skill scans .go files and replaces outdated patterns with version-appropriate equivalents. It updates imports and reports applied changes to align your codebase with current Go releases.

Does Go modernization respect my project's target version in go.mod?

Yes, Go modernization reads the target version from go.mod and applies only compatible transformations. It ensures no changes are made that would break your specified Go release, skipping incompatible upgrades.

What is the best way to refactor Go code for a version upgrade across a whole repository?

The best way to refactor Go code for a version upgrade is applying version-aware modernization across packages or files. This updates slices, maps, context, and concurrency helpers to match newer Go idioms automatically.

Can I upgrade Go source code for a single file instead of a full project?

Yes, you can upgrade Go source code for a single file, specific packages, or whole repositories. The Skill scans the targeted scope, applies compatible transformations, and summarizes the applied and skipped changes.

How do I know which Go refactoring changes were skipped during modernization?

During Go refactoring, the Skill reports both applied and skipped changes. This transparent reporting shows exactly which outdated patterns were updated and which transformations were incompatible with your Go version.