go-concurrency-review

Review Go code for unsafe concurrency patterns and goroutine lifecycle issues.

64|9|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/eduardo-sl/go-agent-skills --skill go-concurrency-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-concurrency-review
Source: https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/%28safety%29/go-concurrency-review
Command: npx skills add https://github.com/eduardo-sl/go-agent-skills --skill go-concurrency-review

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reviews Go code to identify and remediate unsafe concurrency patterns that cause goroutine leaks, data races, deadlocks, improper context usage, and incorrect synchronization practices.

Core Features & Use Cases

  • Goroutine lifecycle management: Enforces explicit termination paths, owner-started goroutines, and use of coordinated groups for parallel work.
  • Channel and mutex guidance: Validates channel sizing and closing, signal channel conventions, minimal lock scopes, mutex placement, and warns against copying mutexes by value.
  • Context and race detection: Checks for context propagation rules, ensures context-first parameters and cancellation handling, and mandates running tests with the race detector for CI.
  • Use Case: Apply during code review or debugging to locate goroutine leaks, race conditions, improper use of sync primitives, and missing context handling in long-running services or producer/consumer pipelines.

Quick Start

Review the repository's Go packages for goroutine leaks, race conditions, improper context usage, and synchronization issues, and produce a prioritized list of fixes.

Frequently Asked Questions about go-concurrency-review

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

FAQPage Schema
How do I find goroutine leaks and race conditions in my Go code?

To find goroutine leaks and race conditions in Go code, review goroutine lifecycle management, enforce explicit termination paths, and mandate running tests with the race detector. This process identifies unsafe concurrency patterns and missing context handling in long-running services.

What are common unsafe Go concurrency patterns to check during a code review?

Common unsafe Go concurrency patterns include improper channel closing, copying mutexes by value, and incorrect synchronization. A code review should validate minimal lock scopes, channel sizing, and signal channel conventions to prevent deadlocks and data races.

How do I ensure proper context propagation in Go concurrent systems?

To ensure proper context propagation in Go concurrent systems, enforce context-first function parameters and verify cancellation handling. Checking these rules during code review prevents goroutine leaks and ensures long-running services respond to termination signals correctly.

When should I use errgroup instead of raw goroutines in Go?

You should use errgroup instead of raw goroutines when managing parallel work that requires coordinated error handling and explicit termination. Enforcing errgroup usage during design prevents goroutine leaks by ensuring all spawned goroutines exit cleanly when an error occurs.

How do I validate channel sizing and mutex placement in Go producer consumer pipelines?

To validate channel sizing and mutex placement in Go producer consumer pipelines, review channel conventions and ensure minimal lock scopes. This prevents deadlocks and incorrect synchronization by warning against copying mutexes by value and verifying proper channel closing.