go-concurrency-patterns

Design safe concurrent Go programs using goroutines, channels, and sync primitives.

Updated May 16, 2026
One-click install
npx skills add https://github.com/p-o-ke-nae/pokemondamagecalculatorforstory --skill go-concurrency-patterns-p-o-ke-nae
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-concurrency-patterns
Source: https://github.com/p-o-ke-nae/pokemondamagecalculatorforstory/tree/main/.github/skills/go-concurrency-patterns
Command: npx skills add https://github.com/p-o-ke-nae/pokemondamagecalculatorforstory --skill go-concurrency-patterns-p-o-ke-nae

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build correct, maintainable, and race-free concurrent Go programs without guessing which primitive or pattern to use.

Core Features & Use Cases

  • Concurrency Primitives: Use goroutines, channels, select, mutexes, wait groups, and context correctly.
  • Production Patterns: Implement worker pools, fan-out/fan-in pipelines, bounded concurrency, graceful shutdown, and error-group cancellation.
  • Debugging & Safety: Diagnose race conditions, avoid goroutine leaks, and apply best practices for reliable coordination.
  • Use Case: If you need to process many API calls in parallel while respecting cancellation and limiting load, this Skill guides the full implementation pattern.

Quick Start

Ask for a Go concurrency design, review, or fix that uses goroutines, channels, context, and synchronization primitives for your specific task.

Frequently Asked Questions about go-concurrency-patterns

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

FAQPage Schema
How do I prevent goroutine leaks when implementing graceful shutdown in Go?

Implement race-free Go pipelines by using channels for communication and sync primitives like mutexes for shared state. This approach ensures safe coordination without data races across concurrent operations.

What is the best way to limit concurrent API calls in Go using worker pools?

Limit concurrent API calls in Go by implementing a worker pool pattern with bounded parallelism. This uses channels to distribute tasks and context to respect cancellation while limiting system load.

How do I debug race conditions in concurrent Go programs?

Debug race conditions in Go by applying proper synchronization primitives and channel coordination. This Skill guides diagnosing data races and applying best practices for reliable concurrent execution.

When do I need to use errgroup-style coordination instead of sync.WaitGroup in Go?

Use errgroup-style coordination instead of sync.WaitGroup when concurrent goroutines need to share errors and trigger cancellation. WaitGroup only waits for completion, while errgroup manages error propagation.

How do I implement fan-out fan-in concurrency patterns in Go without deadlocks?

Implement fan-out fan-in patterns in Go by using channels to distribute work across multiple goroutines and aggregate results. Proper use of select statements and context prevents deadlocks during pipeline coordination.