go-concurrency-safety

go-concurrency-safety is a skill for Claude Code, Codex from PlamenTSV/plamen. It costs 40 tokens per session (1,800 once invoked), scanned A, original, MIT.

A Go code review supplement focused on concurrency hazards, such as unpredictable map order, leaked goroutines, unsafe mutex ordering, and missing cancellation or panic handling.

In plain words
What is it for?
Use it while reviewing Go node or client code, especially when map iteration affects hashes or state, or when goroutines, locks, contexts, and panic boundaries are involved.
Why use it?
It catches production bugs that can arise when concurrent code behaves differently across runs or fails to stop and recover safely.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it while reviewing Go node or client code, especially when map iteration affects hashes or state, or when goroutines, locks, contexts, and panic boundaries are involved.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plamentsv/plamen/go-concurrency-safety
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add PlamenTSV/plamen --skill go-concurrency-safety
Clone the repo
git clone --depth 1 https://github.com/PlamenTSV/plamen

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-concurrency-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/plamentsv/plamen/go-concurrency-safety/github.svg)](https://agentmods.dev/skills/plamentsv/plamen/go-concurrency-safety)
Your own site
<a href="https://agentmods.dev/skills/plamentsv/plamen/go-concurrency-safety"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/go-concurrency-safety/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-concurrency-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/plamentsv/plamen/go-concurrency-safety"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/go-concurrency-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,800 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01800
Opus 5.5 $0.00016 $0.00720
Sonnet 5.5 $0.00008 $0.00360
Haiku 4.5 $0.00004 $0.00180

Measured 1mo ago against content hash 86a325d6516e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-concurrency-safety scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/skills/injectable/l1/go-concurrency-safety/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Injectable Skill: Go Concurrency Safety

L1 trigger: L1_PATTERN=true AND target language = Go Inject Into: Every L1 depth agent working on Go code, in addition to the main skill Finding prefix: [GO-N] Status: v0.1 draft, Round 4 exemplars pending

When This Skill Activates

Supplement to the main L1 skills when the target is written in Go. It codifies the Go-specific traps that turn otherwise-correct logic into production bugs. These are drawn from the Cosmos-SDK, Geth, Erigon, and CometBFT bug histories.

1. Map Iteration Non-Determinism

Go maps iterate in unspecified order. Production bug class: any consensus computation that ranges over a map[K]V and uses the order in its output will produce different results on different nodes.

Detection:

  • Ast-grep for $_, $_ := range $MAP where $MAP is declared as map[...]...
  • For each hit in a consensus-critical path, check if the iteration result affects any stored state, signed message, or hash input

Fix pattern:

keys := make([]string, 0, len(m))
for k := range m {
    keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
    v := m[k]
    // use (k, v)
}

Alternative: use btree or sort.SliceStable on a converted slice.

Tag: [GO-MAP-ITER:{loc}:{consumer}]

2. Goroutine Leaks

Goroutines that are started but never terminated. Over hours/days, a leak accumulates and eventually OOMs the node.

Common patterns:

  • Goroutine blocked on <-ch where the sender path can return without sending
  • Goroutine blocked on http.Get / network call without context timeout
  • Goroutine in a for loop without a cancellation check
  • Goroutine spawned inside a handler that outlives the handler's parent context

Detection:

  • Ast-grep go $FUNC(...) / go func() { ... }()
  • For each, trace the function body: is there a termination condition? Is it guaranteed to fire?
  • Check every select inside: does it have a case <-ctx.Done()?

Tag: [GO-GOROUTINE-LEAK:{spawn-loc}:{blocked-on}]

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 145 lines · 40 tokens per session scan A 86a325d6516e

Subscribe to this mod's changes

go-concurrency-safety is a skill published in the GitHub repository PlamenTSV/plamen (309 stars, last pushed 1mo ago), licensed MIT. It adds 40 tokens to every session and 1,800 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

golang-refactoring

Golang refactoring — safe, at-scale restructuring of existing Go code: a coverage-adaptive safety net, behavior-preserving transforms (gopls Rename/Extract, gofmt -r, gopatch), the Fowler catalog mapped to Go, breaking import cycles, and small stacked PRs. Apply when a function or type has grown too large, a code…

samber/cc-skills-golang · 220 tokens

agents-md

Generate AGENTS.md files for Go, Rust, TypeScript, and Java projects. Use this skill whenever the user asks to create, scaffold, bootstrap, update, or review an AGENTS.md (or agent-instructions, CLAUDE.md, repo guide for agents) file in a codebase. Also trigger when the user says "add AGENTS.md", "make this repo…

dimetron/pi-go · 138 tokens

ring:verifying-code

Verifying a Go project: runs every quality check (lint, vet, imports, format, docs, unit, integration, E2E) and returns a single MERGEREADY or NEEDSFIX verdict. Report-only: never fixes anything. Use for a quick pre-merge or pre-PR check outside a full dev-cycle. Skip when not a Go project, when you want a single…

LerianStudio/ring · 101 tokens

go-architecture-review

Good architecture makes the next change easy. Bad architecture makes every change scary.

eduardo-sl/go-agent-skills · 0 tokens

go-code-review

Structured code review process for Go. Reviews should be constructive, specific, and cite the relevant principle behind each finding.

eduardo-sl/go-agent-skills · 0 tokens

go-concurrency-review

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…

eduardo-sl/go-agent-skills · 112 tokens