golang-rules

golang-rules is a skill for Claude Code 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 Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

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

Good fit Use it when writing or reviewing files in Go projects, including projects using frameworks such as Gin, Echo, or Gorilla.

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

Made for: Claude Code.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 115 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/github.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/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-rules

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • 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.00040 $0.02797
Opus 5.5 $0.00016 $0.01119
Sonnet 5.5 $0.00008 $0.00559
Haiku 4.5 $0.00004 $0.00280

Measured 1mo ago against content hash 06a1ec3abb58, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (180 stars, last pushed 6d ago), licensed Apache-2.0. It adds 40 tokens to every session and 2,797 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

unit-test

A Go testing workflow for writing unit tests: small tests that check individual functions or components. It supports table-driven cases, where many inputs and expected results are organised in one test, and subtests.

johnqtcg/awesome-skills · 100 tokens

fuzzing-test

A Go testing guide for generating fuzz tests, which repeatedly try varied inputs to find crashes and unexpected behavior. It first checks whether the code is suitable for fuzzing.

johnqtcg/awesome-skills · 74 tokens

go-code-reviewer

Review Go code with a defect-first approach using repository policy (constitution.md first, then AGENTS.md fallback). Use for code review, PR review, quality checks, risk analysis, and regression detection.

johnqtcg/awesome-skills · 45 tokens

go-dependency-audit

Go dependency audit specialist for CVE scanning (govulncheck), license risk triage, outdated dependency detection, upgrade impact analysis, and supply chain security. ALWAYS use when auditing go.mod dependencies, running govulncheck, checking license compatibility, planning dependency upgrades, or investigating supply…

johnqtcg/awesome-skills · 102 tokens

go-review-lead

Orchestrate a comprehensive Go code review by triaging code changes, dispatching vertical review skills (security, concurrency, error, logic, performance, quality, test, observability) as parallel agents, then consolidating results into a unified report. Use for full Go PR review or comprehensive code review. Replaces…

johnqtcg/awesome-skills · 80 tokens

go-benchmark

Go performance benchmarking and pprof profiling specialist. ALWAYS use when writing benchmark functions (testing.B), generating or reading pprof profiles, interpreting flame graphs, finding memory allocation hotspots, comparing implementations with benchstat, or measuring ns/op / B/op / allocs/op. In Go code contexts…

johnqtcg/awesome-skills · 90 tokens