mhmtszr/go-guidelines
98 stars · Last commit 2026-07-22
Make your AI code agent write production-grade Go instead of tutorial-grade Go. A plugin for Cursor & Claude Code with version-aware guidelines (Go 1.0–1.26) covering modern syntax, performance tuning, error handling, concurrency patterns, testing, and graceful shutdown.
README preview
# Go Guidelines Make your AI code agent write **production-grade Go** instead of tutorial-grade Go. A composable skill plugin for coding agents — covering modern syntax, generics, performance, concurrency safety, error handling, testing, and post-change verification including [`go fix`](https://go.dev/blog/gofix) on Go 1.26+. ## Quickstart Install Go Guidelines for your agent: [Claude Code](#claude-code), [Codex CLI](#codex-cli), [Cursor](#cursor), [OpenCode](#opencode). ## Motivation All coding agents tend to generate outdated and suboptimal Go. Key reasons: 1. **Training data lag.** Models don't know about features added after their training cutoff. They can't use `wg.Go()` (1.25), `new(val)` (1.26), or `errors.AsType[T]` (1.26) if they've never seen them. 2. **Frequency bias.** Even for features the model knows, it picks older patterns. There's more `for i := 0; i < n; i++` in the training data than `for i := range n`, so that's what comes out. 3. **No performance awareness.** Agents don't align struct fields, don't set `GOMAXPROCS` for containers, and spawn unbounded goroutines instead of using pools.