cd /news/developer-tools/help-ai-coding-agents-write-up-to-da… · home topics developer-tools article
[ARTICLE · art-108929] src=blog.jetbrains.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Help AI Coding Agents Write Up-To-Date Code With Modern Golang Skills

JetBrains' GoLand team released Modern Go Guidelines, an open-source set of skills that help AI coding agents write up-to-date Go code matching the Go version in a project, covering features from Go 1.0 through Go 1.27. The tool uses a CLI with 'list' and 'explain' subcommands to provide focused context, and it excludes guidelines for newer versions when the project uses an older Go version, ensuring compatibility and reducing token usage.

read7 min views1 publishedAug 24, 2026
Help AI Coding Agents Write Up-To-Date Code With Modern Golang Skills
Image: Blog (auto-discovered)

AI

Community

GoLand

Repository on GitHub:Modern Go Guidelines.** Purpose**: Modern Go Guidelines are a set of skills that help AI coding agents write up-to-date Go code that matches the Go version in your project.Version support: The skills cover useful language features and standard library additions from Go 1.0 through Go 1.27. Guidelines for newer versions are excluded when your project uses an older version.Focused context: The tool useslist

for short guidelines andexplain

for detailed examples. This progressive disclosure approach gives agents detailed guidance only when they need it and helps them apply the skills more reliably.Installation: You can install the plugin from the marketplace or a local repository. The integration requires the Go toolchain, runs from a local cache, and does not modify your project.

AI coding agents can produce working Go code, but they typically rely on outdated patterns. Older syntax appears more often in their training data. Newer language features and standard library additions may also fall outside their training cutoff.

The GoLand team created Modern Go Guidelines to close this gap. These Golang skills give agents an up-to-date reference for writing modern code. They help agents select features supported by the Go version in your project and avoid code that requires a newer version.

Modern Golang skills are an open-source contribution from the GoLand team to the broader Go community. You can use them with supported AI coding agents in the terminal.

Newer code is useful only when your project can compile it. For this reason, the guidelines match the Go version declared in your go.mod file.

Consider a project that contains the go 1.25

directive.

The agent can receive skills for Go 1.25 and earlier. It does not receive Go 1.26 or Go 1.27 skills. For example, it can learn to use sync.WaitGroup.Go

, which Go 1.25 introduced. It will not receive a suggestion to use errors.AsType, which requires Go 1.26.

This version check ensures that the generated code is compatible with your project. It also reduces the amount of context the agent must read. The agent does not spend tokens on features that it cannot use.

CLI tool with focused output #

The agent uses a CLI tool that comes with the go-modern-guidelines plugin. It includes the use-modern-go skill, a set of instructions that teaches the agent when and how to use the CLI. The tool supports two main subcommands: list

and explain

. The skill tells the agent to run list

for the relevant Go file before editing and to call explain

when it needs details about a specific rule.

Each agent integration runs these subcommands through its own wrapper. The examples below use the CLI binary name.

Your agent uses the CLI to get skills for the Go version(s) used in your project. The list

subcommand returns short, relevant guidelines. When the agent needs more context, the explain

subcommand provides detailed guidance and code examples.

go-modern-guidelines list --file-path ./internal/worker/worker.go

Your agent can also set the version directly:

go-modern-guidelines list --go-version 1.27

The output starts with the newest applicable guidelines and includes a stable identifier (ID) for each one:

...
sync_waitgroup_go: Use wg.Go when spawning goroutines tracked by a sync.WaitGroup.
testing_t_context: Use t.Context() when a test function needs a context tied to the test lifetime.
json_omitzero: Use omitzero on JSON-tagged bool, numeric, struct, and time fields whose zero value should be omitted; keep omitempty for empty strings, slices, and maps.
...

The short output helps the agent find relevant guidance without all available explanations and code samples.

An agent may not recognize a recent Go feature or know how to apply it because the feature falls outside its training data. When the agent needs more information about a guideline, it uses the explain

subcommand.

go-modern-guidelines explain generic_methods

The command returns a detailed explanation and a before-and-after example. The example compares an older pattern with its modern replacement, helping the agent apply the change correctly.

generic_methods:
  Since: Go 1.27

  Summary:
    Use generic methods instead of package-level generic helper functions when the operation naturally belongs to the type itself.

  Details:
    Generic methods keep operations in the namespace of the type that owns them. Keep package-level helpers for operations that do not naturally belong to one receiver type.

  Examples:

  Before:
    type Set[T comparable] map[T]struct{}
    func Map[T comparable, U any](s Set[T], f func(T) U) []U {
      out := make([]U, 0, len(s))
      for value := range s {
        out = append(out, f(value))
      }
      return out
    }
    names := Map(users, func(user User) string {
      return user.Name
    })

  After:
    type Set[T comparable] map[T]struct{}
    func (s Set[T]) Map[U any](f func(T) U) []U {
      out := make([]U, 0, len(s))
      for value := range s {
        out = append(out, f(value))
      }
      return out
    }
    names := users.Map(func(user User) string {
      return user.Name
    })

Your agent can request several explanations in one command:

go-modern-guidelines explain generic_methods atomic_types errors_as_type

What the guidelines cover #

The project covers useful language features and standard library additions from Go 1.0 through Go 1.27. It also includes the patterns handled by the Go modernize analyzer.

The guidelines help agents choose patterns such as:

slices.Contains

instead of a manual search loop.min

andmax

instead of handwritten comparisons.cmp.Or

instead of a chain that selects the first nonzero value.sync.WaitGroup.Go

instead of separateAdd

,go

, andDone

calls.errors.AsType

for type-safe error matching in Go 1.26 and later.new(value)

when you need a pointer to a value in Go 1.26 and later.strings.CutLast

andbytes.CutLast

instead of LastIndex and manual slicing in Go 1.27.

These examples solve a common problem with generated code. An agent may know an older pattern because that pattern appears in a large body of existing code. The provision of explicit rules helps the agent choose the most current form of a given syntax.

These modern Go skills complement tools such as go fix

. Our repository helps agents write current code from the start, while the go fix

command helps update patterns that already exist in a codebase.

Installing the guidelines into your AI agent #

You can install the plugin from the marketplace or from a local repository. Both methods require the Go toolchain on your PATH

. On first use, the integration installs the command-line tool with go install

and stores it in a local cache. It does not modify your project.

Install the plugin from the marketplace

  • Open a session with your AI agent (for example, run claude

in the terminal). - Add the Modern Go Guidelines as a Claude marketplace:

/plugin marketplace add JetBrains/go-modern-guidelines
  • Install the plugin:
/plugin install modern-go-guidelines
  • Activate the guidelines:
/use-modern-go

The integration checks the Go version in your project and provides the AI agent with the corresponding guidelines.

Install the plugin from a local repository

Use a local repository to test the plugin before publishing or updating it. The repository root must contain the .*-plugin/marketplace.json

file.

  • Open a terminal and run your AI coding agent.
  • Add the local repository as a Claude marketplace. Replace the example path with the absolute path to your repository:
<claude|codex> plugin marketplace add /absolute/path/to/go-modern-guidelines
  • Install the plugin from the marketplace:
<claude|codex> plugin install modern-go-guidelines@goland-<claude|codex>-marketplace
  • Start or restart your AI agent in your Go project.
  • Activate the guidelines in the session:
/use-modern-go

The AI agent reads the marketplace definition from your local repository and installs the plugin in its plugin cache. Your repository remains the marketplace source.

Language releases move faster than model training cycles. Your coding agent needs a small, current source of truth to keep up.

Our repository of modern Golang skills provides that source, without sending irrelevant material to the agent. Your go.mod

file sets the boundary. The list

subcommand shows what applies. The explain

subcommand adds detail only when the agent needs it.

Explore the project, installation instructions, and current guidelines in the Modern Go Guidelines repository.

Happy coding!

The GoLand team

Subscribe to GoLang Blog updates

── more in #developer-tools 4 stories · sorted by recency
── more on @jetbrains 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/help-ai-coding-agent…] indexed:0 read:7min 2026-08-24 ·