agentleFS
CadastoCadasto/go-coding-plugin/skills/go-coding/SKILL.md

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

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. zalando/skipper★ 3.3ksame name
    2. 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.

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
  1. Very specific:

    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 …

    line 17
  2. Very specific:

    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.

    line 56
  3. Very specific:

    Every guard has a test that fails when the guard is deleted.

    line 87
  4. Very specific:

    Run gofmt/gofumpt and golangci-lint run — never reason out what a tool decides.

    line 91
  5. Distinctive:

    When both forms pass the tools, decide by the order Google's Go Style Guide gives for readable code: clarity, then simplicity (with its …

    line 95
  6. Distinctive:

    If a workflow already owns the reviewer seat, that reviewer loads the focused skills itself instead — one review seat per diff.

    line 123

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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, not grep, where a symbol is defined, who uses it, who implements it and who calls it: grep matches the name, so it cannot tell a.Close from b.Close, and it cannot see which types satisfy an interface (Go never writes implements). The official gopls-lsp plugin (@claude-plugins-official) provides the LSP tool, which also covers diagnostics, rename and vulncheck. How to ask: Symbol questions below.

Routing table

TopicRun now (deterministic)Deeper skill
Formattinggofmt -l / gofumpt -l (+ goimports) — machine-enforced, non-negotiable—
Static analysis / likely bugsgo vet ./..., golangci-lint rungo-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 reproducibilitygo-idioms
Errors (%w, errors.Is/AsType, errors.Join, sentinel/typed, enum dispatch)golangci-lint run --enable-only=errorlint,exhaustivego-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 testsgo-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 judgmentgo-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:

  1. With a language-server tool (Claude Code's LSP) whose root is the checkout being changed, use it.
  2. Otherwise ask gosym, one call per question: <gosym> -C <checkout> def|refs|impl|calls <Name>. <gosym> is scripts/gosym in 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 or Type.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 what gopls references (every use, resolved by type), gopls implementation (an interface's types, or the interfaces a type satisfies) or gopls 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 as Type.Method.
  3. 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, to gopls references, implementation or call_hierarchy. gopls definition takes the position of a use, not a name; a position off the identifier makes gopls exit 2.
  4. 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. gosym exit 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" claimgo-testing
fmt.Errorf, errors.*, a sentinel, a typed error, a Must helper, a switch over an enumgo-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 copygo-idioms
go func, chan, sync., atomic., errgroup, context.With*, a Close on a goroutine-owned resourcego-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 APIgo-layout
.golangci.y*ml, a linter complaint you do not understandgo-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 with errors.Is / errors.AsType and 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.Run with got/want messages.
  • range n, min/max, slices/maps, strings.Cut, any; go fix ./... before hand-edits.
  • ctx first; no goroutine without an owner that waits for it; t.Context() in tests.
  • Run gofmt/gofumpt and golangci-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)

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).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.