go-coding
Skill0 starsChanged 5 months agoMITView on GitHub
Go coding-standards router. This skill should be used when a Go task spans several areas, is unspecified, or the question is which tool or standard applies, including where a Go symbol is defined, used, implemented or called — it names the deterministic tool to run, then the focused skill that owns the topic (go-errors, go-concurrency, go-testing, go-idioms, go-layout, go-lint-setup). Loading the router alone does not apply the standards — load the skill it names next. For one already-identified topic, load that skill directly. Go only; not for business rules.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- zalando/skippertheir own version, first seen Oct 8, 2026
- figuretu/my-skillstheir own version, first seen Jul 28, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- zalando/skipper★ 3.3ksame name
- figuretu/my-skills★ 16same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- go-concurrencySkill
- go-errorsSkill
- go-idiomsSkill
- go-layoutSkill
- go-lint-setupSkill
- go-testingSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Don't rebuild code intelligence: Ask gopls, not grep, where a symbol is defined, who uses it, who implements it and who calls it: grep …
- Very specific: line 56
If gosym cannot be found or the call is refused, gopls is missing or exits non-zero, or gosym exits 1 or 3, use grep and say so.
- Very specific: line 87
Every guard has a test that fails when the guard is deleted.
- Very specific: line 91
Run gofmt/gofumpt and golangci-lint run — never reason out what a tool decides.
- Distinctive: line 95
When both forms pass the tools, decide by the order Google's Go Style Guide gives for readable code: clarity, then simplicity (with its …
- Distinctive: line 123
If a workflow already owns the reviewer seat, that reviewer loads the focused skills itself instead — one review seat per diff.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
go-coding — Go standards router
Route the Go task to the right standard and tool (Go 1.27+, golangci-lint v2) — this skill is a
router, not an encyclopedia. Every rule targets Go 1.27. On a module whose go directive is older,
skip what is marked newer (a Since cell or a (1.NN) note). The tools hold that line: the
compiler rejects a newer language feature, go vet's stdversion check (run by go test) reports
a newer standard-library symbol, and go fix offers only rewrites the directive allows — so no
older variant of a rule is kept. Two principles drive it:
- Deterministic beats prose. Whatever a formatter or linter enforces, run the tool — don't reason it out by hand. The plugin's value is judgment the model lacks, not re-deriving tooling.
- Don't rebuild code intelligence. Ask
gopls, notgrep, where a symbol is defined, who uses it, who implements it and who calls it:grepmatches the name, so it cannot tella.Closefromb.Close, and it cannot see which types satisfy an interface (Go never writesimplements). The officialgopls-lspplugin (@claude-plugins-official) provides theLSPtool, which also covers diagnostics, rename and vulncheck. How to ask: Symbol questions below.
Routing table
| Topic | Run now (deterministic) | Deeper skill |
| Formatting | gofmt -l / gofumpt -l (+ goimports) — machine-enforced, non-negotiable | — |
| Static analysis / likely bugs | go vet ./..., golangci-lint run | go-lint-setup |
Modern idioms (range-int, min/max, slices/maps, wg.Go, strings.Cut, new(expr), errors.AsType) | go fix ./... (the toolchain's modernizer suite), or golangci-lint run --enable-only=modernize for CI reproducibility | go-idioms |
Errors (%w, errors.Is/AsType, errors.Join, sentinel/typed, enum dispatch) | golangci-lint run --enable-only=errorlint,exhaustive | go-errors |
| Concurrency (goroutine leaks, ctx lifecycle, atomics) | go test -race ./..., go vet ./... | go-concurrency |
Testing (table-driven, t.Parallel, t.Context, B.Loop, testing/synctest) | go test -race ./...; use testing/synctest for time/concurrency tests | go-testing |
Layout, naming & API surface (internal/, imports, initialisms, receiver type, in-band errors, struct literals, doc comments) | golangci-lint run --enable-only=revive (var-naming, receiver-naming, exported, blank-imports, dot-imports), go vet (composites), gofmt for doc-comment layout; the rest is judgment | go-layout |
| Symbol questions (where defined, who uses it, who implements it, who calls it) | gopls, per Symbol questions below; grep stays for text, docs and config | — |
Symbol questions
Where a Go symbol is defined, who uses it, who implements it, who calls it:
- With a language-server tool (Claude Code's
LSP) whose root is the checkout being changed, use it. - Otherwise ask
gosym, one call per question:<gosym> -C <checkout> def|refs|impl|calls <Name>.<gosym>isscripts/gosymin this skill's folder: the absolute path the session banner names, or this skill's base directory followed by/scripts/gosym. A brief carries that absolute path.<Name>is a package-level name orType.Method; a bare name also finds the methods and fields of that name, and a third argument keeps the definitions whose path contains it. It prints each definition as== <file>:<line>:<col>-<col> <Name> <Kind>, then whatgopls references(every use, resolved by type),gopls implementation(an interface's types, or the interfaces a type satisfies) orgopls call_hierarchy(callers and callees) answers there, or(n/a: <Kind>)where the question does not apply, with paths relative to the module. A warning that gopls stopped at 100 symbols means the answer may be incomplete: ask again asType.Method. - Without
gosym, take the same two steps,cd <checkout> &&in each command:gopls workspace_symbol -matcher fuzzy '<Name>$'(gopls lists at most 100 symbols for any query; anchored at the name's end, the list rarely reaches that), then pass the exact hit's first field, unchanged, togopls references,implementationorcall_hierarchy.gopls definitiontakes the position of a use, not a name; a position off the identifier makesgoplsexit 2. - If
gosymcannot be found or the call is refused,goplsis missing or exits non-zero, orgosymexits 1 or 3, usegrepand say so.gosymexit 2 is a wrong call: fix it.
The command line is experimental (https://go.dev/gopls/command-line); gopls help <command>
shows what the installed version takes.
Route, then load
The router is an index, not the standard. Before writing or reviewing Go you MUST load the focused
skill matching the change — with the Skill tool (go-coding:go-errors, …), not by recalling it:
| The diff touches… | Load |
any _test.go, a benchmark, a fuzz target, a "verified by temporarily breaking it" claim | go-testing |
fmt.Errorf, errors.*, a sentinel, a typed error, a Must helper, a switch over an enum | go-errors |
a loop, map, slice, string split, interface{}, a struct literal that could be new(expr), a nested := on err, encoding/json, a UUID, an HTTP response body, a url.Values copy | go-idioms |
go func, chan, sync., atomic., errgroup, context.With*, a Close on a goroutine-owned resource | go-concurrency |
a new package, an exported identifier, a cmd/ or internal/ decision, an import block, a struct literal of a foreign type, a doc comment on an API | go-layout |
.golangci.y*ml, a linter complaint you do not understand | go-lint-setup |
One load per skill per session is enough; the skill stays in context. Orchestrators dispatching
implementer or reviewer subagents carry this table and the Symbol questions section into every
brief, with the absolute paths of the checkout or worktree being changed and of gosym — a subagent does not
inherit the parent session's skills, and may start in a different folder.
Minimum checklist (when a second load is not affordable)
Apply these even if you load nothing else; they are the rules the focused skills most often catch:
- Wrap with
fmt.Errorf("…: %w", err); inspect witherrors.Is/errors.AsTypeand guard the result (ok && v != nil— a typed-nil pointer satisfies the match). Never swallow an error. - Every guard has a test that fails when the guard is deleted; a "temporarily broke it by hand"
check is not evidence — commit it as a can-fail test. Table-driven
t.Runwith got/want messages. range n,min/max,slices/maps,strings.Cut,any;go fix ./...before hand-edits.ctxfirst; no goroutine without an owner that waits for it;t.Context()in tests.- Run
gofmt/gofumptandgolangci-lint run— never reason out what a tool decides.
Tie-breaks (when two valid forms compete)
When both forms pass the tools, decide by the order Google's Go Style Guide gives for readable code: clarity, then simplicity (with its rule of least mechanism: the most standard tool that expresses the idea), then concision, then maintainability, then consistency. Say which attribute decided it; "more idiomatic" on its own is not a reason. Source: https://google.github.io/styleguide/go/guide (normative and canonical).
Writing for the human
Anything a person reads — a PR description, a review comment, a question, a design choice put to them — goes in plain English, not Go shorthand. State the effect before the mechanism ("the request keeps running after the caller gives up", not "ctx leak in the errgroup"), and expand a term the first time it appears or leave it out. Keep it short: a few sentences per point, and a decision they must make gets the options plus a recommendation, not an essay. Identifiers, commands and linter names stay verbatim — it is the prose around them that must be plain.
Authoritative sources (cite, don't guess)
- Effective Go — https://go.dev/doc/effective_go
- Go Code Review Comments — https://go.dev/wiki/CodeReviewComments
- Google Go Style Guide — https://google.github.io/styleguide/go/ — three documents, cite the one a rule comes from: the Guide (https://google.github.io/styleguide/go/guide, normative and canonical: the principles), Style Decisions (https://google.github.io/styleguide/go/decisions, normative: the reviewer rulebook), Best Practices (https://google.github.io/styleguide/go/best-practices, advisory)
- Uber Go Style Guide — https://github.com/uber-go/guide
- Package & toolchain docs — https://pkg.go.dev
- Linter rule catalogues (name the rule, not just the tool) —
go vethttps://pkg.go.dev/cmd/vet; staticcheck https://staticcheck.dev/docs/checks/; revive https://github.com/revive-lint/revive/blob/master/RULES_DESCRIPTIONS.md; golangci-lint linters https://golangci-lint.run/docs/linters/
For a focused review
Dispatch the go-reviewer agent — a report-only, context-isolated reviewer that loads these skills,
applies the review-heuristics catalog and returns severity-ranked findings on a diff or file.
If a workflow already owns the reviewer seat, that reviewer loads the focused skills itself instead — one review seat per diff.
/go-lint-setup scaffolds the reference golangci-lint v2 config into a repo.
Top-level structure adapted from samber/cc-skills-golang (MIT © 2026 Samuel Berthe).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

