go-modern-guidelines: Modernizing Legacy Go Code Written by AI Agents
JetBrains/go-modern-guidelines
About the project
Solves the problem of coding agents generating Go code filled with outdated syntax. It prevents agents from being unaware of the latest features or preferring familiar legacy patterns due to time lags and frequency biases in training data. It detects the project's Go version from go.mod and explicitly provides language features and standard library additions available up to that version.
It covers core features from Go 1.0 to 1.27, including all items handled by the modernize analyzer. Agents use max(a, b) instead of if-else, slices.Contains instead of manual loops, and cmp.Or(a, b, c) instead of chained nil checks. It also accurately applies the latest features introduced in Go 1.26, such as new(42) and errors.AsType[T](err).
It follows the same direction as the modernize analyzer, created by the Go team to automatically update existing code to modern syntax. Instead of modifying existing code, it guides agents to write modern Go code from the start. This reduces the amount of code that needs to be fixed later, improving development efficiency.
It can be used with major coding agents such as Junie, Claude Code, Codex, and Cursor, and can be applied to other agents via skills.sh. Go 1.25 or higher is recommended, but it works with older versions in environments where automatic toolchain switching is enabled. It is suitable for developers who want to modernize Go syntax when using AI-based code generation.
JetBrains/go-modern-guidelines
Help AI coding agents write modern Go
Go
This introduction was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report errors, attribution issues, or removal requests via Contact.