Skip to main content
skill Claude Code CX Codex Cursor

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.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install systems-programming@claude-code-workflows
Open on GitHub

What 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-workflows

This installs the whole systems-programming plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill go-concurrency-patterns -a claude-code

3Manually: put the files in place

~/.claude/skills/go-concurrency-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/go-concurrency-patterns/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

expo-router expo Skill for file-based routing, stacks, modals and tabs in Expo Router. Use it when building navigation in a React Native mobile app. Claude Code CX Codex Cursor +1 27,700installs expo-brownfield expo Embeds React Native and Expo into existing native iOS and Android apps. Useful when adding cross-platform screens to SwiftUI, UIKit, or Kotlin hosts. Claude Code CX Codex Cursor +1 27,700installs doublecheck official github Checks factual claims in AI output, looks for sources, and flags hallucination risk. Use it before relying on analysis, research summaries, or legal content. GitHub Copilot 4,300installs find-skills vercel-labs Discovers and installs agent skills from skills.sh directly inside your coding assistant. Handy when you need domain-specific workflows for a project. Claude Code CX Codex Cursor +1 4,000,000installs frontend-design official anthropics This skill guides intentional visual design for new interfaces and redesigns. Use it when a generic generated UI is not enough. Claude Code Claude.ai 1,025,790installs grill-me Matt Pocock grill-me interviews you about a plan or design to expose gaps and sharpen decisions. Use it before implementation starts. Claude Code 1,424,476installs grill-with-docs Matt Pocock This skill interviews you about a plan or design and creates ADRs and a glossary along the way. Use it when decisions need sharper definition. Claude Code 1,219,756installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor