Go concurrency
My personal pi harness configuration.
npx -y skills add nyquistwilder/personal-pi --skill go-concurrencyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Go concurrency workflow for goroutines, channels, mutexes, contexts, cancellation, worker pools, pipelines, backpressure, timeouts, lifecycle management, graceful shutdown, and race-free tests.
SKILL.md
2.4 KB, as published. Nobody here has run it
Go Concurrency
Rule
Make goroutine ownership, cancellation, backpressure, error propagation, and shutdown explicit. Use concurrency only when it simplifies I/O or throughput; do not add goroutines for style.
Hard Stops
Stop when:
- Runtime ownership, cancellation path, channel close responsibility, or shutdown behavior is unclear.
- A design could leak goroutines, block forever, race on shared state, or drop errors.
- The only proof of correctness is
time.Sleep. - The change needs unbounded goroutines, unbounded queues, global mutable state, or data-race suppression.
Defaults
- Pass
context.Contextinto blocking operations; do not store contexts in structs. - Prefer simple synchronous code until concurrency is required.
- Use
errgrouponly when already present or approved; otherwise coordinate explicitly withsync.WaitGroup, channels, and contexts. - Use bounded channels or semaphores for backpressure.
- Prefer mutexes for shared state and channels for ownership/communication; do not force one model everywhere.
- Close channels from the sending side that owns production.
- Handle
os.Signalshutdown at the application edge.
Workflow
- Define the concurrency goal and shared resources.
- Design ownership: who starts goroutines, who cancels them, who closes channels, who waits.
- Define error propagation, timeout, retry, and cleanup behavior.
- Add deterministic tests with explicit synchronization, fake clocks, contexts, or controlled channels.
- Run
go test -racefor touched packages and preferablygo test -race ./.... - Run regular tests, lint, and
just check.
Antipatterns
- Fire-and-forget goroutines in libraries.
- Unbounded worker creation per request or input item.
- Closing a channel from receivers or multiple senders without coordination.
- Holding locks while doing network/disk I/O or calling user callbacks.
- Swallowing
ctx.Err()or converting cancellation into success. - Sleeps in tests instead of deterministic synchronization.
Completion
Report lifecycle model, cancellation/backpressure/error choices, race-test results, tests, and remaining concurrency risks.