What problem does it solve?
This Skill helps you write and review concurrent Go code without goroutine leaks, race conditions, and channel-ownership bugs that commonly appear in real-world systems.
Core Features & Use Cases
- Structured concurrency guardrails: Ensures every goroutine has a clear stop path via
context.Context, done channels, or explicit shutdown, and that cancellation is respected.
- Channel correctness rules: Applies sender/receiver channel ownership, enforces channel direction (
chan<-, <-chan), and prevents unsafe patterns like receiver-closing data channels.
- Safe synchronization decisions: Guides correct selection among
sync.Mutex, sync.RWMutex, sync/atomic, sync.Map, errgroup, singleflight, and worker pools with SetLimit.
- Pipeline patterns that don’t leak: Covers fan-out/fan-in and multi-stage pipelines with proper context checks and output channel closing.
- Use case examples: Build bounded concurrent fetchers, pipeline I/O transformations safely, deduplicate thundering herds with
singleflight, and add leak detection using goleak in tests.
Quick Start
Use the golang-concurrency skill to review your Go PR for goroutine leaks, missing ctx.Done() cases in select, unsafe channel closing, and unprotected shared state.