golang-concurrency

Analyzes Go concurrency code to fix goroutine leaks, race conditions, and channel ownership.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/tamago0224/kuroshio-mta --skill golang-concurrency-tamago0224
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-concurrency
Source: https://github.com/tamago0224/kuroshio-mta/tree/main/.agents/skills/golang-concurrency
Command: npx skills add https://github.com/tamago0224/kuroshio-mta --skill golang-concurrency-tamago0224

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go concurrency can be error-prone; this Skill provides structured patterns, review guidance, and best practices to prevent leaks, races, and ownership mistakes in goroutines, channels, and synchronization primitives.

Core Features & Use Cases

  • Comprehensive Go concurrency guidance covering goroutines, channels, select, locks, sync primitives, errgroup, singleflight, worker pools, and fan-out/fan-in pipelines.
  • Modes for writing concurrent code, reviewing PRs, and auditing existing code for leaks, race conditions, and ownership issues.
  • Real-world examples and enforceable patterns to ensure clean shutdown, proper cancellation, and safe resource management.

Quick Start

Ask me to review or implement Go concurrency code with proper shutdown, context handling, and safe channel usage.

Frequently Asked Questions about golang-concurrency

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

FAQPage Schema
How do I detect goroutine leaks in Go concurrency code?

Detect goroutine leaks by analyzing Go concurrency code for missing context cancellation, blocked channel sends, or orphaned goroutines. This Skill identifies these patterns and enforces proper channel closure and ownership discipline to ensure clean shutdown.

How can I prevent race conditions when using goroutines and channels?

Prevent race conditions by applying proper synchronization primitives, channel ownership rules, and context cancellation patterns. This Skill reviews Go code to identify data races and enforce safe synchronization across components using mutexes, select statements, and worker pools.

What is the best way to implement a worker pool in Go?

The best way to implement a worker pool in Go is using structured fan-out/fan-in pipeline patterns with proper channel ownership and context cancellation. This Skill provides enforceable patterns and real-world examples for building safe worker pools.

Does this Skill help with reviewing Go PRs for concurrency issues?

Yes, this Skill includes a dedicated PR review mode that audits existing Go code for leaks, race conditions, and incorrect channel ownership. It enforces best practices for context cancellation, proper channel closure, and safe synchronization across components.

How do I handle proper channel closure and ownership in Go?

Proper channel closure and ownership in Go requires establishing clear discipline over who creates, sends to, and closes each channel. This Skill analyzes your code to enforce channel ownership rules and correct closure patterns to prevent panics and leaks.

Can I use errgroup and singleflight patterns for Go concurrency?

Yes, this Skill provides comprehensive Go concurrency guidance covering errgroup, singleflight, goroutines, channels, select, locks, and sync primitives. It applies these patterns to ensure proper cancellation, clean shutdown, and safe synchronization across components.