DEV Community

Pranav Lakhwara
Pranav Lakhwara

Posted on

I measured whether a Go skill actually makes AI agents write better Go (and open-sourced the benchmark)

Coding agents write Go that compiles but isn't idiomatic: pre-1.22 habits, missing context, goroutines with no shutdown path, SQL built with fmt.Sprintf. In a one-off snippet you shrug it off; in a long autonomous run it's the difference between a clean build and a cascading failure. I built a skill to fix that — but I didn't want to claim it works. I wanted to measure it, the way only a compiled language lets you.

go-mastery is an Agent Skill: one always-on SKILL.md plus 36 lazy-loaded reference files (concurrency, errors, modern 1.22–1.26 APIs, security, gRPC, observability, MCP, eBPF, cgo, wasm, cloud-native). It runs in any SKILL.md-compatible agent — Claude Code, Cursor, Codex, and others.

The part I actually care about is go-mastery-evals, the open benchmark. Go is one of the few languages where correctness can be graded objectively — the toolchain does most of the judging. Every task is generated twice, with and without the skill, and graded by go build / go vet / go test / golangci-lint plus a hidden behavioral test the model never sees — generation and grading are separate processes, so the model only ever receives its own code plus tool diagnostics, never the test or the expected output. No LLM-as-judge. Grading is hermetic (vendored deps, GOPROXY=off) so it reproduces anywhere, and every case ships a must-pass and a must-fail fixture so the benchmark validates its own discrimination.

The result, across 54 cases, two vendors, six models, with zero in-domain regressions:

Anthropic:
Haiku +20.0
Sonnet +16.7
Opus +14.1

OpenAI:
GPT‑5.4‑nano +26.3
GPT‑5.4‑mini +20.7
GPT‑5.5 +12.6
(percentage-point gain in correctness, with vs without the skill)

The signature is the tell that it's real: the biggest lift lands on the smallest model and compresses as the model saturates. A weak model lacks the knowledge and the skill supplies it; a frontier model already has most of it, so on strong models the gain moves from correctness to a deterministic idiom-quality score instead. It also leads the other Go skills I benchmarked — JetBrains' go-modern-guidelines (+6.7 / +5.2 / +4.5 pp, never behind on a single case) and a leading community-authored one (+6.3 pp) — and stays neutral within sampling noise on an out-of-domain suite (third-party Aider-polyglot Go puzzles).

Why open-source the harness? Because a benchmark you can't run is just another claim. If you maintain a Go skill, run it through the identical gate — or try to beat these numbers. Both repos are MIT.

Inspect the source first, then install:

Skill: https://github.com/mythicalhacker/go-mastery
Benchmark + full methodology: https://github.com/mythicalhacker/go-mastery-evals

bashnpx skills add mythicalhacker/go-mastery

Claude Code plugin:

/plugin marketplace add mythicalhacker/go-mastery
/plugin install go-mastery@go-mastery

Honest caveats: the JetBrains head-to-head was samples=5 across all tiers; the community-skill comparison was samples=3 on Sonnet — both on an earlier skill build, so they're conservative. gpt-5.5-pro is excluded (served only via a different API). I'd genuinely value methodology critique — that's the most useful feedback I can get.

Top comments (0)