agentleFS
DankosikDankosik/golang-backend-skills/skills/go-concurrency/SKILL.md

go-concurrency

Skill0 starsChanged 3 months agoMITView on GitHub

Implement or review Go goroutines, channels, shared-state synchronization, cancellation, joining, and work bounds.

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use go-interfaces, go-linting and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • cxuuSkill

    go-interfaces

    Use when defining or implementing Go interfaces, designing abstractions, creating mockable boundaries for testing, or composing types through embedding. Also use when deciding whether to accept an interface or return a concrete type, or using type assertions or type switches, even if the user doesn't explicitly mention interfaces. Does not cover generics-based polymorphism (see go-generics).

    Also in 3 projects that use this

  • saisudhir14Skill

    go-linting

    Use when setting up linting, configuring golangci-lint, or fixing linter warnings in Go projects. Provides recommended linter sets, golangci-lint configuration, CI integration, and Makefile targets.

    Also in 3 projects that use this

  • saisudhir14Skill

    go-error-handling

    Use when writing, reviewing, or debugging Go error handling code. Covers error wrapping, sentinel errors, custom error types, error joining, single handling, and error flow patterns. Based on Google and Uber style guides.

    Also in 3 projects that use this

  • xxxryanSkill

    go-code-review

    Perform a senior Go code review on a diff or files, focusing on correctness, idiomatic Go, error handling, maintainability, and performance. Use when the user asks for review, refactor feedback, or PR comments for Go services.

    Also in 3 projects that use this

The file

Files
SKILL.md

Go Concurrency

Ownership. Account for each goroutine in the affected path from admission to termination: who observes failure, requests cancellation, releases blocking operations, and waits for completion? Honor requirements and preserve settled choices outside the requested change.

Keep sequential work sequential unless overlap serves a current need. Reuse standard synchronization and existing coordination libraries. A mutex often expresses shared state more clearly than a channel protocol; channels fit communication and ownership transfer. Name the synchronization edge that makes shared reads and writes safe. Concurrent containers and atomics do not make a compound business operation atomic.

Propagate context through dependent calls and release derived contexts. Cancellation is a signal, not a join or proof that an external effect stopped. Give every affected send, receive, wait, and I/O operation an exit story. Give channel closure one owner who can establish that all sends have finished. Do not detach request work without a deliberate lifetime and failure owner.

Bound pending work as well as active work. A semaphore acquired inside an unlimited number of goroutines still permits unlimited waiting. When using errgroup, account for blocking admission and the derived context ending when Wait returns.

Verify the changed race, cancellation, capacity, or shutdown property with controlled coordination and bounded waits. Use the race detector for affected shared-memory paths where supported; it finds exercised races, not liveness failures. Observe worker termination separately and leave no test goroutines running. Report unsupported checks rather than substituting a weaker proof.

For review-only work, do not edit files. Ground each finding in the affected synchronization or blocking path and a concrete failing interleaving; check for an existing exit or join before claiming it is absent.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.