Agent skill

Go Concurrency Patterns

by wshobson in wshobson/agents

Reference patterns for goroutines, channels, sync primitives and context in Go, covering worker pools, pipelines, graceful shutdown and race-condition debugging.

MITAuto-check passedDevelopment

Install Go Concurrency Patterns

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

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wshobson/agents go-concurrency-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/systems-programming/skills/go-concurrency-patterns .claude/skills/go-concurrency-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
go-concurrency-patterns
GitHub stars
40k
Used in
9 other repos
Token cost
~693 tokens
SKILL.md length
172 words
Files
2 (incl. references)
Skills in repo
142
Repo updated
First seen
Licence
MIT

At a glance

Reference patterns for goroutines, channels, sync primitives and context in Go, covering worker pools, pipelines, graceful shutdown and race-condition debugging.

  • Works in 2 steps: Go Concurrency Primitives → Go Concurrency Mantra
  • Building a worker pool or pipeline in a Go service
  • SKILL.md covers When to Use This Skill, Core Concepts, Quick Start and Detailed patterns and worked…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

This skill gives the agent a working reference for concurrent Go code. It lists the main primitives (goroutines, channels, select, sync.Mutex, sync.WaitGroup and context.Context) with the job each one does, restates the Go saying about sharing memory by communicating, and includes a short quick-start program.

A do and don't list covers habits such as closing channels only from the sender, giving every goroutine an exit path, checking ctx.Done(), using errgroup when concurrent work can fail, and avoiding time.Sleep as a synchronization tool. Longer worked examples sit in a separate references/details.md file that the agent opens when the summary is not enough.

When your agent uses it

  • Building a worker pool or pipeline in a Go service
  • Debugging a suspected race condition or goroutine leak
  • Adding graceful shutdown to a Go program
  • Choosing between channels and mutexes for shared state

Example prompts

  • “Write a Go worker pool that reads jobs from a channel and stops cleanly when the context is cancelled.”
  • “Our Go service leaks goroutines after requests time out. Find out why.”
  • “Add graceful shutdown to this HTTP server so in-flight handlers can finish first.”

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Go Concurrency Primitives
  2. Go Concurrency Mantra

What it can do on your machine

Read from SKILL.md and the folder at commit 46891e7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Go Concurrency Patterns loads about 693 tokens when it runs, and up to ~3.4k if it reads all its reference files. Until then it costs about 51 tokens; SKILL.md has 172 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~693
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wshobson/agents at commit 46891e7, republished under its MIT licence (© wshobson). 172 words, ~693 tokens.

Download SKILL.mdSave it as .claude/skills/go-concurrency-patterns/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
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
PrimitivePurpose
goroutineLightweight concurrent execution
channelCommunication between goroutines
selectMultiplex channel operations
sync.MutexMutual exclusion
sync.WaitGroupWait for goroutines to complete
context.ContextCancellation 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

© wshobson, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in plugins/systems-programming/skills/go-concurrency-patterns of wshobson/agents.

  • SKILL.md
  • references/details.md

Open the folder on GitHubat commit 46891e7

Used in 9 other repositories

We found 23 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 9 other GitHub owners. This page covers the copy in wshobson/agents, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Go Concurrency Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Go Concurrency Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go Concurrency Patterns this skillwshobson/agents40k9 repos~693Automated safety check: PassMIT
Julessanjay3290/ai-skills431—~2.1kAutomated safety check: PassApache-2.0
Frappe Errors ClientscriptsImpertio-Studio/Frappe_Claude_Skill_Package188—~2.4kAutomated safety check: PassMIT
DebuggerTheDecipherist/claude-code-mastery-project-starter-kit338—~669Automated safety check: NotesMIT
Supabase Advanced Troubleshootingjeremylongshore/tons-of-skills-marketplace2.8k—~2.8kAutomated safety check: PassMIT
Rust Debuggingmohitmishra786/low-level-dev-skills253—~1.6kAutomated safety check: PassMIT

Similar skills

  • Jules

    sanjay3290/ai-skills

    Delegate coding tasks to Google Jules AI agent for asynchronous execution.

    431 GitHub stars~2.1k tokensUpdated 28 days ago
    DevelopmentAuto-check passed
  • Frappe Errors Clientscripts

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when debugging or preventing errors in Frappe Client Scripts.

    188 GitHub stars~2.4k tokensUpdated 22 days ago
    DevelopmentAuto-check passed
  • Debugger

    TheDecipherist/claude-code-mastery-project-starter-kit

    Diagnose failures by root cause, not symptom. An agent skill from TheDecipherist/claude-code-mastery-project-starter-kit.

    338 GitHub stars~669 tokensUpdated 3 mo ago
    DevelopmentAuto-check: notes
  • Supabase Advanced Troubleshooting

    jeremylongshore/tons-of-skills-marketplace

    Deep Supabase diagnostics: pgstatstatements for slow queries, lock debugging with pglocks, connection leak detection, RLS policy conflicts, Edge Function cold starts, and Realtime connection drop…

    2.8k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Rust Debugging

    mohitmishra786/low-level-dev-skills

    Rust debugging skill for systems programming. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.6k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Replay Oriented Instrumentation

    ArabelaTso/Skills-4-SE

    Instruments programs to record execution information for deterministic replay debugging.

    253 GitHub stars~2.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from wshobson/agents

All 142 skills in this repo
  • Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.

    40k GitHub starsUsed in 14 repos~1.7k tokens
    Auto-check passed
  • Billing Automation

    wshobson/agents

    Covers building subscription billing: billing cycles, subscription states, invoice generation, proration, tax handling and dunning for failed payments.

    40k GitHub starsUsed in 13 repos~473 tokens
    Auto-check passed
  • Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.

    40k GitHub starsUsed in 13 repos~814 tokens
    Auto-check passed
  • Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.

    40k GitHub starsUsed in 12 repos~1.3k tokens
    Auto-check passed
  • Distributed Tracing

    wshobson/agents

    Implement distributed tracing with Jaeger and Tempo to track requests across microservices and identify performance bottlenecks.

    40k GitHub starsUsed in 12 repos~527 tokens
    Auto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 4 days ago
    Auto-check passed

Categories

Questions about Go Concurrency Patterns

What does Go Concurrency Patterns do?

Reference patterns for goroutines, channels, sync primitives and context in Go, covering worker pools, pipelines, graceful shutdown and race-condition debugging. This skill gives the agent a working reference for concurrent Go code.Context) with the job each one does, restates the Go saying about sharing memory by communicating, and includes a short quick-start program.

When should I use Go Concurrency Patterns?

Go Concurrency Patterns fits situations like: building a worker pool or pipeline in a Go service; debugging a suspected race condition or goroutine leak; adding graceful shutdown to a Go program; choosing between channels and mutexes for shared state.

How do I install Go Concurrency Patterns in Claude Code?

Run `npx skills add wshobson/agents --skill go-concurrency-patterns -a claude-code`. Or copy the skill folder (plugins/systems-programming/skills/go-concurrency-patterns in wshobson/agents) into .claude/skills/go-concurrency-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Go Concurrency Patterns in Codex?

Run `npx skills add wshobson/agents --skill go-concurrency-patterns -a codex`. Or copy the skill folder (plugins/systems-programming/skills/go-concurrency-patterns in wshobson/agents) into .agents/skills/go-concurrency-patterns in your project. Codex loads it when a task matches its description.

Can I use Go Concurrency Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wshobson/agents --skill go-concurrency-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/go-concurrency-patterns, .gemini/skills/go-concurrency-patterns, .github/skills/go-concurrency-patterns and .opencode/skills/go-concurrency-patterns in your project.

What does Go Concurrency Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Go Concurrency Patterns is instructions for the agent only.

Does Go Concurrency Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Go Concurrency Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Go Concurrency Patterns use?

Go Concurrency Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Go Concurrency Patterns use?

About 693 tokens (SKILL.md is roughly 2.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.7k tokens, read only when the agent opens those files.

What are the alternatives to Go Concurrency Patterns?

Skills that share tags, products or a category with Go Concurrency Patterns: Jules (sanjay3290/ai-skills, 431 stars), Frappe Errors Clientscripts (Impertio-Studio/Frappe_Claude_Skill_Package, 188 stars), Debugger (TheDecipherist/claude-code-mastery-project-starter-kit, 338 stars) and Supabase Advanced Troubleshooting (jeremylongshore/tons-of-skills-marketplace, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go Concurrency Patterns?

wshobson (a GitHub user) maintains it in wshobson/agents, which has 40,305 GitHub stars. The repository holds 142 skills in this directory. The repository was last updated on October 5, 2026.

Source: wshobson/agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.