Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/muratmirgun/gophersnpx agentmods add skills/muratmirgun/gophers/go-code-styleWrote 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.
[](https://agentmods.dev/skills/muratmirgun/gophers/go-code-style)<a href="https://agentmods.dev/skills/muratmirgun/gophers/go-code-style"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-code-style/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.
<a href="https://agentmods.dev/skills/muratmirgun/gophers/go-code-style"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-code-style.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00094 | $0.01924 |
| Opus 5.5 | $0.00038 | $0.00770 |
| Sonnet 5.5 | $0.00019 | $0.00385 |
| Haiku 4.5 | $0.00009 | $0.00192 |
Grade A, and why
go-code-style 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Code Style
gofmt handles the mechanical layout. This skill covers the decisions a formatter cannot make: where to break complexity, when to invert an if, when a switch beats an else if chain, and how to pick value vs pointer arguments. The rule of thumb is the Go Proverb: clear is better than clever.
Core Rules
- Run
gofmt/goimports. No exceptions, no debates. - Handle errors and edge cases first, return early, keep the happy path at minimum indentation.
- Eliminate unnecessary
elsewhen theifbody ends inreturn/break/continue. - Prefer
switchoverif/else ifchains that compare the same value. - Initialize slices and maps explicitly, never let a nil map reach a write.
- Pass small values; pass pointers when mutating or when the type is large (~128B+).
Style Priority Order
Apply in this order when two principles collide.
| Priority | Question | Beats |
|---|---|---|
| 1. Clarity | Can a reader understand intent without extra context? | everything else |
| 2. Simplicity | Is this the simplest expression of the idea? | concision, consistency |
| 3. Concision | Does every line earn its place? | consistency |
| 4. Maintainability | Will this be safe to modify? | consistency |
| 5. Consistency | Does it match nearby code? | — |
A "consistent" piece of bad code is still bad code. Clarity wins.
Read references/formatting-and-layout.md for line-breaking, multi-line signatures, file/declaration order.
Control Flow
Early return: keep the happy path flat
func process(data []byte) (*Result, error) {
if len(data) == 0 {
return nil, errors.New("empty data")
}
parsed, err := parse(data)
if err != nil {
return nil, fmt.Errorf("parsing: %w", err)
}
return transform(parsed), nil
}
No unnecessary else
When the if body unconditionally exits (return/break/continue), drop the else. For assignments, prefer default-then-override:
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.
- 3mo ago First seen · 195 lines · 94 tokens per session scan A 0c432983045b
go-code-style is a skill published in the GitHub repository muratmirgun/gophers (9 stars, last pushed 3mo ago), licensed MIT. It adds 94 tokens to every session and 1,924 once invoked, about $0.0004 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.
go-code-style compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| go-code-stylemuratmirgun/gophers | Skill | 9 | 3mo ago | MIT | A | 94 | Claude Code |
| gonimadorostkar/Claude-Skills-collection | Skill | 42 | 6d ago | MIT | A | 90 | Claude Code |
| integrate-arcjet-guard-agent-framework-goarcjet/skills | Skill | 6 | 4d ago | Apache-2.0 | A | 119 | Claude Code, Codex |
| go-tcp-server-reliabilitysayeed1999/agent-skills | Skill | 7 | 25d ago | MIT | A | 52 | Claude Code |
| go-http-server-reliabilitysayeed1999/agent-skills | Skill | 7 | 25d ago | MIT | A | 58 | Claude Code |
| golang-proJeffallan/claude-skills | Skill | 13k | today | MIT | A | 95 | Claude Code |
| programmingcode-yeongyu/oh-my-openagent | Skill | 71k | today | none | A | 90 | Claude Code, Codex |