AI programming agents may produce executable Go code, but that does not mean they use the latest language syntax or standard-library additions. Older Go patterns are much more prevalent in training data, while newer features may not appear in the data the model relied on. To address this gap, the GoLand team at JetBrains created an open-source project called Modern Go Guidelines, which provides agents with practical guidance tied to the Go version declared in the project.
What does the project provide?
The guidelines cover useful language features and standard-library additions in Go versions from 1.0 to 1.27, along with patterns handled by the go modernize analyzer. The agent does not receive guidance for versions newer than the one used in the project. If the go.mod file contains the go 1.25 directive, the agent can use Go 1.25 guidance and guidance for earlier versions, but it will not receive suggestions that depend on Go 1.26 or Go 1.27.
According to the example given in the article, this means the agent can suggest sync.WaitGroup.Go, which was introduced in Go 1.25, but it will not suggest errors.AsType, which requires Go 1.26. Linking the guidance to the project version aims to reduce the likelihood of generating code that requires a newer version than the available environment, while also reducing the amount of unnecessary context the agent reads.
Progressive disclosure instead of loading all the context
The plugin includes a command-line tool called go-modern-guidelines and an instruction skill called use-modern-go. The tool supports two main commands:
- list: Displays short, relevant guidelines for a Go file or a specific version.
- explain: Provides a more detailed explanation and an example comparing the old pattern with the modern alternative.
The instructions suggest that the agent run the list command for the relevant file before modifying it, then use explain when it needs to understand a specific rule. Guidelines can be requested for a file such as ./internal/worker/worker.go, or the version can be specified directly using --go-version 1.27. The output of list begins with the latest applicable guidelines and includes a stable identifier for each rule, such as sync_waitgroup_go, testing_t_context, and json_omitzero.
Examples of modern patterns
The guidelines include practical examples of replacing common patterns with newer ones, such as using slices.Contains instead of a manually written search loop, min and max instead of manual comparisons, and cmp.Or instead of a chain that selects the first non-zero value.
They also explain using sync.WaitGroup.Go instead of distributing Add, go, and Done operations separately; using errors.AsType for type-safe error matching in Go 1.26 and later; and using new(value) when a pointer to a value is needed in Go 1.26 and later. In Go 1.27, the guidelines present strings.CutLast and bytes.CutLast as alternatives to LastIndex and manual slicing.
The example for generic_methods, available since Go 1.27, shows how a generic operation can be moved from a package-level helper function to a method on the type when the operation is naturally associated with that type. The explain command returns an explanation of the rule with a before-and-after example, and it can also explain multiple rules in a single invocation.
What changes in practice for developers?
The core value here is not automatically updating old code, but giving the agent a small, targeted reference while it generates or modifies code. The project integrates with tools such as go fix rather than replacing them: Modern Go Guidelines helps the agent start with a modern pattern, while go fix helps update patterns that already exist in the codebase.
The plugin can be installed from the plugin marketplace or from a local repository. Integration requires the Go toolchain to be in PATH. On first use, the integration installs the command-line tool through go install and stores it in a local cache, without modifying the project itself. The article presents commands for adding the repository as a Claude marketplace, installing modern-go-guidelines, and enabling /use-modern-go. It also mentions a path for testing a local repository before publishing or updating it, with examples involving Claude and Codex.
certi.news reading
The project addresses a practical problem in using AI agents: code being correct from a build perspective does not guarantee that it is appropriate for the language version or that it follows the best available patterns. Tying the guidelines to the go.mod file establishes a clear technical limit on what the agent can suggest, while progressive disclosure reduces the risk of overwhelming it with context it does not need. However, the tool does not eliminate the need for developer review or testing; it provides rules and examples for the agent, and the source does not establish that it independently verifies every change it produces. The announced coverage also reaches Go 1.27, so guidance for newer versions will still need to be added and updated.