go-conventions

go-conventions is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 84 tokens per session (1,141 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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,141 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.00084 $0.01141
Opus 5 $0.00042 $0.00571
Sonnet 5 $0.00017 $0.00228
Haiku 4.5 $0.00008 $0.00114

Measured 7d ago against content hash c7d40143c69c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 7d 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 · 75 lines

How it starts

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

Write idiomatic Go

Add Go that reads as idiomatic, handles every error explicitly, and matches the repo's existing patterns — simple and correct, the Go way.

Steps

  1. Read the lore first. Call search_lore (Memory MCP) for the repo's Go conventions and respect go.mod (module path, Go version), the linter config (golangci-lint), and any architecture ADRs. Keep packages cohesive and named for what they provide.
  2. Find a sibling package and copy its patterns — package layout, error handling, how interfaces are defined and consumed, and how tests are organised.
  3. Handle every error explicitly. Never discard an error with _ unless it is genuinely ignorable and commented why. Wrap with context using fmt.Errorf("doing X: %w", err) so the chain is inspectable with errors.Is/errors.As. Return early on error; avoid deep nesting.
  4. Keep interfaces small and define them at the consumer, not the producer. Accept interfaces, return concrete types. Don't add an interface speculatively.
  5. Pointer-receiver rules: be consistent within a type. Use a pointer receiver when the method mutates the receiver, the struct is large, or any method needs a pointer receiver (so the method set stays consistent); use value receivers for small immutable value types.
  6. Concurrency with care. Pass context.Context as the first argument to anything that blocks or spans a request; never store a Context in a struct. Guard shared state; prefer channels/sync primitives over data races. Always have a defined goroutine exit.
  7. Idioms: defer for cleanup, zero-value-useful structs, no naked returns in long functions, no stuttering names (http.HTTPServerhttp.Server). Run gofmt/goimports.
  8. Test table-driven. Use sub-tests (t.Run) over a []struct of cases; cover error paths; run with -race. Use t.Helper() in assertion helpers.
  9. Verify + evidence. Run go vet, go build, and go test -race ./..., record test_output via the record-evidence skill, and submit for review.

Read the full file on GitHub · 75 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. 7d 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 6d ago), licensed Apache-2.0. It adds 84 tokens to every session and 1,141 once invoked, about $0.0004 per session on Opus 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 (2026 baseline, Go 1.25+) 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 · 145 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

ax-go-gen

Use when writing Go code with github.com/ax-llm/ax/packages/go for AxGen programs, forward calls, indexed multi-sampling, result pickers, streaming, tools, assertions, traces, usage, and output parsing.

ax-llm/ax · 54 tokens