Best for
- Code contains go func, goroutine creation
- Code uses channels, sync primitives (Mutex, RWMutex, WaitGroup)
- Code uses errgroup, singleflight
johnqtcg/awesome-skills/skills/go-concurrency-review/SKILL.md
Review Go code for concurrency safety and goroutine lifecycle issues including race conditions, deadlocks, goroutine leaks, mutex misuse, and context propagation. Trigger when code contains go func, channels, sync primitives, WaitGroup, errgroup, or goroutine lifecycle management. Use for concurrency-focused review of Go projects.
Decision brief
Review Go code for concurrency safety and goroutine lifecycle issues including race conditions, deadlocks, goroutine leaks, mutex misuse, and context propagation. Trigger when code contains go func, channels, sync primitives, WaitGroup, errgroup, or goroutine lifecycle management.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/go-concurrency-review"Inspect the Agent Skill "go-concurrency-review" from https://github.com/johnqtcg/awesome-skills/blob/d63cf368c1b106871b56454bd73c293701bef500/skills/go-concurrency-review/SKILL.md at commit d63cf368c1b106871b56454bd73c293701bef500. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Define scope — files/diff under review. Apply Generated Code Exclusion Gate. 2. Gather evidence — read changed files, identify concurrency patterns: go func, chan, sync., errgroup, context.WithCancel, select, time.After. 3. Load references — always load go-concurrency-pattern…
Concurrency and lifecycle only — never comment on security, performance, style, tests, errors, or logic
Identify concurrency defects and goroutine lifecycle issues in Go code. Scope: race conditions, deadlocks, goroutine leaks, mutex misuse, context propagation, and lifecycle management.
Code contains go func, goroutine creation
Security vulnerabilities → go-security-review
Permission review
The documentation asks the agent to run terminal commands or scripts.
Never claim `go test -race` ran unless it actually produced output. If not run: state reason + exact command.The documentation asks the agent to run terminal commands or scripts.
`go test -race`: PASS | FAIL | Not run (reason + command)Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 93/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 30 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Identify concurrency defects and goroutine lifecycle issues in Go code. Scope: race conditions, deadlocks, goroutine leaks, mutex misuse, context propagation, and lifecycle management.
This skill does NOT cover: security vulnerabilities, performance optimization, code style, test quality, error handling patterns, or business logic — those belong to sibling vertical skills.
go func, goroutine creationsync primitives (Mutex, RWMutex, WaitGroup)errgroup, singleflightgo-security-reviewgo-performance-reviewgo-quality-reviewgo-error-reviewgo-logic-reviewNever claim go test -race ran unless it actually produced output. If not run: state reason + exact command.
Read go.mod for go directive. Key version gates:
errgroup.SetLimit (Go 1.20+)sync.OnceValue / sync.OnceFunc (Go 1.21+)MUST quote specific code evidence satisfying precondition. Category match alone insufficient.
Embedded anti-examples:
v := v unnecessary.Exclude: *.pb.go, *_gen.go, mock_*.go. Note excluded files in Execution Status.
go func, chan, sync.*, errgroup, context.WithCancel, select, time.After.go-concurrency-patterns.md.go test -race if feasible — report output. If not feasible, state reason + exact command.This skill uses mechanical grep pre-scanning to guarantee zero missed checklist items. 13 of 14 items are grep-gated; 1 is semantic-only.
$TMPDIR/review_snippet.go)Include in Execution Status: Grep pre-scan: X/13 items hit, Z confirmed as findings (1 semantic-only)
Several items share the trigger go\s+func but have different secondary conditions:
go\s+func HIT AND recover() NOT found in goroutine bodygo\s+func HIT AND inside for loop AND Go version < 1.22go\s+func HIT AND NONE of SetLimit|semaphore|maxConcurrency|worker.*pool|make(chan struct found in same scopeRun go\s+func grep ONCE, then apply all compound conditions to the results.
All High severity unless marked (Medium).
| # | Item | Code Pattern Triggers | Grep Pattern |
|---|---|---|---|
| 1 | Goroutine leak | go func without context cancel or channel close on return path | go\s+func|go\s+\w+\( |
| 2 | Data race | Shared map/slice/var written from multiple goroutines without sync | go\s+func (compound: ALSO check shared variable write in closure — semantic confirmation required) |
| 3 | Mutex misuse | Missing defer mu.Unlock(), lock copying (value receiver on mutex-holding struct), inconsistent RWMutex | sync\.Mutex|sync\.RWMutex |
| 4 | Channel deadlock | Unbuffered send without receiver, missing close(), select without default on full channel | make\(chan|<-chan|chan<-|<-\s*\w+ |
| 5 | Missing errgroup | Multiple goroutines coordinated without error propagation — should use errgroup.Group | sync\.WaitGroup|wg\. |
| 6 | Missing context propagation | context.Background() where parent ctx available; context.Value for request-scoped data | context\.Background\(\)|context\.TODO\(\)|context\.Value |
| 7 | sync.Pool / sync.Once misuse | Pool without Reset before Put; Once panic caching (Go < 1.21, use OnceValue after) | sync\.Pool|sync\.Once |
| 8 | Unrecovered goroutine panic | Spawned goroutine without defer func() { recover() }() — unrecovered panic crashes process | go\s+func (compound: AND NOT recover\(\) in goroutine body — semantic confirmation required) |
| 9 | Missing graceful shutdown | No shutdown sequence: stop accepting → drain in-flight → cleanup resources | http\.Server|ListenAndServe|Shutdown |
| 10 | Timer/Ticker leak | time.After in loop (allocates each iteration), ticker.Stop() not called | time\.After|time\.NewTicker|time\.NewTimer |
| 11 | Misplaced WaitGroup.Add | Add inside goroutine instead of before go statement — must happen-before | wg\.Add|WaitGroup |
| 12 | Loop variable capture (Go < 1.22) | Missing v := v shadow in goroutine closure — check Go version first | go\s+func (compound: check if inside for loop — version-gated by Go < 1.22) |
| 13 | Missing singleflight (Medium) | Concurrent identical requests without deduplication — cache stampede risk | Semantic-Only (no grep pattern — requires understanding concurrent request patterns) |
| 14 | Unbounded goroutine creation | One goroutine per request/item without semaphore, worker pool, or errgroup.SetLimit | go\s+func (compound: AND NOT SetLimit|semaphore|maxConcurrency|worker.*pool|make\(chan\s+struct) |
High — Confirmed crash, data corruption, or resource leak: race condition, deadlock, goroutine leak, panic propagation.
Medium — Potential issue under specific conditions: unbounded goroutines under high load, missing singleflight for cache.
go test -race output is strongest evidence — run when feasiblepath:linemust-fix | follow-upGo version: X.YGrep pre-scan: X/13 items hit, Z confirmed as findings (1 semantic-only)go test -race: PASS | FAIL | Not run (reason + command)Excluded (generated): list or NoneReferences loaded: list1-2 lines with finding count.
### Findings
#### [High] Race Condition on Package-Level Map
- **ID:** CONC-001
- **Location:** `internal/cache/store.go:12,15`
- **Impact:** Concurrent HTTP handlers write to shared map — will panic with "concurrent map writes" under load
- **Evidence:** `var store = map[string]string{}` at L5; `store[k] = v` in Set() at L12 called from handler goroutines; no mutex protection
- **Recommendation:** Use `sync.RWMutex` to protect map access, or replace with `sync.Map` if read-heavy
- **Action:** must-fix
#### [Medium] Unbounded Goroutine Creation
- **ID:** CONC-002
- **Location:** `internal/worker/dispatch.go:34`
- **Impact:** Under high load, creates unbounded goroutines — OOM risk
- **Evidence:** `for _, item := range items { go processItem(item) }` — no semaphore or pool limiting concurrency
- **Recommendation:** Use `errgroup.SetLimit(N)` or bounded worker pool
- **Action:** follow-up
### Suppressed Items
#### [Suppressed] Map Race in Test Helper
- **Reason:** Map at test_helpers.go:20 is created in TestMain and only read during subtests (no concurrent writes). Anti-example: "map only accessed within single goroutine"
### Execution Status
- Go version: 1.21
- Grep pre-scan: 8/13 items hit, 2 confirmed as findings (1 semantic-only)
- go test -race: PASS
- Excluded (generated): None
- References loaded: go-concurrency-patterns.md
### Summary
1 High (race condition), 1 Medium (unbounded goroutines).
If no issues found: state No concurrency findings identified. Still output Execution Status.
| Reference | Load When |
|---|---|
references/go-concurrency-patterns.md | Always |
references/go-review-anti-examples.md | Always |
go test -race — it is the most authoritative evidence sourceFrequently asked questions
Review Go code for concurrency safety and goroutine lifecycle issues including race conditions, deadlocks, goroutine leaks, mutex misuse, and context propagation. Trigger when code contains go func, channels, sync primitives, WaitGroup, errgroup, or goroutine lifecycle management.
The source record exposes this install command: npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/go-concurrency-review". Inspect the command and pinned source before running it.
Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
garrytan/gbrain
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing
oaustegard/claude-skills
Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre