go-code-audit

A review tool for Go source code that checks whether it follows common Go practices and is easy to maintain. It reports code smells, anti-patterns, naming issues, package-structure problems, and error-handling concerns.

In plain words
What is it for?
Auditing a Go project, reviewing code changes, finding non-idiomatic Go, and checking areas such as interfaces, goroutines, errors, package structure, global state, and overly complex functions.
Why use it?
It helps find design and quality problems that ordinary compilation or linting may not reveal. Findings are grouped so larger issues can be addressed first.

Skill for Claude CodeCodex

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/gopherguides/gopher-ai/go-code-audit
Any agent
npx skills add gopherguides/gopher-ai --skill go-code-audit
Clone the repo
git clone --depth 1 https://github.com/gopherguides/gopher-ai

Made for: Claude Code, Codex.

Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,117 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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 $0.00084 $0.01117
Opus 5 $0.00042 $0.00558
Sonnet 5 $0.00017 $0.00223
Haiku 4.5 $0.00008 $0.00112

Measured 2d ago against content hash 8731b79298d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

go-code-audit scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -H "Authorization: Bearer $GOPHER_GUIDES_API_KEY" \
agent-skills/skills/go-code-audit/SKILL.md · 159 lines

How it starts

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

Go Code Audit

Comprehensive code quality analysis against Go best practices. Identifies code smells, anti-patterns, and non-idiomatic patterns with categorized findings.

What It Checks

Idiomatic Go Patterns

  • Proper use of interfaces (accept interfaces, return structs)
  • Channel and goroutine patterns
  • Error wrapping with %w and sentinel errors
  • Use of context.Context as first parameter
  • Functional options pattern where appropriate

Naming & Style

  • Package naming (short, lowercase, no underscores)
  • Exported name stuttering (user.UserServiceuser.Service)
  • Acronym consistency (URL, HTTP, ID)
  • Variable scope and naming length conventions

Package Structure

  • internal/ usage for non-public packages
  • Circular dependency detection
  • Package cohesion (single responsibility)
  • cmd/ and pkg/ conventions

Error Handling

  • Unchecked errors (errcheck patterns)
  • Bare log.Fatal in library code
  • Panics in recoverable code paths
  • Error wrapping without context

Code Smells

  • Global mutable state
  • init() function overuse
  • Empty interfaces where concrete types suffice
  • Overly complex functions (cyclomatic complexity)
  • Dead code and unused exports

How to Run

API Integration (Optional)

If GOPHER_GUIDES_API_KEY is set, verify it:

curl -s -H "Authorization: Bearer $GOPHER_GUIDES_API_KEY" \
  https://gopherguides.com/api/gopher-ai/me

If not set, local analysis tools (go vet, staticcheck, golangci-lint) still provide comprehensive analysis. Set the key for enhanced API-powered insights. Get your key at gopherguides.com.

Full Project Audit

Analyze the entire Go project:

# Run static analysis tools
go vet ./...
staticcheck ./...
golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 ./...

Then review the codebase for patterns the tools don't catch:

  1. Read each package's exported API — check for stuttering, interface bloat, and naming
  2. Trace error paths — ensure all errors are wrapped with context
  3. Review concurrency — check goroutine lifecycle management
  4. Check test coverage — identify untested critical paths

Read the full file on GitHub · 159 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 · 159 lines · 84 tokens per session scan A 8731b79298d5

Subscribe to this mod's changes

go-code-audit is a skill published in the GitHub repository gopherguides/gopher-ai (21 stars, last pushed 2d ago), licensed MIT. It adds 84 tokens to every session and 1,117 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

layered-architecture-types

Enforce primitive-at-edges / strong-types-in-Business layering and the toBus/fromBusResponse/toDB converter pattern. Use when writing, editing, or auditing Go files under app/, business/domain/, or .../stores/db.

ardanlabs/service · 56 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

samber/cc-skills-golang · 115 tokens

golang-observability

Golang everyday observability — the always-on signals in production. Covers structured logging with slog, Prometheus metrics, OpenTelemetry distributed tracing, continuous profiling with pprof/Pyroscope, server-side RUM event tracking, alerting, and Grafana dashboards. Apply when instrumenting Go services for…

samber/cc-skills-golang · 166 tokens

golang-data-structures

Golang data structures — slices (internals, capacity growth, preallocation, slices package), maps (internals, hash buckets, maps package), arrays, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections, pointers (unsafe.Pointer, weak.Pointer), and copy semantics. Use when choosing or optimizing…

samber/cc-skills-golang · 126 tokens

golang-dependency-management

Dependency management for Golang projects — go.mod and go.sum, go get install and upgrade flows, Minimal Version Selection, conflict resolution with replace/exclude/retract, govulncheck scanning of the module tree, outdated dependency and binary size auditing, vendoring, tool directives, and go.work workspaces. Use…

samber/cc-skills-golang · 182 tokens

golang-spf13-viper

Golang configuration library using spf13/viper — layered precedence (flag > env > file > KV > default), BindPFlag/BindPFlags, SetEnvPrefix + SetEnvKeyReplacer + AutomaticEnv, ReadInConfig + ConfigFileNotFoundError, Unmarshal + mapstructure struct tags, Sub for sub-trees, WatchConfig + OnConfigChange for hot reload…

samber/cc-skills-golang · 174 tokens