Back to directory

Modern Go Guidelines

A set of guidelines that helps AI coding agents write modern, idiomatic Go by detecting a project's Go version and preferring newer language features and standard-library additions over older patterns.

Modern Go Guidelines

Modern Go Guidelines is a repository of guidelines for AI coding agents that helps them write modern Go code, covering features from Go 1.0 through Go 1.27, including everything targeted by Go's own modernize analyzer. With these guidelines, an agent uses constructs such as max(a, b) instead of an if-else block, slices.Contains instead of a manual loop, and cmp.Or(a, b, c) instead of a chain of nil checks, and knows about recent additions such as new(42) and errors.AsType[T] from Go 1.26.

An agent following the guidelines detects the project's Go version from go.mod and only uses language features and standard-library additions available up to that version, aiming to fix two known causes of outdated generated code: model training-data lag on newer language features, and a frequency bias toward older, more common idioms in training data.

The guidelines are distributed for Junie, Claude Code, Codex and Cursor, and for other agents through skills.sh, and are licensed under Apache-2.0.

More in Agent skills

See all 581
  • Provenance gate

    github.com

    A deterministic authorization gateway that sits between an AI agent and its tools, tracing where each parameter of a side-effect call came from, and blocking the call or asking a human when the source does not check out.

  • A markdown framework of system rules that restates Isaac Asimov's Four Laws of Robotics as a set of prioritized loss calculations for large-language-model agents to follow, published as a discovery file for agents and crawlers to read.

  • Vitruvius

    github.com

    An engineering research agent that runs a discover, read, synthesize, verify and review loop over technical questions, reading sources directly rather than inferring from titles, and publishing its own scored verifier benchmark, weaknesses included.