go-functions

go-functions is a skill for Claude Code from cxuu/golang-skills. It costs 65 tokens per session (916 once invoked), scanned A, original, Apache-2.0.

A guide to organizing Go functions, including their order in a file, grouping by receiver, readable parameters and return values, and names for Printf-style functions. Printf-style functions accept formatting strings like fmt.Printf.

In plain words
What is it for?
Use it when adding or refactoring Go functions, arranging a file, designing parameters and results, or implementing Stringer and formatting methods.
Why use it?
It makes related functions easier to find and helps function signatures communicate how code should be called. It also prevents common naming and formatting mistakes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is **When this skill does NOT apply**: For functional options constructors (`WithTimeout`, `WithLogger`), see [go-functional-options](../go-functional-options/SKIL.

Part of the golang-skills plugin — 20 skills shipped together

Good fit Use it when adding or refactoring Go functions, arranging a file, designing parameters and results, or implementing Stringer and formatting methods.

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/cxuu/golang-skills
agentmods
npx agentmods add skills/cxuu/golang-skills/go-functions

Made for: Claude Code.

Or install golang-skills, the plugin that ships this one along with the rest of its 20 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 go-functions

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/cxuu/golang-skills/go-functions"><img src="https://agentmods.dev/badge/skills/cxuu/golang-skills/go-functions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 916 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. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 15 Mar 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00065 $0.00916
Opus 5 $0.00032 $0.00458
Sonnet 5 $0.00013 $0.00183
Haiku 4.5 $0.00006 $0.00092

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

Security

Grade A, and why

go-functions 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 11d 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.

skills/go-functions/SKILL.md · 112 lines

How it starts

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

Go Function Design

Resource Routing

  • references/SIGNATURES.md - Read when designing parameters, return values, named results, or signature readability.
  • references/PRINTF-STRINGER.md - Read when using fmt verbs, Stringer, GoStringer, Formatter, or Printf-style function naming.

When this skill does NOT apply: For functional options constructors (WithTimeout, WithLogger), see go-functional-options. For error return conventions, see go-error-handling. For naming functions and methods, see go-naming.


Function Grouping and Ordering

Organize functions in a file by these rules:

  1. Functions sorted in rough call order
  2. Functions grouped by receiver
  3. Exported functions appear first, after struct/const/var definitions
  4. NewXxx/newXxx constructors appear right after the type definition
  5. Plain utility functions appear toward the end of the file
type something struct{ ... }

func newSomething() *something { return &something{} }

func (s *something) Cost() int { return calcCost(s.weights) }

func (s *something) Stop() { ... }

func calcCost(n []int) int { ... }

Function Signatures

Keep the signature on a single line when possible. When it must wrap, put all arguments on their own lines with a trailing comma:

func (r *SomeType) SomeLongFunctionName(
    foo1, foo2, foo3 string,
    foo4, foo5, foo6 int,
) {
    foo7 := bar(foo1)
}

Add /* name */ comments for ambiguous arguments, or better yet, replace naked bool parameters with custom types.


Pointers to Interfaces

You almost never need a pointer to an interface. Pass interfaces as values — the underlying data can still be a pointer.

// Bad: pointer to interface
func process(r *io.Reader) { ... }

// Good: pass the interface value
func process(r io.Reader) { ... }

Printf and Stringer

Printf-style Function Names

Read the full file on GitHub · 112 lines

Files

What ships with it

2 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. 11d ago First seen · 112 lines · 65 tokens per session scan A ed4ef3b62192

Subscribe to this mod's changes

go-functions is a skill published in the GitHub repository cxuu/golang-skills (158 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 65 tokens to every session and 916 once invoked, about $0.0003 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.