TrendWhat rose on GitHub, every day at 07:30 KST · 한국어

GitHub · as of November 8, 2026 · View on GitHub →

JetBrains/go-modern-guidelines

Go coding guidelines repository

+47 stars in 7 days

Enable AI coding agents to write modern Go syntax

This repository provides a set of guidelines that help AI agents utilize the latest features from Go 1.0 through 1.27. It ensures that agents check the project's Go version and prioritize modern syntax and standard library functions available in that version, reducing the need for manual fixes of outdated code.

Why AI writes outdated Go

AI coding agents generate outdated Go code for two reasons. First, there is a time lag in training data; models do not know about features added after their training cutoff, such as errors.AsType[T] introduced in Go 1.26. Second, frequency bias means models are more likely to select older patterns like for i := 0; i < n; i++ because they appear more frequently in training data. These guidelines provide explicit reference material to address both issues. They share the goal of the Go team's modernize analyzer, which updates existing code to modern syntax, by ensuring new code is written with modern Go from the start to reduce future maintenance.

Modern syntax applied by agents

The guidelines cover useful features from Go 1.0 to 1.27, including all items handled by the modernize analyzer. Agents detect the project's Go version from the go.mod file and use language features and standard library additions available up to that version. For example, they use max(a, b) instead of if-else blocks, slices.Contains instead of manual loops, and cmp.Or(a, b, c) instead of nil check chains. They also apply modern features like obtaining a pointer to a value with new(42) or using errors.AsType[T](err) for type-safe error matching. The detailed feature list and examples are available in the FEATURES.md file.

Installation for supported agents

The guidelines support Junie, Claude Code, Codex, and Cursor, and can be applied to other agents via skills.sh. Each agent requires different commands to add the repository to its marketplace and install the plugin. In the Junie CLI, use the /extensions marketplace add and /extensions install commands. Cursor requires adding the marketplace in the terminal and then installing via the /plugins command within a session.

Runtime environment and developer settings

Marketplace integration installs a small CLI via go install on first use, so the Go toolchain must be installed and included in the PATH. The CLI is installed in a local cache (e.g., ~/.cache/go-modern-guidelines) and does not modify project files. While targeting Go 1.25 or later, it runs on older Go versions if automatic toolchain switching (GOTOOLCHAIN=auto) is enabled. When this variable is set, the agent uses the local build instead of the release version. The build script is intentionally separated to prevent agents from triggering builds.

Pre-implementation checks

This repository is suitable for developers using AI coding agents for Go projects, particularly teams that prefer modern Go syntax but face issues with AI generating outdated code. Before use, verify that the Go toolchain is installed on the system and that the agent is one of Junie, Claude Code, Codex, or Cursor, or supports skills.sh. If the Go version is lower than 1.25, check if automatic toolchain switching is enabled. These guidelines serve as a reference for agents when generating code, not as a tool for automatically modifying code, so they cannot be used to bulk update existing codebases.

Written by AI from this repository's README on September 26, 2026. For the facts, the original on GitHub is the reference.

By the numbers

GitHub trending history
5 days between Jun 19, when Trend began recording, and Nov 8, 2026 · first on Aug 27 · best daily rank #4 (Aug 27)

Read from GitHub, as of November 8, 2026.

Language
Go
Topics
ai-agents · coding-agent · developer-tools · go · golang · guidelines
Stars
3,958
Stars gained in 7 days
+47
Contributors
9
Forks
129
Commits
44
Last commit
September 10, 2026
Open issues
7
Open pull requests
5

Related repositories

View on GitHub →

README badge

trend.ondo.sh · GitHub daily trending #4 · August 27, 2026

The badge above shows the highest this repository has ranked on GitHub's daily trending since June 19, 2026, and the day it did. Paste the Markdown below into your README. The badge opens this page, and it updates by itself when the repository climbs higher.

[![trend.ondo.sh](https://trend.ondo.sh/github/r/JetBrains--go-modern-guidelines/badge.en.svg)](https://trend.ondo.sh/github/r/JetBrains--go-modern-guidelines/en.html)