Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use this skill BEFORE writing or editing any Go (.go) files. Triggers when about to create, modify, or add code to .go files. Enforces happy path coding, error wrapping, sentinel errors, godoc-style comments, and `go doc` usage.
.claude/skills/fredrikaverpil-golang-style/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | -25% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -34% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 201% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 109% | 0% |
| case-18 | ✗→✓ | ▲ Improved | -25% | 0% |
Where this author deviates from, or tightens, idiomatic Go defaults.
and return early, then continue with the main logic. Main logic never nests inside an if err == nil branch.
%w if the underlying error should beexposed.
(var ErrNotFound = errors.New("not found")) and check them with errors.Is, not == or string matching.
Your idea of "current Go" is frozen at your training cutoff and is usually out of sync with the project in both directions. Before writing code, read the go directive in go.mod and check go version, and target the lower of the two.
That drift cuts both ways:
slices, maps, cmp, testing, or a package you have never heard of.
godirective and simply not build.
go doc <pkg> answers both, but only for the toolchain installed here. To ask about the version the module actually targets, use the pkg.go.dev API — no auth, GET only (announcement, spec at https://pkg.go.dev/v1beta/openapi.yaml):
sh# Which symbols does a stdlib package have at a specific Go version? curl -s "https://pkg.go.dev/v1beta/symbols/slices?version=v1.21.0" # Current Go release, and any release candidate in flight. curl -s "https://pkg.go.dev/v1beta/versions/std" # Third-party: latest version, and the symbols it declares. curl -s "https://pkg.go.dev/v1beta/module/github.com/google/go-cmp" curl -s "https://pkg.go.dev/v1beta/symbols/github.com/google/go-cmp/cmp"
Release notes are not in the API — fetch https://go.dev/doc/go1.N for a release's changes, or https://go.dev/doc/devel/release for the index.
fmt.Errorfcalls one argument per line.
gci.Every comment ends with a period, including inline ones inside a function body.
Never shadow a predeclared identifier with a variable or parameter name — not new, len, make, copy, max, min, clear, any, error, string, or any other builtin function, constant, or type. Pick a descriptive name instead: length over len, dataCopy over copy.
If the project is under the Einride organization, run tasks through the project's Sage-generated Makefiles (the .sage folder) rather than invoking go directly.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | pass→pass | 19,432 | 23,159 | +19% | 1 | 1 | 0% | 4,659 | 5,820 | +25% | 0 | 0 | — |
case-01 | fail→fail | 8,581 | 7,730 | -10% | 1 | 1 | 0% | 1,675 | 2,062 | +23% | 0 | 0 | — |
case-03 | fail→fail | 12,045 | 17,731 | +47% | 1 | 1 | 0% | 2,336 | 4,339 | +86% | 0 | 0 | — |
case-04 | pass→pass | 8,934 | 6,401 | -28% | 1 | 1 | 0% | 1,649 | 1,915 | +16% | 0 | 0 | — |
case-05 | pass→pass | 10,344 | 6,648 | -36% | 1 | 1 | 0% | 1,747 | 1,949 | +12% | 0 | 0 | — |
case-06 | pass→pass | 11,813 | 5,935 | -50% | 1 | 1 | 0% | 1,971 | 1,766 | -10% | 0 | 0 | — |
case-07 | fail→pass | 9,979 | 3,171 | -68% | 1 | 1 | 0% | 1,755 | 1,320 | -25% | 0 | 0 | — |
case-08 | pass→pass | 9,533 | 3,624 | -62% | 1 | 1 | 0% | 1,635 | 1,404 | -14% | 0 | 0 | — |
case-09 | pass→pass | 10,119 | 6,390 | -37% | 1 | 1 | 0% | 1,689 | 1,779 | +5% | 0 | 0 | — |
case-10 | pass→pass | 10,705 | 3,346 | -69% | 1 | 1 | 0% | 1,796 | 1,346 | -25% | 0 | 0 | — |
case-11 | fail→pass | 11,658 | 3,375 | -71% | 1 | 1 | 0% | 2,076 | 1,365 | -34% | 0 | 0 | — |
case-12 | pass→pass | 9,111 | 4,242 | -53% | 1 | 1 | 0% | 1,612 | 1,457 | -10% | 0 | 0 | — |
case-13 | fail→pass | 3,208 | 4,858 | +51% | 1 | 1 | 0% | 547 | 1,648 | +201% | 0 | 0 | — |
case-14 | pass→pass | 5,073 | 3,501 | -31% | 1 | 1 | 0% | 767 | 1,397 | +82% | 0 | 0 | — |
case-15 | fail→pass | 9,955 | 16,515 | +66% | 1 | 1 | 0% | 1,938 | 4,051 | +109% | 0 | 0 | — |
case-16 | pass→pass | 10,749 | 8,128 | -24% | 1 | 1 | 0% | 2,076 | 2,451 | +18% | 0 | 0 | — |
case-17 | pass→pass | 7,398 | 3,676 | -50% | 1 | 1 | 0% | 1,284 | 1,465 | +14% | 0 | 0 | — |
case-18 | fail→pass | 10,503 | 2,931 | -72% | 1 | 1 | 0% | 1,751 | 1,316 | -25% | 0 | 0 | — |
case-19 | pass→pass | 13,785 | 13,007 | -6% | 1 | 1 | 0% | 2,514 | 3,280 | +30% | 0 | 0 | — |
case-20 | pass→pass | 12,151 | 12,172 | +0% | 1 | 1 | 0% | 2,137 | 3,067 | +44% | 0 | 0 | — |
case-21 | pass→pass | 8,034 | 8,272 | +3% | 1 | 1 | 0% | 1,428 | 2,212 | +55% | 0 | 0 | — |
case-22 | pass→pass | 10,311 | 7,516 | -27% | 1 | 1 | 0% | 1,826 | 2,088 | +14% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.