go-concurrency-patterns — Claude Code skill: install
A Go skill for goroutines, channels, synchronization, and context. Use it when building worker pools or tracking down race conditions.
/plugin marketplace add wshobson/agents
/plugin install systems-programming@claude-code-workflowsWhat go-concurrency-patterns does
go-concurrency-patterns covers concurrent Go applications with goroutines, channels, select, sync.Mutex, sync.WaitGroup, and context.Context. It is aimed at worker pools, pipelines, goroutine lifecycle management, graceful shutdown, and race-condition debugging.
The skill includes a working example built around context.WithTimeout, a results channel, WaitGroup, and closing the channel after workers finish. More detailed patterns are kept in references/details.md for cases where the basic guidance is not enough. Its recommendations also cover errgroup, buffered channels, sender-side channel closing, and checking ctx.Done().
Install it when your Go project has concurrent operations or needs a race-condition review. It is unnecessary for a codebase without concurrency.
What it helps with
- build a worker pool for Go tasks
- connect goroutines with channels and select
- handle cancellation and deadlines with context
- trace goroutine leaks and race conditions
- add graceful shutdown to a Go service
Example prompts for the agent
- Build a Go worker pool with context and graceful shutdown.
- Review this code for goroutine leaks and race conditions.
- Show where this code should use WaitGroup or errgroup.
How to install go-concurrency-patterns
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install systems-programming@claude-code-workflowsThis installs the whole systems-programming plugin with all its skills
2Skills CLI (Vercel)
npx skills add wshobson/agents --skill go-concurrency-patterns -a claude-code3Manually: put the files in place
~/.claude/skills/go-concurrency-patterns/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/go-concurrency-patterns/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill go-concurrency-patterns -a codex2Manually: put the files in place
.agents/skills/go-concurrency-patterns/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill go-concurrency-patterns -a cursor2Manually: put the files in place
.cursor/skills/go-concurrency-patterns/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshobson/agents go-concurrency-patterns2Manually: put the files in place
.github/skills/go-concurrency-patterns/SKILL.mdPlatform CLI
gemini skills install https://github.com/wshobson/agents --path plugins/systems-programming/skills/go-concurrency-patternsManually: put the files in place
.devin/skills/go-concurrency-patterns/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set213
The whole set →Similar
Questions about go-concurrency-patterns
How do I install go-concurrency-patterns in Claude Code?
Run npx skills add wshobson/agents --skill go-concurrency-patterns -a claude-code. The skill file is placed at ~/.claude/skills/go-concurrency-patterns/SKILL.md.
What does go-concurrency-patterns do?
It guides concurrent Go work with goroutines, channels, synchronization primitives, and context.Context. It also covers worker pools, pipelines, cancellation, and race-condition debugging.
Which Go tools and patterns does it cover?
The skill includes sync.Mutex, sync.WaitGroup, select, channels, and context.Context. It recommends errgroup for concurrent operations that return errors.
Source text
SKILL.md · MIT
---
name: go-concurrency-patterns
description: Master Go concurrency with goroutines, channels, sync primitives, and context. Use when building concurrent Go applications, implementing worker pools, or debugging race conditions.
---
# Go Concurrency Patterns
Production patterns for Go concurrency including goroutines, channels, synchronization primitives, and context management.
## When to Use This Skill
- Building concurrent Go applications
- Implementing worker pools and pipelines
- Managing goroutine lifecycles
- Using channels for communication
- Debugging race conditions
- Implementing graceful shutdown
## Core Concepts
### 1. Go Concurrency Primitives
| Primitive | Purpose |
| ----------------- | -------------------------------- |
| `goroutine` | Lightweight concurrent execution |
| `channel` | Communication between goroutines |
| `select` | Multiplex channel operations |
| `sync.Mutex` | Mutual exclusion |
| `sync.WaitGroup` | Wait for goroutines to complete |
| `context.Context` | Cancellation and deadlines |
### 2. Go Concurrency Mantra
```
Don't communicate by sharing memory;
share memory by communicating.
```
## Quick Start
```go
package main
import (
"context"
"fmt"
"sync"
"time"
)
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
results := make(chan string, 10)
var wg sync.WaitGroup
// Spawn workers
for i := 0; i < 3; i++ {
wg.Add(1)
go worker(ctx, i, results, &wg)
}
// Close results when done
go func() {
wg.Wait()
close(results)
}()
// Collect results
for result := range results {
fmt.Println(result)
}
}
func worker(ctx context.Context, id int, results chan<- string, wg *sync.WaitGroup) {
defer wg.Done()
select {
case <-ctx.Done():
return
case results <- fmt.Sprintf("Worker %d done", id):
}
}
```
## Detailed patterns and worked examples
Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.
## Best Practices
### Do's
- **Use context** - For cancellation and deadlines
- **Close channels** - From sender side only
- **Use errgroup** - For concurrent operations with errors
- **Buffer channels** - When you know the count
- **Prefer channels** - Over mutexes when possible
### Don'ts
- **Don't leak goroutines** - Always have exit path
- **Don't close from receiver** - Causes panic
- **Don't use shared memory** - Unless necessary
- **Don't ignore context cancellation** - Check ctx.Done()
- **Don't use time.Sleep for sync** - Use proper primitives
© Seth Hobson · MIT · wshobson/agents