go-modern

Apply version-aware modern Go idioms from go.mod to edited code.

Updated Feb 19, 2026
One-click install
npx skills add https://github.com/fall-out-bug/sdp_lab --skill go-modern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-modern
Source: https://github.com/fall-out-bug/sdp_lab/tree/main/.agents/skills/go-modern
Command: npx skills add https://github.com/fall-out-bug/sdp_lab --skill go-modern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Edit and review Go code in a way that respects the repository's targeted Go version, preventing outdated patterns and ensuring consistent idioms.

Core Features & Use Cases

  • Detect and enforce: determine the Go version from go.mod or sdp-plugin/go.mod and restrict changes to features supported by that version.
  • Promote modern idioms: prefer stdlib-based improvements (e.g., slices.SortFunc, strings.Cut, maps.Clone) to simplify code without altering behavior.
  • Guided verification: provide a practical checklist and examples for safe modernization, plus recovery steps if tests fail.

Quick Start

Inspect the repository's Go version in go.mod or sdp-plugin/go.mod, then apply only language features and stdlib patterns supported by that version when editing or reviewing Go code.

Frequently Asked Questions about go-modern

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

FAQPage Schema
How do I modernize Go code while respecting the repository's targeted Go version?

To modernize Go code safely, detect the targeted version from go.mod and restrict changes to supported features, preventing outdated patterns. This ensures version-aware idioms and consistent code across the repository.

What are the best stdlib-based improvements for modern Go code review?

The best stdlib-based improvements for Go code review include adopting slices.SortFunc, strings.Cut, and maps.Clone to simplify code without altering behavior. These modern idioms replace older, verbose patterns.

How does version-aware Go code editing handle features not supported by go.mod?

Version-aware Go code editing prevents the use of features not supported by go.mod by constraining changes to the detected version. This avoids introducing incompatible language features during code editing.

What should I do if tests fail after applying modern Go idioms?

If tests fail after applying modern Go idioms, follow the provided recovery guidance to revert or adjust changes. The skill includes a practical review checklist to verify safe modernization steps.

Can I use slices.SortFunc and strings.Cut in older Go versions?

You cannot use slices.SortFunc and strings.Cut in older Go versions if unsupported by the version in go.mod. Version-aware editing ensures you only apply stdlib patterns supported by the repository's target version.