
go-modern-guidelines
Modern Go idioms for every AI coding agent, free
Replaces —

Who it's for
Agents with these guidelines produce `slices.Contains` instead of manual search loops, `cmp.Or` instead of nil-check chains, and range-over-integers instead of C-style for loops. Code review feedback on outdated idioms drops without changing the underlying AI workflow.
Teams whose AI coding agents are not based on Junie, Claude Code, Codex, Cursor, or a skills.sh-compatible framework. The guidelines require a compatible agent; without one they have no effect.
In large codebases, consistent Go idiom use across all contributors and all AI-generated code matters for readability and `go vet` compliance. These guidelines shift the burden of idiom correction from reviewers to the AI agent, reducing per-PR overhead on teams with many contributors.
Projects targeting Go versions older than 1.25 without GOTOOLCHAIN=auto. The CLI targets Go 1.25 or newer; automatic toolchain switching (GOTOOLCHAIN=auto, the default) works around this, but teams with strict toolchain pinning may hit a setup hurdle.
When comparing AI coding agents on Go code quality, adding these guidelines removes training data lag as a variable. Any agent that supports the plugin model gets the same version-aware Go idiom coverage, making the evaluation about other capabilities instead.
Teams already satisfied with their AI agent's Go output. If the agent generates modern Go idioms without these guidelines, adding them produces no measurable change.
The problem
AI coding agents consistently generate outdated Go. Two structural problems drive this. First, training data lag: models cannot use language features added after their training cutoff, so a model that did not train on Go 1.26 will never write `errors.AsType[T](err)`, regardless of its general capability. Second, frequency bias: older Go patterns appear far more often in the training corpus than newer ones, so even features a model technically knows get pushed aside by patterns it has seen thousands of times more. The practical cost is constant review friction. Developers spend code review time pointing out that a C-style loop could be a range expression, that a nil-check chain could be `cmp.Or`, or that `slices.Contains` exists instead of a manual search loop. This overhead compounds on large codebases and degrades the productivity benefit that AI coding assistants are supposed to provide.
How it works
The agent reads the project's `go.mod` file to determine the target Go version and restricts its output to features and stdlib additions available up to that version. A project targeting Go 1.22 will not receive `errors.AsType[T]` suggestions, which requires Go 1.26. This prevents AI-generated code from introducing compatibility issues.
The guidelines document idiomatic patterns across 27 major Go releases, including every pattern targeted by the Go team's official `modernize` analyzer. Both language features (range-over-integers, updated type inference) and stdlib additions (slices, cmp, errors packages) are covered with concrete before-and-after examples.
Works as a native plugin in Junie, Claude Code, Codex, and Cursor. Any other agent that supports skills.sh can add it with a single command. Teams that switch AI coding tools keep their Go idiom coverage without reconfiguration.
In supported agents (Claude Code, Junie, Codex), the skill activates automatically when the agent detects a Go task. No per-prompt instruction or manual skill activation is required. The guidelines engage when relevant and stay inactive when they are not.
A `make dev-install` command builds the CLI into the tool's local cache and sets `GO_MODERN_GUIDELINES_DEV=1` so agents use the local build instead of the released version. After editing guidelines, running `make dev-install` again rebuilds without publishing a new release.
Features
- Go version detection from go.mod
- Coverage from Go 1.0 through Go 1.27
- Agent-agnostic plugin model
- Automatic invocation on Go tasks
- Local dev build for contributors
How to install
Clone the repository to install the guidelines locally; the Go toolchain must be on your PATH before any agent plugin setup will activate.
git clone https://github.com/JetBrains/go-modern-guidelinesRecommended for this setup
Strengths
- Works across any compatible AI coding agent: Unlike guidelines bundled with a specific paid tool, these work with Junie, Claude Code, Codex, Cursor, and any agent supporting skills.sh. Teams that switch AI coding tools do not lose their Go idiom coverage, and there is no lock-in to a single vendor or agent.
- Apache-2.0 license with no usage fees: The Apache-2.0 license permits free commercial use with no per-seat or per-query fees. GitHub Copilot and JetBrains AI Assistant both require paid subscriptions. These guidelines add zero cost on top of whatever agent the team already uses.
- Aligned with the Go team's modernize analyzer: The guidelines cover every pattern targeted by the Go team's own `modernize` analyzer, the official tool for updating codebases to modern Go idioms. Agents using these guidelines write new code that would already pass the same modernize checks the Go team recommends for production codebases.
- Actively maintained by JetBrains: JetBrains maintains GoLand and Junie, two primary tools in the Go development ecosystem. The repository was last updated on 2026-08-19 and covers Go 1.27, keeping the guidelines current with recent language releases.
Trade-offs
- Requires Go toolchain on PATH: The marketplace integrations run a small CLI installed on first use with `go install`. The Go toolchain must be present and available on PATH before the plugin will activate. Developers who run AI coding agents without a local Go installation need to install the toolchain first.
- Agent-specific install steps: Each supported agent has a different installation process: Junie uses `/extensions`, Claude Code uses `/plugin`, Codex uses its own CLI commands, and Cursor uses a marketplace command. There is no single universal install command across all agents.
- Not a standalone AI coding assistant: This is a guidelines package for existing AI coding agents, not a replacement for one. It only has an effect when paired with a compatible agent. Teams without an AI coding workflow in place get no direct benefit from installing it.
Tech stack
FAQ
Not directly. The plugin integrates natively with Junie, Claude Code, Codex, and Cursor. GitHub Copilot does not expose a compatible plugin or skills mechanism. Teams using Copilot can reference the raw guidelines file from the repository manually, but there is no automatic plugin integration available.
The guidelines cover idiomatic patterns from Go 1.0 through Go 1.27, including every pattern targeted by the official `modernize` analyzer. The agent detects the project's target version from `go.mod` and restricts its output to features available in that version.
Yes. The marketplace integrations run a small CLI installed on first use with `go install`, so the Go toolchain must be on your PATH. The CLI targets Go 1.25 or newer. On an older version, setting `GOTOOLCHAIN=auto` (the default) lets Go fetch a compatible toolchain automatically on first run.
No. Modern Go Guidelines is a plugin that adds Go-version-aware idiomatic guidance to compatible AI coding agents. It does not provide code completion, chat, or other full AI coding assistant features on its own. It complements an existing agent, including JetBrains AI Assistant, rather than replacing it.
In Claude Code, run these commands in a terminal: `claude plugin marketplace update goland-claude-marketplace` followed by `claude plugin update modern-go-guidelines@goland-claude-marketplace`. In Junie, run `/extensions update modern-go-guidelines` inside a session. For skills.sh, run `npx skills update use-modern-go -p -y`.