golang

golang is a skill for Claude Code from xobotyi/cc-foundry. It costs 38 tokens per session (4,861 once invoked), scanned B, original, MIT.

Guidance for writing and reviewing Go programs, including error handling, concurrent work, tests, project layout, and Go's built-in tools.

In plain words
What is it for?
Use it when creating, reviewing, testing, or structuring Go code, especially when checking which language features and standard-library functions a project can use.
Why use it?
It helps keep Go code simple and compatible with the language version declared in a module's go.mod file. It also helps avoid unnecessary abstractions and dependencies.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: mentions subagents; mentions Claude Code.

Part of the golang plugin — 4 skills shipped together

Good fit Use it when creating, reviewing, testing, or structuring Go code, especially when checking which language features and standard-library functions a project can use.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xobotyi/cc-foundry/golang
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 xobotyi/cc-foundry --skill golang
Clone the repo
git clone --depth 1 https://github.com/xobotyi/cc-foundry

Made for: Claude Code.

Or install golang, the plugin that ships this one along with the rest of its 4 skills.

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 golang

README.md
[![agentmods](https://agentmods.dev/badge/skills/xobotyi/cc-foundry/golang.svg)](https://agentmods.dev/skills/xobotyi/cc-foundry/golang)
Your own site
<a href="https://agentmods.dev/skills/xobotyi/cc-foundry/golang"><img src="https://agentmods.dev/badge/skills/xobotyi/cc-foundry/golang.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,861 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00038 $0.04861
Opus 5 $0.00019 $0.02431
Sonnet 5 $0.00008 $0.00972
Haiku 4.5 $0.00004 $0.00486

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

Security

Grade B, and why

golang scanned grade B with 1 finding 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.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

When **reviewing** Go, cite the violation and show the fix inline. Do not lecture.
plugins/golang/skills/golang/SKILL.md · 311 lines

How it starts

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

Simplicity is the highest Go virtue. Three biases decide most calls:

  • Resist abstraction until the cost of not abstracting is proven. An interface, a type parameter, or a layer added in anticipation of a second caller is a defect.
  • Reach for the standard library first. A dependency earns its place by doing what the standard library does not.
  • The go directive decides what may be written, not the installed toolchain.

Language Version

The go directive in go.mod sets the language version a module may use. Read it before writing code and never reach for a feature above it. The stdversion analyzer reports a standard-library symbol newer than the directive: Go 1.27 and later fail go test on it, earlier toolchains report it under go vet.

Floor version per feature. Anything older than 1.21 is available in every supported module.

  • 1.21min, max, clear builtins; slices, maps, cmp, log/slog; context.WithoutCancel; errors.ErrUnsupported; sync.OnceValue
  • 1.22 — per-iteration loop variables; for range int; math/rand/v2; method and wildcard patterns in net/http.ServeMux
  • 1.23 — range-over-func iterators; iter; iterator functions in slices and maps; unique; unbuffered timer channels
  • 1.24 — generic type aliases; os.Root; testing.B.Loop; t.Context; runtime.AddCleanup; omitzero struct tag; tool directives; iterator functions in strings
  • 1.25testing/synctest; sync.WaitGroup.Go; container-aware GOMAXPROCS
  • 1.26new(expr); self-referential type constraints; errors.AsType; go fix modernizers
  • 1.27 — generic methods; field-selector keys in struct literals; encoding/json/v2; uuid; strings.CutLast

Read [${CLAUDE_SKILL_DIR}/references/versions/go1.NN.md] — one file per version, go1.21.md through go1.27.md — when writing against a feature near the module's floor, and whenever raising the directive. Each carries what its version added, which behavior changes the go directive gates, and the traps it introduced.

Read the full file on GitHub · 311 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 · 311 lines · 38 tokens per session scan B 7d224b31eca2

Subscribe to this mod's changes

golang is a skill published in the GitHub repository xobotyi/cc-foundry (20 stars, last pushed 5d ago), licensed MIT. It adds 38 tokens to every session and 4,861 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (strips warnings and disclaimers). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for…

JanDeDobbeleer/oh-my-posh · 80 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens

golang-samber-oops

Structured error handling in Golang with samber/oops — error builders, stack traces, error codes, error context, error wrapping, error attributes, user-facing vs developer messages, panic recovery, and logger integration. Apply when using or adopting samber/oops, or when the codebase already imports…

samber/cc-skills-golang · 74 tokens

golang-uber-fx

Golang application framework using uber-go/fx — fx.New, fx.Provide, fx.Invoke, fx.Module, fx.Lifecycle hooks, fx.Annotate (name/group/As), fx.Decorate, fx.Supply, fx.Replace, fx.WithLogger, and signal-aware Run(). Apply when using or adopting uber-go/fx, when the codebase imports go.uber.org/fx, or when wiring…

samber/cc-skills-golang · 122 tokens

ax-go-agent-optimize

Use when writing Go code with github.com/ax-llm/ax/packages/go for agent optimization, verified agent-playbook evolution, evaluators, judges, optimizer artifacts, BootstrapFewShot, and GEPA.

ax-llm/ax · 51 tokens

gmeasure

Benchmark and measure Go code with gmeasure — an Experiment groups named Measurements, recorded via RecordValue/RecordDuration/MeasureDuration or repeated Sample/SampleValue/SampleDuration with SamplingConfig, timed inline with a Stopwatch, summarized through GetStats/Stats (StatMin/Max/Mean/Median/StdDev…

onsi/gomega · 129 tokens