Modern Go Guidelines
Purpose
AI coding agents can select outdated Go patterns. Their training data might not include features that were added after the model's knowledge cutoff. Even when an agent knows a newer pattern, it can choose an older pattern that appears more often in training data.
Modern Go Guidelines provides a reference for language features and standard library APIs.
Go version support
The agent reads the Go version declared in your project's go.mod file. It receives guidance only for features that are available in that version.
For example, an agent working in a project that uses Go 1.25 can use sync.WaitGroup.Go. It does not receive guidance for errors.AsType, which requires Go 1.26.
Guideline lookup
Modern Go Guidelines includes a command-line tool with the list and explain subcommands. The agent uses the tool through the installed skill.
Before it edits a Go file, the agent calls list for that file. The command returns short guidelines that apply to the Go version in your project:
The agent can also specify a Go version directly:
The output starts with the newest applicable guidelines. Each guideline has a stable ID:
When the agent needs more information about a guideline, it calls explain with the guideline ID. The command returns a description and before-and-after examples:
This workflow limits the guidance to the information that applies to the task.
Guideline content
Modern Go Guidelines cover useful language features and standard library additions from Go 1.0 through Go 1.27. They also include patterns covered by the Go modernize analyzer.
The guidelines help an agent use modern patterns, such as:
slices.Containsinstead of a manual search loop.minandmaxinstead of handwritten comparisons.cmp.Orinstead of a chain that selects the first nonzero value.sync.WaitGroup.Goinstead of separateAdd,go, andDonecalls.
For example, a guideline for Go 1.25 or later can replace manual WaitGroup bookkeeping:
WaitGroup.Go starts the goroutine and manages the matching Add and Done calls. The agent uses this pattern when the goroutine lifetime matches the WaitGroup lifetime.
Install Modern Go Guidelines
Modern Go Guidelines is available for Junie, Claude Code, Codex, Cursor, and other coding agents that support skills.
Install the Go toolchain and make it available on your PATH. On first use, the integration installs its command-line tool in a local cache. It does not modify your project.
Install from a marketplace
Add the Modern Go Guidelines repository as a marketplace.
In a Claude Code session, run:
/plugin marketplace add JetBrains/go-modern-guidelinesIn a terminal, run:
codex plugin marketplace add JetBrains/go-modern-guidelinesInstall the plugin from the marketplace.
/plugin install modern-go-guidelines@goland-claude-marketplacecodex plugin add modern-go-guidelines@goland-codex-marketplaceStart or restart the agent in your Go project. The agent uses the installed skill when it works with Go code.
Install from a local repository
Get a local copy of the Modern Go Guidelines repository. Use this method to test changes before you publish them.
Check that the repository contains the marketplace definition for your agent.
The repository root must contain .claude-plugin/marketplace.json.
The repository root must contain .agents/plugins/marketplace.json.
Add the local repository as a marketplace. Replace the example path with the absolute path to your repository.
claude plugin marketplace add /absolute/path/to/go-modern-guidelinescodex plugin marketplace add /absolute/path/to/go-modern-guidelinesInstall the plugin from the local marketplace.
claude plugin install modern-go-guidelines@goland-claude-marketplacecodex plugin add modern-go-guidelines@goland-codex-marketplaceStart or restart the agent in your Go project.
For Junie, Cursor, other agents, and update instructions, see the Modern Go Guidelines repository.
Update existing Go code
Modern Go Guidelines apply to new code. To find and update outdated code that is already in your project, use the Go syntax update inspections.