go-concurrency-review
Review and implement safe concurrency patterns in Go: goroutines, channels, sync primitives, context propagation, and goroutine lifecycle management.
Skill by eduardo-sl
Chalk Labs
Need help deploying go-concurrency-review?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/eduardo-sl-go-concurrency-review
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design, backend, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/go-concurrency-review
Tools it pre-approves 7
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
ReadEditWriteGlobGrepBash(go:*)Bash(gofmt:*)
What's inside
- Skill name
go-concurrency-review- Description
- Review and implement safe concurrency patterns in Go: goroutines, channels, sync primitives, context propagation, and goroutine lifecycle management. Use when writing concurrent code, reviewing async patterns, checking thread safety, debugging race conditions, or designing producer/consumer pipelines. Trigger examples: "check thread safety", "review goroutines", "race condition", "channel patterns", "sync.Mutex", "context cancellation", "goroutine leak". Not for: general style (go-coding-standards), HTTP handler patterns (go-api-design).
- License
- MIT
- Compatibility
- Designed for Claude Code or similar AI coding agents working on Go projects. Requires the Go toolchain. Race detection requires cgo (CGO_ENABLED=1).
- Allowed tools
- Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*)
- Metadata
- author: eduardo-sl · version: 1.8.0
- Instructions
- 227 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves some shell commands
Files (4)
- SKILL.md
- channels.md · references/
- goroutine-patterns.md · references/
- mutex-and-atomics.md · references/
SKILL.md (first lines)
# Go Concurrency Review
Concurrency in Go is powerful and deceptively easy to get wrong.
These patterns prevent goroutine leaks, data races, and deadlocks.
Detailed reference material, loaded on demand:
- `references/channels.md` — sizing, signalling, producer shutdown.
- `references/mutex-and-atomics.md` — mutex placement, lock scope, atomics,
`sync.Once`, RWMutex pitfalls, `sync.Map`, `sync.Pool`, `singleflight`.
- `references/goroutine-patterns.md` — panic recovery at goroutine
boundaries, pipelines, bounded fan-out, timers.
Read a reference file only when the section below is not enough.
## Operating Modes
Pick the mode that matches the request before starting:
- **Implementation** — writing new concurrent code. Follow the patterns
below as construction rules.
- **Diff review** (default) — check changed code against every section,
paying extra attention to new `go` statements and shared state.
- **Leak/race hunt** — a symptom is already observed (growing goroutine
count, `-race` report, deadlock). Start from "Auditing Large Codebases"
and the Race Detection section to localize it. On Go 1.27+ read the
`goroutineleak` profile first: it lists goroutines blocked on something
nothing can ever unblock. The go-troubleshooting skill owns the procedure.
## Auditing Large Codebases
For a full concurrency audit, run these independent passes rather than
one linear read:
1. **Goroutine lifecycle:** find every `go` statement
(`grep -rn "go func\|go [a-zA-Z]" --include="*.go"`) and verify each
has a termination path (context, closed channel, WaitGroup).
2. **Shared state:** find package-level vars and struct fields accessed
from multiple goroutines; verify mutex/atomic protection.
3. **Channel topology:** map producers/consumers per channel; verify
close-exactly-once and no send-on-closed paths.
4. **Context propagation:** verify blocking calls accept and respect
`context.Context`.
If your environment supports delegating work to parallel sub-agents or
tasks, assign each pass to one; otherwise run them in order. Findings
must cite `file.go:line`. Always finish with `go test -race ./...`.
## Choosing a Primitive
| Need | Use | Why |
|---|---|---|
| Hand data from one goroutine to another | Channel | The send transfers ownership |
| Guard fields of a shared struct | `sync.Mutex` / `RWMutex` | Short critical sections, explicit owner |
| A counter or flag | `atomic.Int64`, `atomic.Bool` | No lock, no torn reads |
| Compute once, read many | `sync.OnceValue` | Exactly once, even under contention |
| Collapse concurrent identical calls | `singleflight.Group` | One backend call per key, not N |
| Reuse short-lived buffers on a hot path | `sync.Pool` | Fewer allocations — only after a profile |
| Waiting for goroutines | Use |
|---|---|
| Results don't fail | `sync.WaitGroup` (`wg.Go`, Go 1.25+) |
| First error matters | `errgroup.Group` |
| First error cancels the rest | `errgroup.WithContext` |
| Cap how many run at once | `errgroup` + `SetLimit(n)` — not a hand-rolled pool |
## 1. Goroutine Lifecycle Management
EVERY goroutine MUST have a clear termination path. No fire-and-forget.
### Use `errgroup` for coordinated goroutines:
```go
g, ctx := errgroup.WithContext(ctx)
g.Go(func() error {
return fetchUsers(ctx)
})
g.Go(func() error {
return fetchOrders(ctx)
})
if err := g.Wait(); err != nil {
return fmt.Errorf("fetch data: %w", err)
}
```
### Long-running goroutines must respect context:
```go
func (w *Worker) Run(ctx context.Context) error {
for {
select {
case <-ctx.Done():
return ctx.Err()
case job := <-w.jobs:
if err := w.process(job); err != nil {
w.logger.Error("process job", slog.Any("error", err))
}
}
}
}
```
### Start goroutines in the owner, not the callee:
```go
// ✅ Good — caller controls lifecycle
go worker.Run(ctx)
// ❌ Bad — function secretly starts goroutine
func NewWorker() *Worker {
w := &Worker{}
go w.run() // hidden goroutine — caller has no control
return w
}
```From eduardo-sl/go-agent-skills, MIT.
More from eduardo-sl/go-agent-skills
- 0.676score
go-cli
eduardo-sl
Build command-line tools in Go: flag handling, subcommands, stdin/stdout discipline, exit codes, signal handling, and when Cobra/Viper earn their weight over…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-modernize
eduardo-sl
Modernize Go code to use current language features and standard library additions, Go 1.21 through 1.27: generics and generic methods, log/slog, errors.Join…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-graphql
eduardo-sl
Build GraphQL servers in Go with gqlgen: schema-first generation, resolver structure, the N+1 problem and dataloaders, complexity and depth limits, error…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-grpc
eduardo-sl
gRPC services in Go beyond the basics: proto design, status codes and error details, interceptors, deadlines, streaming, health checks, and graceful shutdown.
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-interface-design
eduardo-sl
Go interface design patterns: implicit interfaces, consumer-side definition, interface compliance verification, composition, the…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-api-design
eduardo-sl
HTTP/REST API design for Go services: handlers, ServeMux routing, middleware, request validation, pagination, idempotency, health checks, error responses, and…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-coding-standards
eduardo-sl
Go coding standards and style conventions grounded in Effective Go, Go Code Review Comments, and production-proven idioms.
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-context
eduardo-sl
Correct usage of context.Context in Go: propagation, cancellation, timeouts, deadlines, values, and common anti-patterns.
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-data-structures
eduardo-sl
Correct use of Go's built-in data structures: slices (nil vs empty, append semantics, aliasing, preallocation), maps (comma-ok, sets, iteration order)…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-documentation
eduardo-sl
Go documentation conventions: godoc comments, package docs, testable Example functions, deprecation notices, doc links, and project docs (README, CHANGELOG…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-error-handling
eduardo-sl
Go error handling patterns, wrapping, sentinel errors, custom error types, and the errors package.
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-naming
eduardo-sl
Go naming conventions for packages, files, types, functions, methods, receivers, variables, constants, errors, acronyms and tests, grounded in Effective Go…
SkillAFreshness: A★ 82Claude Code +9
Signals
- Stars
- 82
- Forks
- 10
- Open issues
- 0
- Last commit (this folder)
- Oct 14, 2026 (20 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.8.0
- License
- MIT
- Repository
- github.com/eduardo-sl/go-agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from eduardo-sl
- 0.676score
go-api-design
eduardo-sl
HTTP/REST API design for Go services: handlers, ServeMux routing, middleware, request validation, pagination, idempotency, health checks, error responses, and…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-cli
eduardo-sl
Build command-line tools in Go: flag handling, subcommands, stdin/stdout discipline, exit codes, signal handling, and when Cobra/Viper earn their weight over…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-graphql
eduardo-sl
Build GraphQL servers in Go with gqlgen: schema-first generation, resolver structure, the N+1 problem and dataloaders, complexity and depth limits, error…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-grpc
eduardo-sl
gRPC services in Go beyond the basics: proto design, status codes and error details, interceptors, deadlines, streaming, health checks, and graceful shutdown.
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-interface-design
eduardo-sl
Go interface design patterns: implicit interfaces, consumer-side definition, interface compliance verification, composition, the…
SkillAFreshness: A★ 82Claude Code +9 - 0.676score
go-coding-standards
eduardo-sl
Go coding standards and style conventions grounded in Effective Go, Go Code Review Comments, and production-proven idioms.
SkillAFreshness: A★ 82Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get go-concurrency-review running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
go-concurrency-review skill. Agent Mart. https://agentmart.dev/skills/eduardo-sl-go-concurrency-review (last updated 2026-10-24)