go-conventions

go-conventions is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 119 tokens per session (2,148 once invoked), scanned A, original, Apache-2.0.

A set of conventions for writing and changing Go code. Go is a programming language known for simple syntax and built-in support for concurrent programs.

In plain words
What is it for?
Adding or fixing Go code, handling and wrapping errors, designing small interfaces, choosing pointer receivers, and writing table-driven tests. It also covers running checks such as the race detector and go vet.
Why use it?
It reduces inconsistent code, missed errors, and tests that overlook race conditions. It also helps new changes match the repository’s existing structure and practices.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Adding or fixing Go code, handling and wrapping errors, designing small interfaces, choosing pointer receivers, and writing table-driven tests. It also covers running checks such as the race detector and go vet.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/go-conventions
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tmj-90/gaffer --skill go-conventions
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/go-conventions/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/go-conventions)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/go-conventions"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/go-conventions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-conventions

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/go-conventions"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/go-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,148 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00119 $0.02148
Opus 5.5 $0.00048 $0.00859
Sonnet 5.5 $0.00024 $0.00430
Haiku 4.5 $0.00012 $0.00215

Measured 27d ago against content hash a340426b245c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 27d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

runner/skills/go-conventions/SKILL.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Write idiomatic Go

Go rewards plain code: every error checked and wrapped, small interfaces, goroutines that always end. For the builder and the reviewer of a Go diff; the repo's config and existing code win over it.

Procedure

  1. Discover the repo's conventions first. Call search_lore for Go conventions. Read go.mod (the go directive gates features: per-iteration loop variables need ≥ 1.22, wg.Go and testing/synctest ≥ 1.25), go.work, .golangci.yml (v2 files start version: "2"), staticcheck.conf, the Makefile, and the CI workflow. Open the nearest sibling package and its _test.go and copy their layout, error style, logging (log/slog or the repo's logger) and test helpers. Never hand-edit a file headed // Code generated … DO NOT EDIT.; change its source and run go generate.
  2. Pin the exact commands from CI or the Makefile (the run-tests and run-lint skills). Use the defaults below only when the repo defines none.
  3. Write the change with the idioms below, then walk the concurrency section for every goroutine, shared value, file and outbound call you touched.
  4. Test each acceptance criterion's own behaviour. One test (or t.Run case) per AC that fails without your change, plus its error path — table-driven with t.Run, and t.Helper() in assertion helpers. If the AC involves shared state or persistence, add a test that runs N goroutines against it concurrently under -race and asserts the invariant (no lost update, no error, exactly one winner).
  5. Verify, then stop. Done when: gofmt -l . prints nothing, build/vet/lint are clean at the repo's configuration, go test -race is green, go mod tidy -diff is empty, and every AC has a test. Record the output with the record-evidence skill; the runner submits the work.

Commands

  • Format: gofmt -l . (or goimports -l .) must print nothing.
  • Build and vet: go build ./... and go vet ./....
  • Lint: golangci-lint run ./... when configured, else staticcheck ./... when configured.
  • Test: go test -race -count=1 ./...; one case: go test -race -run 'TestX/case' ./pkg/x.
  • Dependencies: go mod tidy -diff (Go 1.23+) reports drift without rewriting go.mod/go.sum. Never go get or let go mod tidy add a module: a new or bumped dependency is a blocker (the dependency-upgrade skill). govulncheck ./... if installed.
  • Do not run go fix ./... (Go 1.26 modernizers) across the tree unless the ticket asks; it rewrites unrelated code.

Read the full file on GitHub · 127 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 27d ago Changed · +52 lines · +35 tokens per session a340426b245c
  2. 1mo ago First seen · 75 lines · 84 tokens per session scan A c7d40143c69c

Subscribe to this mod's changes

go-conventions is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 28d ago), licensed Apache-2.0. It adds 119 tokens to every session and 2,148 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

sota-golang

State-of-the-art Go engineering rules (supported Go releases) that Claude applies when writing new Go code or auditing existing Go code. Covers error handling, interface/package design, goroutine and channel correctness, net/http hardening, security (SQL, exec, path traversal, CSPRNG, TLS, supply chain), performance…

martinholovsky/SOTA-skills · 139 tokens

concurrency-patterns-go

Apply safe, idiomatic Go concurrency patterns with goroutines and channels. Use when the user works with goroutines, channels, sync primitives, context cancellation, worker pools, fan-in/fan-out, select statements, or asks about concurrent Go programming and avoiding race conditions.

VersoXBT/claude-initial-setup · 60 tokens

error-handling-go

Implement robust Go error handling with wrapping, sentinel errors, and custom types. Use when the user handles errors in Go, creates custom error types, wraps errors with fmt.Errorf and %w, uses errors.Is/As, or asks about Go error best practices and error propagation strategies.

VersoXBT/claude-initial-setup · 61 tokens

idiomatic-go

Write clean, idiomatic Go following community conventions and effective patterns. Use when the user writes Go code, designs packages, defines interfaces, uses struct embedding, writes receiver methods, organizes Go projects, or asks about Go best practices and conventions.

VersoXBT/claude-initial-setup · 52 tokens

golang-expert

Go programming expert for goroutines, channels, interfaces, modules, and concurrency patterns.

ginkida/rustyhand · 21 tokens

agent-go-expert

Specialist subagent: Go concurrency, error handling, stdlib patterns, Chi/Echo web frameworks specialist. Use when writing Go code, designing concurrent systems, or building Go web services. Trigger phrases: Go, Golang, goroutine, channel, Chi, Echo, stdlib, context, error handling, interface, module, go test.

travisjneuman/.claude · 75 tokens