golang-modernize

Modernize Go codebases with version-aware API and tooling recommendations.

2|Updated Mar 13, 2023
One-click install
npx skills add https://github.com/haipham22/golang-sample --skill golang-modernize-haipham22
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-modernize
Source: https://github.com/haipham22/golang-sample/tree/main/.agents/skills/golang-modernize
Command: npx skills add https://github.com/haipham22/golang-sample --skill golang-modernize-haipham22

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps teams modernize Go codebases by replacing outdated APIs, patterns, and tooling with safer and more idiomatic modern alternatives.

Core Features & Use Cases

  • Version-Aware Modernization: Recommends changes that match the project's Go version and avoids suggesting features that are not yet available.
  • Safety and Correctness First: Prioritizes fixes like path traversal protection, vulnerability checks, and concurrency safety before cosmetic refactors.
  • Language and Tooling Upgrades: Covers modern standard library APIs, testing improvements, benchmark updates, CI refreshes, and dependency cleanup.
  • Use Case: A team upgrading a production service can use this Skill to identify high-value code fixes, improve test reliability, and refresh build tooling without unnecessary large-scale refactors.

Quick Start

Ask the skill to review your Go project for modernization opportunities and return prioritized, version-safe recommendations.

Frequently Asked Questions about golang-modernize

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

FAQPage Schema
How do I modernize a Go codebase to use current idiomatic patterns?

Modernize a Go codebase by replacing outdated APIs and tooling with safer, current idiomatic equivalents. This process targets concurrency, testing, filesystem safety, JSON tags, and routing to produce version-aware recommendations aligned to the project's Go directive.

What is the best way to upgrade Go standard library APIs safely?

Upgrading Go standard library APIs safely involves prioritizing security and correctness fixes like path traversal protection and vulnerability checks before cosmetic refactors. Recommendations must match the project's Go version to avoid suggesting features that are not yet available.

How do I refactor Go code for concurrency safety and better testing?

Refactor Go code for concurrency safety and better testing by applying targeted updates to standard library APIs and benchmark configurations. This approach improves test reliability and refreshes build tooling without requiring unnecessary large-scale refactors.

Does Go modernization work with older project versions?

Go modernization works with older project versions by generating version-aware recommendations that respect the project's Go directive. It avoids suggesting features that are not yet available in the target version, ensuring safety and correctness for legacy codebases.

When should I not use automated Go refactoring tools?

You should avoid automated Go refactoring when a project requires large-scale architectural changes rather than targeted modernization. This approach prioritizes high-value code fixes, dependency cleanup, and CI refreshes without unnecessary structural refactors.

How do I refresh Go CI pipelines and dependency maintenance?

Refresh Go CI pipelines and dependency maintenance by identifying outdated tooling and applying current standard library upgrades. This yields prioritized, version-safe recommendations that improve build reliability and clean up project dependencies.