go-best-practices

A set of guidelines for writing and reviewing Go code, covering formatting, errors, project layout, and concurrent work. Concurrency means handling multiple tasks that can run at the same time.

In plain words
What is it for?
Use it when building or reviewing Go applications, including error checks, context cancellation, timeouts, goroutines, and package organization.
Why use it?
It helps keep Go programs idiomatic, makes failures easier to understand, and reduces mistakes in concurrent code.

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/taoidle/plan-cascade/go
Any agent
npx skills add Taoidle/plan-cascade --skill go
Clone the repo
git clone --depth 1 https://github.com/Taoidle/plan-cascade

Made for: Claude Code, Codex.

Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 577 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 $0.00030 $0.00577
Opus 5 $0.00015 $0.00289
Sonnet 5 $0.00006 $0.00115
Haiku 4.5 $0.00003 $0.00058

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

Security

Grade A, and why

go-best-practices 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.

builtin-skills/go/SKILL.md · 96 lines

What it actually says

Go Best Practices

Code Style

Rule Guideline
Formatter gofmt or goimports
Linter golangci-lint
Naming Short, clear; avoid stuttering
Comments Godoc for exported items

Error Handling

Rule Guideline
Always check Never ignore errors
Wrap context fmt.Errorf("ctx: %w", err)
Sentinel errors var ErrNotFound = errors.New(...)
func Load(path string) (*Config, error) {
    data, err := os.ReadFile(path)
    if err != nil {
        return nil, fmt.Errorf("load config %s: %w", path, err)
    }
    // ...
}

Project Structure

cmd/appname/main.go
internal/config/
internal/service/
go.mod

Concurrency

Pattern Usage
context.Context Cancellation, timeouts
sync.WaitGroup Wait for goroutines
errgroup.Group Goroutines with errors
func Process(ctx context.Context, items []Item) error {
    for _, item := range items {
        select {
        case <-ctx.Done():
            return ctx.Err()
        default:
            if err := process(item); err != nil { return err }
        }
    }
    return nil
}

Anti-Patterns

Avoid Use Instead
Naked returns Explicit returns
panic for errors Return errors
Large interfaces Small, focused
init() Explicit init

Testing (Table-Driven)

func TestParse(t *testing.T) {
    tests := []struct{ name, input string; want int; wantErr bool }{
        {"valid", "42", 42, false},
        {"invalid", "abc", 0, true},
    }
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            got, err := Parse(tt.input)
            if (err != nil) != tt.wantErr { t.Errorf("err=%v, want=%v", err, tt.wantErr) }
            if got != tt.want { t.Errorf("got=%v, want=%v", got, tt.want) }
        })
    }
}
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 · 96 lines · 30 tokens per session scan A 30a17c4639fe

Subscribe to this mod's changes

go-best-practices is a skill published in the GitHub repository Taoidle/plan-cascade (131 stars, last pushed 5mo ago), licensed MIT. It adds 30 tokens to every session and 577 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-30.

Related

Other skills, from other repositories

release

Cut a versioned release of the DOS kernel — bump the version, draft release notes, commit, tag, push to master, and create a GitHub release. The tag push triggers the gated PyPI publish pipeline (publish.yml); the skill surfaces the run and its approval gate.

anthony-chaudhary/dos-kernel · 59 tokens

stable-release

Promote an already-shipped rolling release (vX.Y.Z) of the DOS kernel to a named stable channel — gated on a green kernel suite + a green third-party CI run on the candidate + a clean truth syscall + a soak window. Writes an evidence file and adds a stable/ git tag on the same commit. Does NOT bump versions or build…

anthony-chaudhary/dos-kernel · 81 tokens

dos-goal-fleet

Launch multiple goal-scoped workers in waves, each with a witness-gated stop condition and dos arbitrate file-tree safety. Use when an operator asks to run several independent goals in parallel and fold only verified ships.

anthony-chaudhary/dos-kernel · 51 tokens

dos-goal-gate

Ground a keep-working goal in evidence the worker did not author by wiring dos hook stop to refuse false done claims. Use for one self-stopping agent or loop worker; use dos-witness-claim for fold barriers.

anthony-chaudhary/dos-kernel · 54 tokens

dos-dispatch-loop

Run recurring dos-dispatch cycles, switching to dos-replan when the backlog drains and stopping on the kernel's loop verdict. Use for unattended dispatch->replan->dispatch work across disjoint lanes.

anthony-chaudhary/dos-kernel · 49 tokens

dos-supervise-loop

Keep a target count of dispatch loops alive across the workspace lane roster: spawn missing loops, scavenge stalled leases, and surface spinning workers. Use when supervising a DOS dispatch-loop fleet.

anthony-chaudhary/dos-kernel · 43 tokens