Frequency bias makes AI agents write outdated Go; a skill package is the right fix
on: JetBrains/go-modern-guidelines
Coding agents write outdated Go. This repo is JetBrains' direct response to that problem, and the diagnosis is precise: models suffer from both training data lag and frequency bias. A model that has never encountered errors.AsType[T] from Go 1.26 cannot use it. And even for features a model technically knows, older patterns dominate training corpora — the classic C-style for loop appears far more often than for i := range n, so that is what gets generated.
The fix is a skill package: a structured reference that agents load before writing Go code. The guidelines cover language features and standard library additions from Go 1.0 through Go 1.27, explicitly mirroring the scope of the Go team's own modernize static analyzer. The idea is that modernize cleans up existing code; these guidelines prevent the mess from being written in the first place.
The practical examples are concrete. An agent equipped with this skill reaches for max(a, b) rather than an if-else, slices.Contains rather than a manual loop, cmp.Or rather than a chain of nil checks. It reads the project's go.mod to determine which Go version is in use, then constrains itself to features available up to that version — so it will not introduce a Go 1.26 API into a codebase targeting an earlier release.
Distribution is handled through a small CLI installed on first use via go install, cached locally, and never touching the project itself. The same skill package works across Junie, Claude Code, Codex, Cursor, and any agent that supports skills.sh. Each integration has its own install command, but the underlying skill file is shared.
The requirement for a Go toolchain on PATH is real friction for teams that do not already have one, though the default GOTOOLCHAIN=auto setting means Go can fetch a compatible toolchain automatically if the installed version is older than what the CLI targets.
For anyone building Go with an agent today, the frequency-bias argument alone is worth taking seriously. Models default to what they have seen most, and the Go ecosystem has years of pre-modern idioms in public repositories. An explicit, versioned reference is a straightforward correction to a structural problem in how language models relate to evolving languages.
A versioned Go idiom reference that corrects the frequency bias pushing agents toward outdated patterns — practical and honestly scoped.