Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
By JetBrains
Automatically modernize Go code by applying syntax guidelines and features like slices, maps, cmp.Compare, min/max based on the project's Go version from go.mod, replacing outdated patterns with idiomatic alternatives.
npx claudepluginhub jetbrains/go-modern-guidelines --plugin modern-go-guidelinesThis repository contains guidelines for code agents that help them write modern Go code.
For example, an agent with these guidelines uses max(a, b) instead of an if-else block, slices.Contains instead of a manual loop, cmp.Or(a, b, c) instead of a chain of nil checks. It also knows about recent additions like new(42) to get a pointer to a value and errors.AsType[T](err) for type-safe error matching—both from Go 1.26.
The guidelines cover the most useful features from Go 1.0 through Go 1.26, including everything targeted by the modernize analyzer. An agent will:
go.modAll coding agents tend to generate outdated Go. Two reasons:
Training data lag. Models don't know about features added after their training cutoff. They can't use errors.AsType[T] (Go 1.26) if they've never seen it.
Frequency bias. Even for features the model knows, it often picks older patterns. There's more for i := 0; i < n; i++ in the training data than for i := range n, so that's what comes out.
These guidelines fix both problems by giving the agent an explicit reference.
This aligns with the Go team's direction. The modernize analyzer exists to automatically update existing code to use newer idioms (see this talk from the Go team). These guidelines serve the same goal for new code: agents write modern Go from the start, so there's less to fix later.
The guidelines are available for Junie and Claude Code.
Starting with version 2xx.620.xx, Junie includes the modern Go guidelines out of the box. No manual setup is required — just make sure you're running a compatible version.
Go to Settings → Plugins → Installed, find Junie, and click Update if a newer version is available.
The guidelines are controlled via Settings → Tools → Junie → Project Settings → Go. The Provide modern Go guidelines option is enabled by default. Disable it if you prefer Junie to generate code without these guidelines.
For convenience, the guidelines are distributed as a Claude Code plugin.
Run the following commands inside a Claude Code session.
/plugin marketplace add JetBrains/go-modern-guidelines
/plugin install modern-go-guidelines
The plugin adds the /use-modern-go command. Run it at the start of a session to activate the guidelines:
/use-modern-go
The command detects the Go version from go.mod and tells the agent to use features up to that version:
> /use-modern-go
This project is using Go 1.24, so I'll stick to modern Go best practices
and freely use language features up to and including this version.
If you'd prefer a different target version, just let me know.
After this, any Go code the agent writes will follow the guidelines.
Share bugs, ideas, or general feedback.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Go development following Google Go style guide with Go 1.25+ features and best practices
Gopher Guides training materials integrated into Claude
Enhances code agents with Go best practices covering performance, modern syntax, generics, patterns, testing, error handling, and concurrency.
gopilot is your Go copilot - a skill for writing idiomatic Go code, covering design patterns, error handling, testing, concurrency, generics, and stdlib patterns up to Go 1.26.
Go changes since training cutoff (latest: 1.26.0) — new(expr) builtin, errors.AsType, self-referential generics, reflect iterators, go fix modernizer. Load before working with Go.
Review Go code for adherence to Go Style Guide
Agent skill for interacting with TeamCity CI/CD using the teamcity CLI. Enables Claude to explore builds, view logs, start jobs, manage queues, agents, and more.
PhpStorm plugin for advanced IDE integration
Inspect and analyze WebAssembly modules through MCP tools backed by the Hexana runtime.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claim