What problem does it solve?
This Skill prevents common, hard-to-debug failures in Go concurrent programs—goroutine leaks, race conditions, incorrect channel ownership/closure, and broken cancellation behavior.
Core Features & Use Cases
- Structured Concurrency Guardrails: Ensures every goroutine has a clear exit strategy using context cancellation, wait groups, or explicit shutdown signals.
- Channel Correctness: Enforces sender-only channel closing, correct channel direction (
chan<- / <-chan), and safe value passing (send copies, not pointers).
- Practical Concurrency Decisions: Guides when to use channels vs mutexes vs atomics, when to prefer
errgroup over WaitGroup, and how to bound concurrency safely.
- Performance & Reliability Antipattern Avoidance: Flags issues like
time.After in hot loops, missing ctx.Done() in select, unbounded goroutine spawning, and mutexes held across I/O.
- Use Case Examples: Auditing or implementing worker pools, fan-out/fan-in pipelines, concurrent caches, deduplicated in-flight work (
singleflight), and cancellation-safe stages.
Quick Start
Use the golang-concurrency skill to review a Go change request for goroutine leaks and channel ownership bugs in the proposed concurrent code.