golang-idiomatic-go

golang-idiomatic-go is a skill for Claude Code, Codex from saifoelloh/golang-best-practices-skill. It costs 42 tokens per session (815 once invoked), scanned A, original, MIT.

A review guide for writing idiomatic Go code, meaning code that follows the language’s usual conventions and remains clear to Go developers. It focuses on interfaces, pointers, method receivers, and business-logic structure.

In plain words
What is it for?
Use it to review interface size and placement, pointer versus value usage, method receivers, use-case complexity, and the practice of accepting interfaces while returning structs.
Why use it?
It helps identify Go designs that are harder to read, unnecessarily complex, or inconsistent with common language practices.

Skill for Claude CodeCodex

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is - [golang-clean-architecture](../clean-architecture/SKILL.md) - For interface segregation.

Good fit Use it to review interface size and placement, pointer versus value usage, method receivers, use-case complexity, and the practice of accepting interfaces while returning structs.

Compare 6 skills from other repositories ↓
Install

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.

Clone the repo
git clone --depth 1 https://github.com/saifoelloh/golang-best-practices-skill
agentmods
npx agentmods add skills/saifoelloh/golang-best-practices-skill/idiomatic-go

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 golang-idiomatic-go

README.md
[![agentmods](https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/idiomatic-go/github.svg)](https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/idiomatic-go)
Your own site
<a href="https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/idiomatic-go"><img src="https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/idiomatic-go/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 golang-idiomatic-go

Your own site · 80×15
<a href="https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/idiomatic-go"><img src="https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/idiomatic-go.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 815 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.00042 $0.00815
Opus 5 $0.00021 $0.00407
Sonnet 5 $0.00008 $0.00163
Haiku 4.5 $0.00004 $0.00081

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

Security

Grade A, and why

golang-idiomatic-go 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 12d 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.

idiomatic-go/SKILL.md · 130 lines

How it starts

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

Golang Idiomatic Patterns

Expert-level review for idiomatic Go patterns. Ensures code follows Go conventions, proper interface design, and appropriate pointer usage.

When to Apply

Use this skill when:

  • Ensuring code follows Go idioms
  • Reviewing interface design patterns
  • Checking pointer vs value usage
  • Verifying "Accept interfaces, return structs" pattern
  • Auditing usecase complexity
  • Ensuring small, focused interfaces

Rule Categories by Priority

Priority Count Focus
High 1 Method receivers
Medium 5 Go idioms and patterns

Rules Covered (6 total)

High-Impact Patterns (1)

  • high-pointer-receiver - Use pointer receivers for mutations

Medium Improvements (5)

  • medium-interface-pollution - Keep interfaces small (<5 methods)
  • medium-accept-interface-return-struct - API flexibility pattern
  • medium-pointer-overuse - Don't overuse pointers for small types
  • medium-usecase-complexity - Move business logic to domain entities
  • medium-interface-in-implementation - Define interfaces where used

Common Idiomatic Patterns

Accept Interfaces, Return Structs

// ✅ GOOD: Accept interface, return struct
func Process(r io.Reader) (*Result, error) {
    // ...
    return &Result{}, nil
}

Small Interfaces

// ✅ GOOD: Small, focused interface
type Reader interface {
    Read(p []byte) (n int, err error)
}

Pointer Receivers for Mutations

// ✅ GOOD: Pointer receiver modifies state
func (u *User) UpdateEmail(email string) {
    u.Email = email
}

Trigger Phrases

This skill activates when you say:

  • "Is this idiomatic Go?"
  • "Review Go style"
  • "Check interface design"
  • "Verify pointer usage"
  • "Review Go conventions"
  • "Check for Go anti-patterns"

How to Use

For Idiomatic Review

  1. Check method receivers (pointer vs value)
  2. Verify interface sizes and locations
  3. Review pointer usage appropriateness
  4. Check "accept interfaces, return structs" pattern

Read the full file on GitHub · 130 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 130 lines · 42 tokens per session scan A cb2b256e7f37

Subscribe to this mod's changes

golang-idiomatic-go is a skill published in the GitHub repository saifoelloh/golang-best-practices-skill (15 stars, last pushed 6mo ago), licensed MIT. It adds 42 tokens to every session and 815 once invoked, about $0.0002 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-30.