go-concurrency

Reviews Go code for goroutine leaks, channel misuse, synchronization errors.

Updated May 2, 2026
One-click install
npx skills add https://github.com/Qunnnn/agents --skill go-concurrency-qunnnn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-concurrency
Source: https://github.com/Qunnnn/agents/tree/main/skills/go/go-concurrency
Command: npx skills add https://github.com/Qunnnn/agents --skill go-concurrency-qunnnn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers prevent concurrency bugs, goroutine leaks, race conditions, and unreliable synchronization patterns when building concurrent Go applications.

Core Features & Use Cases

  • Goroutine Lifecycle Guidance: Defines safe patterns for cancellation, shutdown handling, and preventing leaked goroutines.
  • Concurrency Primitive Selection: Explains when to use channels, mutexes, atomics, WaitGroups, errgroup, singleflight, and worker pools.
  • Pipeline and Coordination Patterns: Provides practical approaches for fan-out/fan-in workflows, context-aware workers, and parallel task execution.

Quick Start

Use the go-concurrency skill to review my Go code for goroutine leaks, channel misuse, and unsafe synchronization patterns.

Frequently Asked Questions about go-concurrency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent goroutine leaks in Go concurrent applications?

Prevent goroutine leaks by applying safe lifecycle management patterns, ensuring correct cancellation handling via contexts, and enforcing channel ownership rules to allow reliable goroutine shutdown.

When should I use channels versus mutexes for Go synchronization?

Use channels for coordination and data flow, while selecting mutexes, atomics, or WaitGroups for protecting shared state. The correct synchronization primitive depends on the specific concurrency scenario.

What is the best way to structure fan-out and fan-in workflows in Go?

Structure fan-out and fan-in workflows using pipeline architectures, context-aware worker pools, and errgroup for parallel task execution to achieve scalable and safe concurrent processing.

How do I review my existing Go code for unsafe concurrency patterns?

Review Go code by checking for channel misuse, improper synchronization primitive selection, and missing cancellation handling to identify and fix race conditions and concurrency defects.

Why does my Go worker pool hang during shutdown?

Worker pools hang during shutdown due to incorrect channel ownership or missing context cancellation. Ensure proper lifecycle management and context-aware worker termination to resolve the deadlock.