golang-concurrency

golang-concurrency is a skill for Claude Code from shennawardana23/skillme. It costs 151 tokens per session (1,829 once invoked), scanned A, original, Apache-2.0.

A guide to running concurrent work safely in Go. Concurrency means handling multiple tasks at the same time with goroutines, channels, locks, or coordination tools.

In plain words
What is it for?
Choosing channels or mutexes, using WaitGroup or errgroup, building worker pools and pipelines, and reviewing fan-out and fan-in code.
Why use it?
It helps prevent goroutine leaks, race conditions, unbounded work, and choosing the wrong way to share data or collect errors.

Skill for Claude Code

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

Part of the skillme plugin — 148 skills, 2 commands shipped together

Good fit Choosing channels or mutexes, using WaitGroup or errgroup, building worker pools and pipelines, and reviewing fan-out and fan-in code.

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

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 148 skills, 2 commands.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/shennawardana23/skillme/golang-concurrency"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/golang-concurrency.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,829 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.00151 $0.01829
Opus 5.5 $0.00060 $0.00732
Sonnet 5.5 $0.00030 $0.00366
Haiku 4.5 $0.00015 $0.00183

Measured 2mo ago against content hash 3236e0a39276, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

golang-concurrency 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 2mo 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/golang-concurrency/SKILL.md · 143 lines

How it starts

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

Go Concurrency

Go's concurrency model is a liability until proven necessary: every goroutine you spawn is a resource with an owner, an exit condition, and a failure mode you must account for. Reach for this skill once concurrency itself is the design question — which primitive to use, whether a goroutine can leak, whether shared state is actually protected — not for the routine "fan this out" case, which go-service-idioms already covers with errgroup.

The one question to ask before spawning a goroutine

How does it exit? Every goroutine needs one of: a context.Context whose cancellation it observes in a select, a channel it reads until close, or a sync.WaitGroup/errgroup the caller waits on. A goroutine with none of these is a leak the moment its one caller stops waiting for it — runtime.NumGoroutine() climbing over time in production is the symptom, not the cause.

Choosing a primitive

Scenario Use Why
Passing data between goroutines, transferring ownership channel Communicates "you own this now," not just "here's a pointer"
Waiting for goroutines, no error to collect sync.WaitGroup, or Go 1.25+ wg.Go(f) wg.Go starts the goroutine and calls Add/Done for you — no more forgetting Add before go
Waiting + collecting the first error golang.org/x/sync/errgroup g.Go(func() error {...}); g.Wait() returns the first non-nil error
Waiting + canceling siblings on first error errgroup.WithContext(ctx) The returned ctx cancels for every g.Go call the moment one returns an error
Bounding concurrency without a hand-rolled semaphore errgroup.Group.SetLimit(n) Same Go/Wait API, caps in-flight goroutines
Protecting a shared struct's fields sync.Mutex / sync.RWMutex Simple critical sections; never hold one across a blocking I/O call
A single counter or flag sync/atomic typed atomics (atomic.Int64, atomic.Bool, Go 1.19+) Lock-free, cheaper than a mutex for one word
A map read far more than it's written sync.Map Optimized for read-heavy access; a plain map with concurrent read+write panics at runtime, it does not silently corrupt
Running init exactly once sync.Once (or Go 1.21+ sync.OnceFunc/OnceValue) Safe lazy init without a manual initialized bool + mutex
Deduplicating identical concurrent calls golang.org/x/sync/singleflight Collapses N simultaneous callers into one underlying call

Read the full file on GitHub · 143 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2mo ago First seen · 143 lines · 151 tokens per session scan A 3236e0a39276

Subscribe to this mod's changes

golang-concurrency is a skill published in the GitHub repository shennawardana23/skillme (4 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 151 tokens to every session and 1,829 once invoked, about $0.0006 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

golang-concurrency compared with skills from other repositories

golang-concurrency next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
golang-concurrencyshennawardana23/skillmeSkill41mo agoApache-2.0A151Claude Code
go-servicesWrongStack/WrongStackSkill444yesterdayMITA87Claude Code
go-programming-expertroedyrustam/vibes-plugSkill1293d agoMITA45Cursor
gonimadorostkar/Claude-Skills-collectionSkill41yesterdayMITA90Claude Code
encore-go-apiencoredev/skillsSkill3110d agoApache-2.0A66Claude Code
encore-go-getting-startedencoredev/skillsSkill3110d agoApache-2.0A60Claude Code
encore-go-webhookencoredev/skillsSkill3110d agoApache-2.0A60Claude Code