JetBrains/go-modern-guidelines
Help AI coding agents write modern Go
JetBrains / go‑modern‑guidelines – Quick Overview
What it is – A small, open‑source rule‑set (delivered as a CLI plugin) that teaches code‑generation agents (Junie, Claude Code, Codex, Cursor, etc.) how to write modern Go. It encodes the idioms and std‑lib additions introduced from Go 1.0 up to Go 1.27, so an agent can automatically pick the newest, most concise patterns instead of falling back to legacy code.
Why it matters – Large language models often generate Go that predates the latest language features because their training data stops at an older version. This leads to verbose or outdated code that later needs manual “modernise” passes. The JetBrains guidelines give agents an explicit, version‑aware reference, reducing that lag and the amount of post‑generation cleanup.
Core Features
| Feature | What it does |
|---|---|
| Version‑aware suggestions | Reads the project’s go.mod to know which language version is allowed and only suggests features that exist in that version. |
| Modern idiom library | Encodes patterns such as max(a,b), slices.Contains, cmp.Or, new(42), errors.AsType[T], etc., with concrete examples (see FEATURES.md). |
| Agent‑agnostic packaging | Distributed as marketplace extensions for Junie, Claude Code, Codex, Cursor, and as a generic skills.sh package, so any supported AI‑coding assistant can load it. |
| Zero‑impact CLI | Installs a tiny helper (go install …) into a per‑user cache; it never mutates the target project’s files. |
| Toolchain‑friendly | Works with Go 1.25+; on older installations it auto‑downloads a compatible toolchain via GOTOOLCHAIN=auto. |
| Local development mode | make dev-install builds a custom version of the CLI that agents will pick up when GO_MODERN_GUIDELINES_DEV=1 is set, making it easy to test changes. |
Who should use it?
- AI‑coding assistants that want to improve the quality of generated Go code.
- Developers who rely on agents like Junie, Claude Code, Codex, or Cursor and want the output to already follow the latest Go best practices.
- Tool maintainers who wish to ship a “modern‑go” skill across multiple AI platforms.
Installation & Activation (summary)
- Add the repository to the agent’s marketplace (commands differ per agent – see the README).
- Install the
modern-go-guidelinesplugin/extension via the agent’s CLI (/extensions install modern-go-guidelines,codex plugin add …, etc.). - The agent will automatically invoke the skill when a Go task is detected.
- For manual use you can run the explicit command (e.g.,
/modern-go-guidelines:use-modern-goin Claude Code).
Updating
Each agent provides its own update flow (CLI command, marketplace UI, or reinstall). The README lists the exact commands for Junie, Claude Code, Codex, Cursor, and the generic skills.sh tool.
Contributing
The project welcomes contributions. See CONTRIBUTING.md for guidelines, and use make dev-install to test changes locally. The development workflow is deliberately isolated from the agent‑side wrapper to prevent accidental builds during normal usage.
Bottom line
JetBrains/go‑modern‑guidelines is a lightweight, version‑aware “cheat sheet” packaged as a plugin that enables AI code‑generation agents to emit up‑to‑date, idiomatic Go out of the box, cutting down on post‑generation refactoring.
Written about in
Related
- Project
- Dispatch
- Project
- Project
- Dispatch