Agent skill

modern-go

Modernize Go code by applying version-appropriate idioms and APIs (gofix-style transformations). Scans go.mod for the Go version, then transforms Go source files to use modern patterns—from Go 1.0 through 1.26+. Use when the user says "现代化","现代Go语言", "地道的", "idiomatic", "modernize", "modern-go", "update Go code", "gofix", or wants to upgrade Go idioms.

smallnestgithub.com/smallnestGitHub ↗
claude-codecodexMIT
Install
npx skills add smallnest/goal-workflow --skill modern-go --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 28 KB
Bundled scripts: none
Path: skills/modern-go/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 199
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# modern-go Modernize Go source code by applying version-appropriate idioms, APIs, and language features. Works like `go fix` plus additional transformations curated from the Go team's modernize analysis passes and community best practices. ## Usage Invoke this skill when the user asks to modernize Go code. By default, modernize the entire project; the user may specify a file or directory instead. When invoked: 1. Detect the project's Go version from `go.mod` (the `go` directive). 2. Find all `.go` files in the target scope (excluding `vendor/`, `.git/`, `testdata/`). 3. For each file, apply **all transformations for versions ≤ the project's Go version**, starting from the oldest to the newest. 4. After all transformations, print a summary of what was changed and what was skipped. If the user specifies a file or directory, limit the scope to that path. ## Transformation Catalog Each transformation includes a **Go version** gate—only apply when the project's `go.mod` version ≥ that version. Never apply a transformation that requires a version higher than the project declares. ### Go 1.0+ — `time.Since` | Before | After | |---|---| | `time.Now().Sub(start)` | `time.Since(start)` | ``

What's inside
Steps it walks through
  1. Usage
  2. Transformation Catalog
  3. Go 1.0+ — time.Since
  4. Go 1.8+ — time.Until
  5. Go 1.10+ — strings.Builder (loop concatenation)
  6. Go 1.13+ — errors.Is
  7. Go 1.17+ — //go:build constraints (plusbuild)
  8. Go 1.17+ — unsafe.Add / unsafe.Slice (unsafefuncs)
  9. Go 1.18+ — any
  10. Go 1.18+ — strings.Cut
  11. Go 1.18+ — bytes.Cut
  12. Go 1.19+ — fmt.Appendf
  13. Go 1.19+ — Type-safe atomics (atomictypes)
  14. Go 1.20+ — strings.Clone
Commands it runs
go fix ./...
More from goal-workflow
All skills →
About this skill
What does the modern-go skill do?

Modernize Go code by applying version-appropriate idioms and APIs (gofix-style transformations). Scans go.mod for the Go version, then transforms Go source files to use modern patterns—from Go 1.0 through 1.26+. Use when the user says "现代化","现代Go语言", "地道的", "idiomatic", "modernize", "modern-go", "update Go code", "gofix", or wants to upgrade Go idioms.

How do I install it?

Run `npx skills add smallnest/goal-workflow --skill modern-go --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From smallnest/goal-workflow, a repository with 199 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going