clean-code-go

clean-code-go is a skill for Claude Code from CassetteTapeCrackle/claude-starters. It costs 34 tokens per session (317 once invoked), scanned A, original, MIT.

Go coding guidance for writing and reviewing programs in Go, a programming language designed for simple, concurrent software.

In plain words
What is it for?
It is for choosing Go error-handling patterns, keeping interfaces small, managing goroutines with cancellation, and improving code structure.
Why use it?
It helps avoid lost errors, unclear data types, and background tasks that never stop.

Skill for Claude Code

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

Part of the claude-starters plugin — 9 skills, 1 command, 8 agents, 2 hooks shipped together

Good fit It is for choosing Go error-handling patterns, keeping interfaces small, managing goroutines with cancellation, and improving code structure.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cassettetapecrackle/claude-starters/clean-code-go
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 CassetteTapeCrackle/claude-starters --skill clean-code-go
Clone the repo
git clone --depth 1 https://github.com/CassetteTapeCrackle/claude-starters

Made for: Claude Code.

Or install claude-starters, the plugin that ships this one along with the rest of its 9 skills, 1 command, 8 agents, 2 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 clean-code-go

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/cassettetapecrackle/claude-starters/clean-code-go"><img src="https://agentmods.dev/badge/skills/cassettetapecrackle/claude-starters/clean-code-go.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 317 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.00034 $0.00317
Opus 5 $0.00017 $0.00159
Sonnet 5 $0.00007 $0.00063
Haiku 4.5 $0.00003 $0.00032

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

Security

Grade A, and why

clean-code-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 9d 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/clean-code-go/SKILL.md · 29 lines

What it actually says

Clean-code Go (depth)

On top of the base rules (gofmt, go vet, golangci-lint, table tests).

Errors

  • Wrap with context: fmt.Errorf("doing X: %w", err); inspect with errors.Is/errors.As.
  • Handle every error where it happens; don't _ = it away. Sentinel errors as package vars when callers must branch.

Interfaces & types

  • Define interfaces at the consumer, keep them 1–3 methods. Accept interfaces, return concrete structs.
  • Avoid interface{}/any except at true boundaries (encoding). Prefer concrete types and generics where they fit.

Concurrency

  • Every goroutine needs a clear stop condition and owner; pass context.Context (first param) and honor cancellation.
  • Don't leak goroutines or channels; the launcher is responsible for shutdown. Guard shared state with a mutex or a channel, not both.

Style

  • Zero-value-useful structs; constructors only when needed. Early returns; no deep nesting.

Smells

  • interface{} threaded through business logic → concrete types/generics.
  • A goroutine with no cancellation path → a leak.
  • Errors logged and returned at every layer → double logging; wrap and return, log once at the edge.
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. 9d ago First seen · 29 lines · 34 tokens per session scan A 963726008889

Subscribe to this mod's changes

clean-code-go is a skill published in the GitHub repository CassetteTapeCrackle/claude-starters (1 stars, last pushed 21d ago), licensed MIT. It adds 34 tokens to every session and 317 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-31.

Related

Other skills, from other repositories

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-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-performance-review

Review Go code for performance issues including slice/map pre-allocation, string concatenation, N+1 queries, connection pool configuration, sync.Pool, memory alignment, lock scope, buffered I/O, and HTTP transport tuning. Trigger when code contains make(), loops, database queries, string building, sync primitives…

johnqtcg/awesome-skills · 80 tokens

go-quality-review

Review Go code for code quality, style, and modern Go practices including function length, nesting depth, naming, mutable globals, interface design, receiver consistency, modern Go idioms (slog, generics, typed atomics), and static analysis. Trigger when reviewing Go code structure, readability, or maintainability.…

johnqtcg/awesome-skills · 79 tokens

go-concurrency-review

Review Go code for concurrency safety and goroutine lifecycle issues including race conditions, deadlocks, goroutine leaks, mutex misuse, and context propagation. Trigger when code contains go func, channels, sync primitives, WaitGroup, errgroup, or goroutine lifecycle management. Use for concurrency-focused review of…

johnqtcg/awesome-skills · 67 tokens

go-error-review

Review Go code for error handling correctness, nil safety, and failure-path integrity including ignored errors, missing wrapping, panic misuse, SQL/HTTP resource lifecycle, and transaction patterns. Trigger when code contains error returns, panic calls, sql.Rows, transactions, HTTP client/server code, or nil-sensitive…

johnqtcg/awesome-skills · 75 tokens