modern-go

modern-go is a skill for Claude Code from smallnest/goal-workflow. It costs 102 tokens per session (8,707 once invoked), scanned A, a copy of modern-go, MIT.

A Go-code modernization tool that reads the project’s declared Go version and updates source files to use language features and programming patterns available in that version.

In plain words
What is it for?
Use it to modernize a whole Go project or a selected file or directory, while excluding vendor, testdata, and Git files.
Why use it?
It reduces manual work when replacing older Go code with newer, version-appropriate forms while avoiding features the project cannot use.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the goal-workflow-skills plugin — 19 skills shipped together

Good fit Use it to modernize a whole Go project or a selected file or directory, while excluding vendor, testdata, and Git files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/smallnest/goal-workflow/modern-go
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add smallnest/goal-workflow --skill modern-go
Clone the repo
git clone --depth 1 https://github.com/smallnest/goal-workflow

Made for: Claude Code.

Or install goal-workflow-skills, the plugin that ships this one along with the rest of its 19 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for modern-go

README.md
[![agentmods](https://agentmods.dev/badge/skills/smallnest/goal-workflow/modern-go.svg)](https://agentmods.dev/skills/smallnest/goal-workflow/modern-go)
Your own site
<a href="https://agentmods.dev/skills/smallnest/goal-workflow/modern-go"><img src="https://agentmods.dev/badge/skills/smallnest/goal-workflow/modern-go.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,707 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 19 May 2026
  • Snyk pass 19 May 2026
How audits are shown
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00102 $0.08707
Opus 5 $0.00051 $0.04353
Sonnet 5 $0.00020 $0.01741
Haiku 4.5 $0.00010 $0.00871

Measured 8d ago against content hash 576b8f7e955d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

modern-go scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

result := fetch(ctx)
Origin

This is a copy

100% identical to modern-go — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/modern-go/SKILL.md · 1,140 lines

How it starts

The opening of the file, as written. The whole thing — 1,140 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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)
// before
elapsed := time.Now().Sub(start)
// after
elapsed := time.Since(start)

Go 1.8+ — time.Until

Before After
deadline.Sub(time.Now()) time.Until(deadline)
// before
remaining := deadline.Sub(time.Now())
// after
remaining := time.Until(deadline)

Go 1.10+ — strings.Builder (loop concatenation)

Before After
s += item in a loop var b strings.Builder; b.WriteString(item)
// before
s := ""
for _, item := range items {
    s += item
}
// after
var b strings.Builder
for _, item := range items {
    b.WriteString(item)
}
s := b.String()

Only when += concatenation happens inside a loop.

Go 1.13+ — errors.Is

Before After
err == io.EOF errors.Is(err, io.EOF)

Read the full file on GitHub · 1,140 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 1,140 lines · 102 tokens per session scan A 576b8f7e955d

Subscribe to this mod's changes

modern-go is a skill published in the GitHub repository smallnest/goal-workflow (278 stars, last pushed 2d ago), licensed MIT. It adds 102 tokens to every session and 8,707 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to modern-go, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

go-mcp-server-generator

Generate a complete Go MCP server project with proper structure, dependencies, and implementation using the official github.com/modelcontextprotocol/go-sdk.

boshi-xixixi/TraeSkill · 32 tokens

developing-genkit-go

Develop AI-powered applications using Genkit in Go. Use when the user asks to build AI features, agents, flows, or tools in Go using Genkit, or when working with Genkit Go code involving generation, prompts, streaming, tool calling, or model providers.

google/skills · 60 tokens

authoring-go-sdk-tasks

Writes Airflow task logic in Go using the Airflow Go SDK. Use when the user wants to implement Airflow tasks in Go, asks about BundleProvider/RegisterDags, the bundlev1 Registry/Dag interfaces, registering Go tasks (AddTask/AddTaskWithName), dependency injection by parameter type (context.Context, sdk.TIRunContext…

astronomer/agents · 165 tokens

deploying-go-sdk-bundles

Builds, packs, and deploys compiled Airflow Go SDK bundles so the ExecutableCoordinator can run them. Use when the user wants to compile a Go task bundle, asks about go build, go tool airflow-go-pack, the AFBNDL01 self-contained executable bundle, packing or inspecting a bundle, placing it under executablesroot…

astronomer/agents · 146 tokens

loom-golang

Go language expertise for idiomatic, production-quality code.

cosmix/loom · 15 tokens

go-programming-expert

Expert-level skill for Go programming (Go 1.25+). Covers high-performance microservices, concurrency patterns, sqlc, net/http, Gin/Echo/Fiber, gRPC, and testing in English and Indonesian.

roedyrustam/vibes-plug · 51 tokens