go-concurrency-guide

go-concurrency-guide is a skill for Claude Code, Codex from khalilbenaz/claude-skills-collection. It costs 75 tokens per session (1,726 once invoked), scanned A, original, MIT.

A guide to writing Go code with a focus on concurrency, where multiple tasks run at the same time. It covers goroutines, channels, worker patterns, interfaces, errors, cleanup, and database access.

In plain words
What is it for?
Use it to build worker pools, coordinate goroutines with channels, stop work cleanly, write database methods, and handle errors without crashing the program.
Why use it?
It helps prevent common problems such as blocked workers, leaked goroutines, unsafe shared work, and unclear error handling. It also explains when to use different Go language patterns.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go build -trimpath -ldflags="-s -w" ./cmd/myapp.

Good fit Use it to build worker pools, coordinate goroutines with channels, stop work cleanly, write database methods, and handle errors without crashing the program.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/khalilbenaz/claude-skills-collection
agentmods
npx agentmods add skills/khalilbenaz/claude-skills-collection/go-concurrency-guide

Made for: Claude Code, Codex.

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 go-concurrency-guide

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/go-concurrency-guide"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/go-concurrency-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,726 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00075 $0.01726
Opus 5 $0.00037 $0.00863
Sonnet 5 $0.00015 $0.00345
Haiku 4.5 $0.00007 $0.00173

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

Security

Grade A, and why

go-concurrency-guide 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 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.

Makes network callslowCapability

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

fetch(u)
dev-skills/go-concurrency-guide/SKILL.md · 226 lines

How it starts

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

Go Concurrency Guide

1. Fondamentaux Go — critères de décision

Situation Choix
Méthode modifie le receiver Pointer receiver *T
Méthode lit seulement Value receiver T (sauf struct > ~64 bytes)
Comportement partagé Interface implicite (duck typing)
Cleanup garanti defer f.Close() / defer mu.Unlock()
Erreur attendue Retour (T, error), jamais panic
type Store struct{ db *sql.DB }

func (s *Store) Get(ctx context.Context, id int) (User, error) {
    var u User
    err := s.db.QueryRowContext(ctx, "SELECT ...").Scan(&u.Name)
    return u, fmt.Errorf("store.Get %d: %w", id, err)
}

2. Goroutines et channels

Unbuffered = synchrone (handshake). Buffered = découplage, ne pas abuser.

// Done pattern — arrêt propre
done := make(chan struct{})
go func() {
    defer close(done)
    for {
        select {
        case <-ctx.Done():
            return
        case job := <-jobs:
            process(job)
        }
    }
}()

// Fan-out vers N workers
jobs := make(chan Task, 100)
var wg sync.WaitGroup
for range N {                          // Go 1.22+
    wg.Add(1)
    go func() {
        defer wg.Done()
        for t := range jobs { handle(t) }
    }()
}
close(jobs)
wg.Wait()

Règle d'or : le producteur ferme le channel, jamais le consommateur.

3. Patterns de concurrence — quand utiliser quoi

Pattern Usage Snippet
Worker pool CPU-bound, N fixe make(chan Job, buf) + N goroutines
Pipeline Transformations en chaîne channels en entrée/sortie de chaque stage
Semaphore Limiter I/O concurrent sem := make(chan struct{}, max)
errgroup Goroutines avec erreur remontée golang.org/x/sync/errgroup
// Semaphore — max 10 requêtes HTTP parallèles
sem := make(chan struct{}, 10)
for _, url := range urls {
    sem <- struct{}{}
    go func(u string) {
        defer func() { <-sem }()
        fetch(u)
    }(url)
}

// errgroup — propagation d'erreur
g, ctx := errgroup.WithContext(ctx)
for _, item := range items {
    item := item
    g.Go(func() error { return process(ctx, item) })
}
if err := g.Wait(); err != nil { ... }

Read the full file on GitHub · 226 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. 9d ago First seen · 226 lines · 75 tokens per session scan A 04fcf17e1dfd

Subscribe to this mod's changes

go-concurrency-guide is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (22 stars, last pushed 19d ago), licensed MIT. It adds 75 tokens to every session and 1,726 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-09-03.

Related

Other skills, from other repositories

golang-rules

Go coding rules: style, patterns, security, testing. Triggers: .go, go.mod, go.sum, Gin, Echo, Gorilla, testing, gofmt.

softspark/ai-toolkit · 40 tokens

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

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

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