golang-rules

golang-rules is a skill for Claude Code, Codex from softspark/ai-toolkit. It costs 40 tokens per session (2,797 once invoked), scanned A, original, Apache-2.0.

A set of coding rules for Go programs, covering naming, package structure, error handling, security, and tests.

In plain words
What is it for?
Use it when writing or reviewing files in Go projects, including projects using frameworks such as Gin, Echo, or Gorilla.
Why use it?
It helps Go code follow consistent conventions and makes common maintenance and review problems easier to avoid.

Skill for Claude CodeCodex

Part of the ai-toolkit plugin — 114 skills, 44 agents, 14 hooks shipped together

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.

agentmods
npx agentmods add skills/softspark/ai-toolkit/golang-rules
Any agent
npx skills add softspark/ai-toolkit --skill golang-rules
Clone the repo
git clone --depth 1 https://github.com/softspark/ai-toolkit

Made for: Claude Code, Codex.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 114 skills, 44 agents, 14 hooks.

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-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/softspark/ai-toolkit/golang-rules.svg)](https://agentmods.dev/skills/softspark/ai-toolkit/golang-rules)
Your own site
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/golang-rules"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/golang-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,797 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00040 $0.02797
Opus 5 $0.00020 $0.01399
Sonnet 5 $0.00008 $0.00559
Haiku 4.5 $0.00004 $0.00280

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

Security

Grade A, and why

golang-rules 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 2d 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.

app/skills/golang-rules/SKILL.md · 263 lines

How it starts

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

Go Rules

These rules come from app/rules/golang/ in ai-toolkit. They cover the project's standards for coding style, frameworks, patterns, security, and testing in Go. Apply them when writing or reviewing Go code.

Go Coding Style

Naming

  • MixedCaps/mixedCaps only. No underscores in Go names (except test functions).
  • Exported: PascalCase. Unexported: camelCase. Acronyms: HTTPClient, userID.
  • Short variable names in small scopes: i, r, w, ctx, err.
  • Descriptive names in larger scopes: userRepository, requestTimeout.
  • Package names: short, lowercase, singular (auth, user, not utils, helpers).

Packages

  • One package per directory. Package name = directory name.
  • Avoid util, common, helpers packages. Name by what it provides.
  • Keep package APIs small. Export only what consumers need.
  • Use internal/ directory for packages not meant for external consumption.

Functions

  • Accept interfaces, return structs.
  • First parameter ctx context.Context if the function does I/O or may be cancelled.
  • Return (result, error) tuple. Error is always last return value.
  • Use named return values only for documentation, not for naked returns.
  • Keep functions short. If >40 lines, consider splitting.

Error Handling

  • Always check errors. Never use _ to discard errors silently.
  • Wrap errors with context: fmt.Errorf("fetching user %s: %w", id, err).
  • Use sentinel errors (var ErrNotFound = errors.New(...)) for expected conditions.
  • Use errors.Is() and errors.As() for error checking, not type assertions.

Formatting

  • Use gofmt / goimports. No formatting debates in Go.
  • Use golangci-lint with a .golangci.yml config in CI.
  • Use go vet as minimum static analysis.

Struct Design

  • Use struct embedding for composition, not inheritance.
  • Prefer value receivers for small structs, pointer receivers for large or mutable.
  • Be consistent: all methods on a type use the same receiver type.
  • Use struct literals with field names: User{Name: "Ada", Age: 30}.

Read the full file on GitHub · 263 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. 2d ago First seen · 263 lines · 40 tokens per session scan A 06a1ec3abb58

Subscribe to this mod's changes

golang-rules is a skill published in the GitHub repository softspark/ai-toolkit (169 stars, last pushed today), licensed Apache-2.0. It adds 40 tokens to every session and 2,797 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-09-03.